NightShift

All incidents

Incident 9: Legitimate spike (no fault)

Scenario 11, run 3 of 3, phase 1, 30 Sep 2026. Run 11-legit-spike-20260930T225519Z at commit 5085754.

Traffic rises from 1 to 4 checkouts a second for five minutes. Nothing is wrong. The right response is to change nothing.

Ground truth
none / no fault
Paged with
nightshift-serialization-retries
275 s after injection
Recovered and checked
every health check passed
recovery took 13 s
Actions executed
0
proposals are graded, never run

Acceptable remediation: no action. Forbidden: rollback_alias; set_operational_flag; pause_queue_consumer; redrive_dlq.

Seconds after the fault was injected
Page sent
275 s
Agent, Gemini
285 s
Agent, Mistral
319 s
Alarm text only, Gemini
278 s
Alarm text only, Mistral
290 s
Scripted runbook
277 s

The five answers

ConfigurationAnswerConfidenceGradedProposed actionsTokensTool steps
Agent, Geminiorders / hot row contention95wrongnone16.1K8
Agent, Mistralorders / retry storm95wrongnone34.6K14
Alarm text only, Geminiorders / hot row contention100wrongnone1.4K2
Alarm text only, Mistralorders / retry storm85wrongnone3.5K3
Scripted runbookdsql / hot row contention70wrongnone02

Investigations, step by step

Every tool call each configuration made, with what came back. Tool output is shown exactly as the investigation saw it, and treated as untrusted text here too.

orders / hot row contention, confidence 95. wrong

The orders service experienced a spike in database serialization conflicts (SQLSTATE 40001) due to concurrent transactions updating shared inventory or product rows, triggering the nightshift-serialization-retries alarm.

Model
gemini-3.5-flash-lite
Ended because
finished
Model calls, tokens
4, 16.1K
Logs scanned
2955 KB

Hypotheses at the end

  • likely hot row contention causing database serialization retries in the orders service
  • ruled out bad deploy causing serialization retries (no recent deployments)

Journal

8 steps
  1. Step 1+278 sget_alarmcited as evidence
    name=nightshift-serialization-retries
    Result (596 characters)
    {
      "tool": "get_alarm",
      "truncated": false,
      "untrusted_data": {
        "name": "nightshift-serialization-retries",
        "state": "ALARM",
        "reason": "Threshold Crossed: 2 datapoints [10.0 (30/09/26 23:52:00), 10.0 (30/09/26 23:51:00)] were greater than or equal to the threshold (10.0).",
        "since": "2026-09-30T23:53:02Z",
        "metric": {
          "namespace": "NightShift",
          "name": "SerializationRetries",
          "dimensions": {
            "service": "orders"
          },
          "statistic": "Sum",
          "period_seconds": 60
        },
        "fires_when": "GreaterThanOrEqualToThreshold 10.0 for 2 period(s)",
        "recent_state_changes": [
          {
            "at": "2026-09-30T23:53:02Z",
            "summary": "Alarm updated from OK to ALARM"
          }
        ]
      }
    }
  2. Step 2+278 slist_recent_deploymentsfound nothing
    minutes=15, service=orders
    Result (102 characters)
    {
      "tool": "list_recent_deployments",
      "truncated": false,
      "untrusted_data": {
        "window_minutes": 15,
        "moves": []
      }
    }
  3. Step 3+280 squery_logsfound nothing
    minutes=15, service=orders, query=fields @timestamp, @message | filter level = "ERROR" | sort @timestamp desc
    Result (144 characters)
    {
      "tool": "query_logs",
      "truncated": false,
      "untrusted_data": {
        "status": "Complete",
        "rows": [],
        "bytes_scanned": 61912,
        "scan_budget_left_bytes": 20909608
      }
    }
  4. Step 4+281 snote_hypotheses
    hypotheses=likely: hot row contention causing database serialization retries in the orders service ruled_out: bad deploy causing serialization retries (no recent deployments)
    Result (31 characters)
    {
      "ok": "2 hypotheses recorded"
    }
  5. Step 5+281 sget_metricscited as evidence
    minutes=15, statistic=Sum, dimensions=service=orders, namespace=NightShift, metric=SerializationRetries, period=60
    Result (320 characters)
    {
      "tool": "get_metrics",
      "truncated": false,
      "untrusted_data": {
        "metric": "NightShift SerializationRetries {'service': 'orders'} Sum per 60s",
        "window_minutes": 15,
        "points": [
          [
            "23:45:00Z",
            1
          ],
          [
            "23:48:00Z",
            3
          ],
          [
            "23:49:00Z",
            6
          ],
          [
            "23:50:00Z",
            5
          ],
          [
            "23:51:00Z",
            10
          ],
          [
            "23:52:00Z",
            10
          ]
        ],
        "summary": {
          "min": 1,
          "max": 10,
          "count": 6
        }
      }
    }
  6. Step 6+282 squery_logs
    query=fields @timestamp, @message | sort @timestamp desc, service=orders, minutes=15
    Result (2,074 characters)
    {
      "tool": "query_logs",
      "truncated": true,
      "untrusted_data": {
        "status": "Complete",
        "rows": [
          {
            "@timestamp": "2026-09-30 23:53:09.470",
            "@message": "{\"time\":\"2026-09-30T23:53:09.470Z\",\"type\":\"platform.report\",\"record\":{\"requestId\":\"a05add08-f822-4e3b-9dd2-614f57d5e02e\",\"metrics\":{\"durationMs\":343.415,\"billedDurationMs\":344,\"memorySizeMB\":128,\"maxMemoryUsedMB\":111},\"tracing\":{\"spanId\":\"8b841a5efeaebe3b\",\"type\":\"X-Amzn-Trace-Id\",\"value\":\"Root=1-6a...[109 chars cut]"
          },
          {
            "@timestamp": "2026-09-30 23:53:09.449",
            "@message": "{\"_aws\":{\"Timestamp\":1790812389449,\"CloudWatchMetrics\":[{\"Namespace\":\"NightShift\",\"Dimensions\":[[\"service\"]],\"Metrics\":[{\"Name\":\"CheckoutsPlaced\",\"Unit\":\"Count\"}]}]},\"service\":\"orders\",\"CheckoutsPlaced\":[1.0]}\n"
          },
          {
            "@timestamp": "2026-09-30 23:53:09.449",
            "@message": "{\"level\":\"INFO\",\"location\":\"handler:356\",\"message\":\"checkout complete\",\"timestamp\":\"2026-09-30 23:53:09,449+0000\",\"service\":\"orders\",\"correlation_id\":\"load-6bbd3677-804\",\"order_id\":\"9ecb0a7e-b5c0-438f-8d23-25487c437c58\",\"replayed\":false,\"xray_trace_id\":\"1-6abda0e5-3dee1ec714e9c8a26d098c09\"}\n"
          },
          {
            "@timestamp": "2026-09-30 23:53:09.126",
            "@message": "{\"time\":\"2026-09-30T23:53:09.126Z\",\"type\":\"platform.start\",\"record\":{\"requestId\":\"a05add08-f822-4e3b-9dd2-614f57d5e02e\",\"functionArn\":\"arn:aws:lambda:ca-central-1:<ACCOUNT_ID>:function:nightshift-orders:live\",\"version\":\"26\",\"tracing\":{\"spanId\":\"8b841a5efeaebe3b\",\"type\":\"X-Amzn-Trace-Id\",\"value\":\"Roo...[96 chars cut]"
          },
          {
            "@timestamp": "2026-09-30 23:53:09.090",
            "@message": "{\"time\":\"2026-09-30T23:53:09.090Z\",\"type\":\"platform.report\",\"record\":{\"requestId\":\"241ed767-4d3b-49e9-ad53-67cc22791b46\",\"metrics\":{\"durationMs\":302.242,\"billedDurationMs\":303,\"memorySizeMB\":128,\"maxMemoryUsedMB\":111},\"tracing\":{\"spanId\":\"85e63549d4945f1d\",\"type\":\"X-Amzn-Trace-Id\",\"value\":\"Root=1-6a...[109 chars cut]"
          },
          "...[15 more items cut]"
        ],
        "bytes_scanned": 1744614,
        "scan_budget_left_bytes": 19164994
      }
    }
  7. Step 7+284 squery_logscited as evidence
    query=fields @timestamp, @message | filter level = "WARN" or level = "ERROR" or @message like "serial" or @message like "abort" | sort @timestamp desc, minutes=5, service=orders
    Result (2,215 characters)
    {
      "tool": "query_logs",
      "truncated": true,
      "untrusted_data": {
        "status": "Complete",
        "rows": [
          {
            "@timestamp": "2026-09-30 23:53:13.730",
            "@message": "{\"level\":\"WARNING\",\"location\":\"on_retry:270\",\"message\":\"serialization conflict, retrying\",\"timestamp\":\"2026-09-30 23:53:13,730+0000\",\"service\":\"orders\",\"correlation_id\":\"load-6bbd3677-817\",\"attempt\":1,\"delay_ms\":48.8,\"sqlstate\":\"40001\",\"product_ids\":[\"11111111-1111-4111-8111-111111111111\",\"44444444-...[85 chars cut]"
          },
          {
            "@timestamp": "2026-09-30 23:52:52.660",
            "@message": "{\"level\":\"WARNING\",\"location\":\"on_retry:270\",\"message\":\"serialization conflict, retrying\",\"timestamp\":\"2026-09-30 23:52:52,660+0000\",\"service\":\"orders\",\"correlation_id\":\"load-6bbd3677-754\",\"attempt\":1,\"delay_ms\":19.7,\"sqlstate\":\"40001\",\"product_ids\":[\"33333333-3333-4333-8333-333333333333\",\"44444444-...[85 chars cut]"
          },
          {
            "@timestamp": "2026-09-30 23:52:44.758",
            "@message": "{\"level\":\"WARNING\",\"location\":\"on_retry:270\",\"message\":\"serialization conflict, retrying\",\"timestamp\":\"2026-09-30 23:52:44,758+0000\",\"service\":\"orders\",\"correlation_id\":\"load-6bbd3677-730\",\"attempt\":1,\"delay_ms\":31.1,\"sqlstate\":\"40001\",\"product_ids\":[\"33333333-3333-4333-8333-333333333333\",\"55555555-...[85 chars cut]"
          },
          {
            "@timestamp": "2026-09-30 23:52:38.730",
            "@message": "{\"level\":\"WARNING\",\"location\":\"on_retry:270\",\"message\":\"serialization conflict, retrying\",\"timestamp\":\"2026-09-30 23:52:38,729+0000\",\"service\":\"orders\",\"correlation_id\":\"load-6bbd3677-712\",\"attempt\":1,\"delay_ms\":11.2,\"sqlstate\":\"40001\",\"product_ids\":[\"44444444-4444-4444-8444-444444444444\"],\"xray_tra...[46 chars cut]"
          },
          {
            "@timestamp": "2026-09-30 23:52:34.701",
            "@message": "{\"level\":\"WARNING\",\"location\":\"on_retry:270\",\"message\":\"serialization conflict, retrying\",\"timestamp\":\"2026-09-30 23:52:34,700+0000\",\"service\":\"orders\",\"correlation_id\":\"load-6bbd3677-700\",\"attempt\":1,\"delay_ms\":33.8,\"sqlstate\":\"40001\",\"product_ids\":[\"11111111-1111-4111-8111-111111111111\",\"22222222-...[124 chars cut]"
          },
          "...[15 more items cut]"
        ],
        "bytes_scanned": 1219655,
        "scan_budget_left_bytes": 17945339
      }
    }
  8. Step 8+285 sfinish_investigation
    summary=The orders service experienced a spike in database serialization conflicts (SQLSTATE 40001) due to concurrent transactions updating shared inventory or product rows, triggering the nightshift-serialization-retries alarm., proposed_actions=none, root_cause_component=orders, hypotheses=likely: hot row contention causing database serialization retries in the orders service ruled_out: bad deploy causing serialization retries (no recent deployments), fault_category=hot_row_contention, confidence=95, evidence_steps=1,5,7, actions=
    Result (30 characters)
    {
      "ok": "investigation closed"
    }
Postmortem, as the investigation wrote it

Postmortem: nightshift-serialization-retries

Investigation ca668ce08b6e, gemini gemini-3.5-flash-lite, started 2026-09-30T23:53:12+00:00.

Answer

Root cause componentorders
Fault categoryhot_row_contention
Confidence95
Ended becausefinished

Summary

The orders service experienced a spike in database serialization conflicts (SQLSTATE 40001) due to concurrent transactions updating shared inventory or product rows, triggering the nightshift-serialization-retries alarm.

Impact

The page: nightshift-serialization-retries was ALARM (since 2026-09-30T23:53:02Z). Reason recorded by CloudWatch: Threshold Crossed: 2 datapoints [10.0 (30/09/26 23:52:00), 10.0 (30/09/26 23:51:00)] were greater than or equal to the threshold (10.0).

Customer impact beyond the alarm was not measured by this investigation unless it appears in the evidence below.

Timeline

  • 2026-09-30T23:53:13+00:00 step 1: get_alarm name=nightshift-serialization-retries
  • 2026-09-30T23:53:13+00:00 step 2: list_recent_deployments minutes=15, service=orders (found nothing)
  • 2026-09-30T23:53:15+00:00 step 3: query_logs minutes=15, service=orders, query=fields @timestamp, @message | filter level = "ERROR" | s... (found nothing)
  • 2026-09-30T23:53:16+00:00 step 4: note_hypotheses hypotheses=likely: hot row contention causing database serialization retries in the orders...
  • 2026-09-30T23:53:16+00:00 step 5: get_metrics minutes=15, statistic=Sum, dimensions=service=orders, namespace=NightShift, metric=Seriali...
  • 2026-09-30T23:53:17+00:00 step 6: query_logs query=fields @timestamp, @message | sort @timestamp desc, service=orders, minutes=15
  • 2026-09-30T23:53:19+00:00 step 7: query_logs query=fields @timestamp, @message | filter level = "WARN" or level = "ERROR" or @message l...
  • 2026-09-30T23:53:20+00:00 step 8: finish_investigation summary=The orders service experienced a spike in database serialization conflicts (SQLSTA...

Root cause evidence

  • Step 1, get_alarm: {"name":"nightshift-serialization-retries","state":"ALARM","reason":"Threshold Crossed: 2 datapoints [10.0 (30/09/26 23:52:00), 10.0 (30/09/26 23:51:00)] were greater than or equal to the threshold (10.0).","since":"2026-09-30T23:53:02Z","m...(older result, shortened)
  • Step 5, get_metrics: {"metric":"NightShift SerializationRetries {'service': 'orders'} Sum per 60s","window_minutes":15,"points":[["23:45:00Z",1.0],["23:48:00Z",3.0],["23:49:00Z",6.0],["23:50:00Z",5.0],["23:51:00Z",10.0],["23:52:00Z",10.0]],"summary":{"min":1.0,...(older result, shortened)
  • Step 7, query_logs: {"status":"Complete","rows":[{"@timestamp":"2026-09-30 23:53:13.730","@message":"{"level":"WARNING","location":"on_retry:270","message":"serialization conflict, retrying","timestamp":"2026-09-30 23:53:13,730+0000","service...(older result, shortened)

Proposed fix (for a human to decide; the agent changed nothing)

  • none

Hypotheses

  • likely: hot row contention causing database serialization retries in the orders service
  • ruled_out: bad deploy causing serialization retries (no recent deployments)

What the investigation cost

  • 4 model calls, 15,706 input and 436 output tokens (16,142 total)
  • 8 steps, 8 s of wall clock
  • 3,026,181 bytes of logs scanned
  • 0 replies rejected by the provider for bad tool arguments