Blog
AdvancedReferenceProduction Operations

The incident investigation workflow

The consistent production-troubleshooting method - detect, establish impact, collect evidence, form hypotheses, test safely, root-cause, mitigate, measure, validate, monitor, document - applied to realistic SQL Server incidents.

Applies to
SQL Server2016-2025 (13.x-17.x)
matureUpdated Reviewed
advancedAssumes production experience with the basics.

What you will be able to do

  • Run the eleven-step incident workflow under pressure without skipping evidence.
  • Establish business impact before touching the technical cause.
  • Test a hypothesis safely - a mitigation you can roll back, not a guess in production.
  • Write a post-incident record that prevents recurrence.

Concepts covered

Every diagnostic lesson so far taught what to look at; this one teaches the order in which you do it when the system is down and someone is watching. The workflow exists because under incident pressure the failure is never lack of knowledge - it is skipping the evidence step and fixing the wrong thing.

The analogy is a plumber called to a flooded kitchen. The first move is the stopcock - stop the water, restore a dry floor - long before anyone opens a wall to find which joint failed. With the water off, the plumber works in order: what is affected, what the wet trail shows, the few joints it could be, and a test that changes nothing irreversible. Only once the leak is stopped and measured does the root-cause work start, and the invoice listing what was found and done is the write-up that closes the job.

The eleven-step workflow

The incident workflow

  1. Detect + impact

    What broke, for whom, how badly

    Business impact first - it sets the urgency and the blast radius

  2. Collect evidence

    Wait delta, dm_exec_requests, blocking chain, error log

    The instrument that shows the failure, not the one that confirms a guess

  3. Form hypotheses

    Three candidate causes, ranked by evidence

    Commit to none yet - the competing list prevents anchoring

  4. Test safely

    A reversible mitigation or a diagnostic query

    Production is not a lab - test what changes nothing irreversible

  5. Mitigate + measure + document

    Fix, before/after, validate, monitor, write it down

    The fix is not done until measured, and the incident is not done until documented

Detect to document - the steps are deliberately ordered so impact and evidence precede any fix, and every fix is reversible and measured.

What the evidence looks like for the common incidents

The workflow is generic; the evidence-collection step is not. The incident archetypes:

Incident First evidence Competing hypotheses The rollback if wrong
Sudden blocking spike dm_exec_requests chain to a head blocker Long transaction, lock escalation, missing index on the writer’s seek Kill the head blocker (transactional), shorten its work
Throughput collapse, CPU idle PAGELATCH_* on one page Hot index page, tempdb allocation, or a latch on an allocation structure More tempdb files; key-shape change is harder to roll back - test the file count first
Everything slow, waits = PAGEIOLATCH File-stats latency + buffer hit ratio Cold buffer (memory), storage latency, or a scan reading too much Add memory is slow; the scan fix is a deploy - triage which is really starving
Commit latency jumped WRITELOG + log-volume WriteLatency Log-device latency, too many small commits, log volume filling Batching change is code; storage fix is capacity - neither instant, both scoped
Query regressed overnight Query Store: two plans, new one worse Stats update, parameter change, index dropped, compat-level change Force the known-good plan - the one truly reversible mitigation

Two rules that keep an incident honest

  • Mitigation before root-cause, always - during the incident, restore service with the safest reversible action (kill the blocker, force the plan, add a file). The deep root-cause work happens after, when the pressure is off - an incident is the worst time to redesign an index.
  • The fix is not done at deploy - it is done when the before/after metric moved and the correctness check passed and a monitor exists so the regression is caught if it returns. An undocumented mitigation is a future repeat incident.

The post-incident record

The last step is a written record: timeline, impact, the evidence that named the cause, what fixed it, what would have caught it earlier, and the action items. This is what the capstone’s “defend the design” exercise is rehearsing - the ability to say here is what broke, here is the proof, here is why the fix is right, is the senior skill the whole curriculum has been building toward.

Guided practice

A tabletop exercise: you are paged mid-afternoon - “the checkout page is timing out, everything else looks normal”. Run the workflow on paper, in order, and check yourself before moving on.

  1. Establish impact before touching the technical cause. Write the impact statement. Check: what broke (checkout timeouts), for whom (customers placing orders), how badly - that sets the urgency and the blast radius. If your first action was opening wait stats, revisit the workflow order - business impact comes first because it calibrates everything after it.
  2. Collect the evidence that shows the failure. Name the instruments you open. Check: dm_exec_requests and the blocking chain to see who is waiting on whom, a wait delta, and the error log - the instrument that shows the failure, not the one that confirms a guess. If you listed only the tool matching your favourite hypothesis, revisit the evidence stage - evidence precedes hypotheses.
  3. Form three competing hypotheses. Ranked by the evidence, committed to none. Check: for a sudden blocking spike the archetype row gives a long transaction, lock escalation, and a missing index on the writer’s seek - three candidates, because the competing list is what prevents anchoring on the first plausible cause. If you have one hypothesis, you have a guess rather than a differential - revisit the hypotheses stage.
  4. Choose the safe mitigation. Service first, root cause later. Check: kill the head blocker - transactional and reversible - not an index rebuild in production. The rule is mitigation before root-cause, always: restore service with the safest reversible action and do the deep work when the pressure is off. If you reached for a schema change mid-incident, revisit the two rules.
  5. Close the incident properly. What has to be true before it is done? Check: the before/after metric moved, the correctness check passed, a monitor exists that would catch the regression if it returns, and the post-incident record is written - timeline, impact, evidence, fix, action items. An undocumented mitigation is a future repeat incident; if you would have stopped at “latency recovered”, revisit the last two rules.

Check your understanding

Ordered easy to hard. Answer each before reading the answer; a wrong answer names where to look.

  1. Why does the workflow establish business impact before the technical cause? Impact sets the urgency and the blast radius - it decides how fast you move and how careful each test must be. If you answered “to write the ticket”, revisit the first stage - impact is a diagnostic input, not paperwork.
  2. Why three hypotheses rather than the most likely one? The competing list prevents anchoring: committing to the first plausible cause is how an incident gets fixed wrongly under pressure. If three feels like ceremony, revisit the hypotheses stage - under pressure the failure is skipping evidence, not lacking knowledge.
  3. What makes a test “safe” during an incident? Reversibility - a diagnostic query or a mitigation you can roll back, because production is not a lab. The archetype table’s last column is the pattern: kill the blocker, force the plan, add a file - every one undoes cleanly. If your test changes something irreversible, revisit the test-safely stage.
  4. A query regressed overnight and Query Store shows two plans, the new one worse. What is the mitigation, and why that one? Force the known-good plan - the one truly reversible mitigation in the archetype table. The deeper cause (statistics update, parameter change, dropped index, compat-level change) is investigated after service is restored. If you started with the statistics investigation, revisit mitigation-before-root-cause.
  5. The mitigation deployed and latency recovered. Is the incident over? No - the fix is done when the before/after metric moved, the correctness check passed, and a monitor exists to catch the regression, and the incident is done when the post-incident record is written: timeline, impact, the evidence that named the cause, what fixed it, and the action items. If you closed it at deployment, revisit the two rules - an undocumented mitigation is a future repeat incident.

Section close - the stage project and the debrief

Project: write and rehearse a blocking-spike runbook. Take the sudden-blocking-spike archetype and turn it into a one-page incident runbook for a system you know: the impact questions asked first, the evidence collected (the dm_exec_requests chain to the head blocker), the three ranked hypotheses with the test that kills each, the reversible mitigation and its rollback, the before/after measurement, and the post-incident record with action items. Walkthrough: write it in the workflow’s order and resist filling in the fix first - then rehearse it against a simulated spike, because a runbook that has never been run is a hypothesis, not a procedure. Where people get stuck: the evidence step is skipped under pressure and the first plausible cause is treated as the answer, and the record gets written as “fixed the blocker” instead of a timeline with proof - both are the failures the workflow exists to prevent.

Debrief. Having finished this section you can cap a noisy workload with the parallelism, memory and Resource Governor knobs, and run an eleven-step incident from detect to document - impact first, evidence before hypotheses, reversible mitigations, a written record. The gaps that usually remain even when it feels understood: your incident archetypes have been rehearsed against a table rather than lived under a page, and you can govern one box but have not yet asked what happens when the box itself is the ceiling - what rungs exist past tuning and what each one charges. Next session: Advanced Architecture and Labs, starting with Scaling SQL Server - the honest ladder - the lesson that turns “the box is out of resources” into the ordered menu of what you do about it.

Where SQL Server sits

How this component relates to the rest of the stack. Items without a link are not covered here yet.

Deployed with

Commonly run alongside

  • Windows Failover Clustering

Alternatives

Solves a similar problem differently