Blog

Root Cause Analysis Tools and Rules: An Odyssey

Follow a stalled search index through seven root cause analysis tools, from the deploy everyone blamed to the replay that proved why one queue stopped.

  • root cause analysis tools
  • rules of root cause analysis
  • root cause analysis
  • incident investigation
  • production incidents

At 09:18, the outlet search page says there are three kettles in stock. The catalogue says there are none. The two agreed at 09:11, and the index had been keeping up with catalogue changes all morning. In this illustrative incident, the person who reports the mismatch is on the shop floor, looking at an empty shelf while a customer reads the stock badge back to them.

By the time you join the incident, someone has pasted a 09:07 search API deploy into the chat. Another person has refreshed the page and found a toaster whose stock looks right. Meanwhile, a background worker is trying to index the same item over and over. It is a desk lamp. Nobody has reported a problem with the lamp.

That is the shipwreck. Home is the state you had at 09:11, when a catalogue change made it all the way to search and you could show the two records side by side. The point of root cause analysis is to get back there. For this incident, that means the kettle reads zero, the withdrawn lamp disappears, and the next catalogue change gets through the same partition. Until then, a quiet error graph can mean someone stopped the worker.

Table of Contents

What broke and what to save

The catalogue owns availability. Search keeps a copy so a shopper can filter by stock without waiting on a catalogue lookup for every result. The catalogue puts changes on a queue, and the indexer applies them in order within each partition. On a healthy morning, you can find a catalogue revision on a queue record and then in the search document. For the kettle, SKU K42, the first incident note records catalogue revision 893 with stock=0 and search revision 892 with stock=3. It also records the store, the search filter and the time of both reads.

The team has a switch that hides outlet stock badges while leaving browse and product detail pages up. The on-call engineer uses it first. The product detail page reads current availability from the catalogue, so support can still tell a customer what the store has. Hiding the badge contains the immediate harm. It also gives the team time to investigate without a stale value on every refresh.

While one person handles the switch, another saves a bounded slice of the indexer logs and records the worker image, effective retry settings and queue checkpoint. They retain the queue records around the stuck offset in the incident evidence store, with their order and original identifiers. In this system the queue can be inspected without advancing the consumer. An ordinary dequeue or a manual checkpoint advance would change the case while you’re reading it. If the only way to collect an artifact would delay hiding the stock badges, hide them and leave a note about what you couldn’t collect.

Give the mitigation its own timestamp. Later, when badge complaints stop, you want to be able to point to the switch at 09:21 rather than guess whether the worker caught up. Keep the source and index reads from before the switch. Once the UI has stopped displaying the value, it can’t reproduce the original observation for you.

09:18: search shows 3 kettles, catalogue shows 0

Siren: roll back the 09:07 search API deploy

Index still has K42 at revision 892, not 893

Offset 7411: lamp Q07 withdrawn, unsupported_status

Offset 7412: kettle K42 revision 893 waiting

Indexer never acknowledges past 7411

Replay after the fix: kettle shows 0, lamp is gone

Home: the 09:11 known-good path works again

The voyage home: past the 09:07 deploy everyone wanted to roll back, through the lamp that actually stalled outlet-04, and back to a replay that restores the 09:11 path.

The deploy everyone wanted to roll back

The 09:07 deploy is an attractive explanation because it has an exact timestamp and a button next to it. Start with a prediction. If the new API code is substituting an old stock value, the search index should already have revision 893 while the API returns 892. Read the document straight from the index. It has 892. That shifts the investigation upstream of the API. A separate deploy record and the worker’s startup log show the rollout touched the API, and the indexer kept running catalog-indexer:216.

The toaster test is worth following too. The person who refreshed got a plausible price and a stock badge, but the toaster had no stock change in the incident window. You could put that result in a cache yesterday and it would still look right this morning. Check an item that changed, and request a fresh response through the team’s cache bypass. The kettle is stale there as well. Now the unchanged toaster tells you where the quick smoke test fell short. It gives you an idea for a better one.

A third explanation comes from the queue graph. Lag rises, so someone suggests that the catalogue published a sale burst and the workers are simply behind. That would show up as offsets advancing under load. Partition outlet-04 stays pinned at one position while the others move and the rate of incoming catalogue updates stays near the earlier rate. Get the head record before you add workers. In an ordered consumer, a second instance assigned the same partition would inherit the same first piece of work.

Keep the rejected explanations in the incident record with the check that weakened each one. When the next person joins the call and sorts pull requests by merge time, you can give them the direct index read and the runtime image. The hypothesis-driven debugging guide goes deeper on writing a prediction before you open a log viewer.

Why is K42 still revision 892 in the index?

Ruled out: 09:07 search API deploy substitutes old stock

Index already has 892, not 893. Indexer still runs catalog-indexer:216

Ruled out: toaster smoke test means search is fine

Toaster had no stock change. Cache-bypassed kettle is stale too

Ruled out: sale burst, workers merely behind

outlet-04 is pinned while other partitions move. Incoming rate is unchanged

Held: lamp at 7411 blocks the partition

The 09:07 deploy, the toaster refresh, and the sale-burst lag story each had a check that weakened them. The lamp at 7411 is the one that still holds.

Root cause analysis tools for finding the break

Pick a unit small enough to follow. Here we have a kettle revision and a queue offset. A graph of all search traffic can tell you whether customers are still getting results, but you need to find out why this particular revision never became one of those results.

Timeline reconstruction

Build the timeline from the catalogue audit record, the producer’s publish record and the indexer’s consumer log. Keep the queue offsets alongside the times. The table below uses UTC and includes the rollout so a reader can see where it sits relative to the work that stalled.

TimeRecord
09:07The search API rollout completes.
09:11The indexer applies and acknowledges offset 7410 on outlet-04.
09:12The producer publishes lamp Q07 with status=withdrawn at 7411. The indexer logs unsupported_status for that offset.
09:13The producer publishes kettle K42, revision 893, at 7412.
09:18A shop-floor report identifies the stale kettle badge. The checkpoint still says last_acked=7410.
09:21The on-call engineer hides the outlet stock badges.

09:07 Search API rollout completes

09:11 Indexer acknowledges offset 7410 on outlet-04

09:12 Lamp Q07 published at 7411 as withdrawn. Indexer logs unsupported_status

09:13 Kettle K42 revision 893 published at 7412

09:18 Shop floor reports the stale kettle badge. Checkpoint still last_acked 7410

09:21 On-call hides the outlet stock badges

Same records as the table, drawn so the 09:07 rollout sits in view without becoming the first lost offset.

The ordering does some work. The kettle event reached the queue and has an offset after the lamp. Search was still applying updates four minutes after the API deploy, and the first loss of progress lines up with a specific record. The division between 09:12 and 09:13 matters less than the offsets, since timestamps on a producer and worker come from different clocks. The OpenTelemetry logs data model distinguishes when an event occurred from when a collector saw it. If you only have collection times, preserve that distinction in the timeline.

Correlating logs, traces and metrics

Filter the lag metric by partition. The aggregate graph told you something was accumulating, and the split tells you where. Use outlet-04 and offset 7411 to find worker attempts. Each poll brings back 7411 and each attempt ends with unsupported_status before it makes an index write. For that last detail, follow an instrumented attempt through its decode and validation spans, and check the worker log with the matching trace ID. If a retry gets a new trace ID, the partition and offset still tie both attempts to the same queue record.

Those are different kinds of evidence. The metric tells you how far behind the partition is. The trace gives you a view into one attempt, and the log names the value the worker rejected. To explain the kettle, pull the consumer checkpoint and look at the captured queue records. They show the worker had more work available and failed to commit progress past the lamp. The missing trace for 7412 is only a clue. Sampling or a missing span could leave exactly the same gap.

Pay attention to how you count the errors. A panel that says unsupported_status fired repeatedly is easy to read as a bad batch of catalogue messages. Group by distinct partition and offset. In this incident the repeated error is one record. For the boundary between what telemetry shows and what you still have to establish from other records, see observability vs root cause analysis.

Change analysis

Compare 7411 with 7410 on the same partition. Both go through the same indexer image and the same queue settings. The earlier record has a status the worker knows how to handle. The lamp introduces withdrawn. A catalogue flag rollout recorded in the producer’s configuration audit enables that value for the outlet feed. The flag approval and the runtime audit tell you when the setting took effect. The captured queue record tells you it affected this event.

The worker source shows an exhaustive status mapping with an error branch for other values. Match the runtime image to a build record before citing the corresponding source. If the only thing you have is a commit from a repository search, treat it as the version you inspected. You still need to establish that the running image contained that code. Here the build record ties catalog-indexer:216 to the switch statement, and the error in the worker log matches the error branch.

Compare effective settings as well as code. The retry policy came from the queue subscription used by outlet-04, and its behavior was the same during the healthy run. A setting can be old enough that nobody remembers reviewing it and still be part of today’s failure. The root cause analysis guide explains how to choose a healthy baseline when there is no conveniently adjacent event like 7410.

Root cause analysis tools for testing the story

At this point you can say the indexer choked on the lamp and the kettle was waiting behind it. That still leaves a question the person reviewing the patch will ask. How did one catalogue value hold up other items for an entire partition?

Five Whys

Why is the kettle stale? Revision 893 never reached the index. Why? Its event sits behind 7411, and the consumer only advances after a successful index operation. Why couldn’t it finish 7411? Its status mapping has no rule for a withdrawn listing. At that point the next useful questions split. Why could the producer emit a value its reader didn’t understand? Why did the reader retry this particular error with the same payload every time?

ASQ’s Five Whys guide uses repeated questioning to reach a more specific explanation. Five Whys is a useful prompt and a poor stopping rule. Here the first branch leads to the way the catalogue flag was approved. The second leads to error handling in the consumer. The catalogue compatibility issue explains the rejected lamp. The retry behavior explains the stale kettle and every other changed item behind it. You need evidence on both branches to account for the scope of the break.

  1. Why 1

    Why is the kettle stale?

    Revision 893 never reached the index.

  2. Why 2

    Why not?

    Its event sits behind 7411. The consumer only advances after a successful index.

  3. Why 3

    Why could it not finish 7411?

    Status mapping has no rule for a withdrawn listing.

    1. Why 4

      Why could the producer emit a value its reader did not understand?

      Root cause A catalogue flag approved withdrawn on the outlet feed.

    2. Why 5

      Why did the reader retry this error with the same payload every time?

      Root cause The retry policy treats unsupported_status as transient.

The first three questions reach the missing withdrawn rule. The next ones split: the flag explains the rejected lamp, and the retry policy explains why the kettle, and everything behind it, never moved.

Fishbone diagrams

Sketch an Ishikawa diagram when the people on the call keep tracing the same branch. Put the shop-floor mismatch at the head: outlet search shows 3 kettles, catalogue shows 0. Give Code/Deploy, Data, Queue/Infrastructure, Config, People/Process and Monitoring a bone each, and write the check that killed a lead right on that bone. ASQ’s fishbone guide describes the diagram as a way to group possible causes of an effect. On this call the queue owner would add a redelivery policy the API team has never needed to look at.

Outletsearchshows 3kettles,catalogueshows 0Code / DeployNo withdrawnrule incatalog-indexer:216Ruled out:indexer wrote893 to thewrong aliasRuled out:09:07 searchAPI deployDataRuled out:cataloguepublished nokettle updateLamp Q07withdrawn atoffset 7411Kettle K42revision 893waiting at 7412Queue / InfrastructureEach poll of7411 ends inunsupported_statusPartitionoutlet-04pinned atlast_acked=7410Ruled out: saleburst, workersmerely behindConfigOutlet feedflag allowswithdrawnReader mappingnever learnedthat valueRetry policyunchanged fromthe healthy runPeople / ProcessDo not advancethe checkpointwhilecollectingevidenceChat reachesfor the 09:07rollbackMonitoringA quiet errorgraph can stillhide a stuckpartitionSearch trafficdoes notexplain thestale K42 badge
A real Ishikawa diagram of this incident. The head is the mismatch the shop floor reported. Causes marked “Ruled out” are leads the team tested and set aside, including the 09:07 search API deploy.

Give each branch a sentence somebody can test. “Catalogue published no update” dies when you read 7412. “Indexer wrote 893 to the wrong index alias” would leave a write record with that revision and a different target. Ask the indexing engineer to look for it. You have room for a quick alternative while the worker source is opening, and a place to put the result when it comes back. A branch labeled “configuration” on its own still leaves everyone staring at the same whiteboard.

Fault tree analysis

For the bad badge, start with two routes to the same outcome. An old serving copy can produce it, or an old index document can produce it. That’s an OR. Follow the second route down for K42. For the head-of-line block to explain this kettle, a prior event must remain unacknowledged and the kettle must be behind it in a partition that refuses to advance past unacknowledged work. That’s an AND. Both must hold for this path. NASA’s Fault Tree Handbook defines the gates that way.

Outlet badge shows 3 kettles while catalogue shows 0

OR

An old serving copy of a current index document

An old index document for K42

AND

A prior event remains unacknowledged

Kettle K42 at 7412 sits behind that event

The partition will not advance past unacknowledged work

Lamp Q07 at 7411 is still unacked

The serving path is one route to the same badge. For the index path to explain this kettle, the unacked lamp, the waiting kettle, and the ordered consumer all have to be true together.

Try removing a condition. Replay a copy of the kettle event on an isolated partition with no blocked head. The old worker applies it. Now put the captured lamp record in front and the same worker stops. That check distinguishes a blocked queue from a kettle the worker can’t index in any circumstances. In production, moving the checkpoint past the lamp would also free the kettle, but it would leave the withdrawn lamp listed. The fault tree helps you see the cost of that shortcut before the team takes it.

Rules of root cause analysis in the review

The incident title reads “Stale outlet stock badges.” Keep that as the symptom. The trigger was the first withdrawn record on the partition. The mechanism was a validation error treated as retriable by an ordered indexer, holding the checkpoint at 7410. The alerting gap was a fleet-wide health check that still saw the other partitions working. Each fact belongs in the review because it points to a different decision. You wouldn’t change the alert threshold and expect the lamp to disappear.

Keep the account of the flag rollout blameless and specific. The catalogue team saw its schema check accept withdrawn. Its approval checklist covered the product detail reader, which already understood the value. The indexer used a separate mapping and had no input fixture for that value. Put that missing contract check in the follow-up. Asking who approved the flag is useful if they can show you the checklist they saw. The next approver will need a better checklist and a test that fails before they flip the flag.

For the causal claim, write down what would make you revise it. An indexer acknowledgement of 7411 before the kettle was published would break the account of the blocked head. An index document with revision 893 before 09:18 would send you back to the serving path. The results you have are a checkpoint at 7410, the original payloads in order and a replay that stops after handing the lamp to the old worker. Put those next to the claim. Someone who was out that morning should be able to follow the checks without asking you to narrate the call.

The incident postmortem template gives the search and catalogue teams a place to share the record. Include who owns the compatibility test and who owns the per-partition lag check. Put last_acked and the head offset in the on-call runbook, where a worker operator will look when the next partition stalls. The exact error string in the report makes the incident findable from the log line.

Pareto analysis for the reliability backlog

Put the incident in the backlog under its mechanism, “permanent payload error stalls ordered consumer.” If you have a history of index failures, use a Pareto chart to decide where to spend the next reliability cycle. Count one partition stall for each distinct episode if the question is how often on-call has to intervene. Rank by minutes of stale search data if the question is where shoppers spent the longest looking at old stock. As ASQ’s Pareto chart instructions explain, you pick the measure before ordering the categories by size.

Keep a category for stalls with unknown mechanisms, and read the cases behind the largest bar before assigning work. A catchall like “queue lag” will lump this permanent payload failure in with slow index writes, which call for different fixes. If you only have this incident and a retry counter, you can already write the compatibility fixture. At the next review, 7411 belongs on the chart once, however many times it came back to the worker.

Where Decim fits

The outlet indexer is a background data flow. If the flow has been discovered, Decim starts its investigation when the team submits an incident report in the UI or through the API. Its investigation record keeps competing explanations, including the ones the team ruled out. A finding can cite a worker log excerpt from Google Cloud Logging alongside code from a frozen GitHub source snapshot. The image and build records still matter when the team wants to tie that code to what actually ran.

If the investigation needs a database check, the tool can propose SQL and the team runs it and supplies the result. The result can become part of the finding’s evidence. A proposed patch or draft GitHub pull request goes through team review and merge. The engineers who own the indexer run the replay and check the live search documents before turning the stock badges back on.

Recognizing home with a replay

Agree on what withdrawn means for search. The catalogue owner confirms that the lamp should disappear, so the fix maps that state to a document removal and acknowledges the event only after the removal succeeds. Test with the old and new workers against separate disposable indexes seeded with the same lamp and kettle documents. Feed them 7411 and 7412 in order. With the old worker, the lamp stays visible and the kettle stays at revision 892. With the new worker, the lamp disappears, the kettle reaches 893, and the checkpoint advances through 7412.

Repeat the lamp delivery after the removal and before the acknowledgement. This covers a worker losing its connection after the write but before it commits progress. Removing an already absent document must count as a successful application of the same event, so the partition can still advance. The team also assigns a separate piece of work to surface permanently invalid payloads. That work needs a policy for blocked records and for any later records that depend on them. Here the immediate fix gives the lamp a defined outcome and preserves the order of the original events.

In production, resume after 7410 with the fixed worker. Watch it handle both original records, then wait for the partition to reach the producer position you recorded at the start of verification. Build a list of the keys changed during the stall from the retained queue records. For each key, compare the indexed value with its catalogue revision. If a newer revision arrived during verification, let that event catch up and then compare both sides at the newer revision. For a withdrawn item, use the catalogue withdrawal record and a lookup that confirms the document is absent. A checkpoint can advance past a silently dropped write, so keep the index reads in the evidence alongside the acknowledgement.

Check the first newly published change after the backlog clears and attach the result to the replay record. Then test the actual outlet page with the badges restored. The lamp is gone. The kettle shows zero on the same search the shop-floor worker reported at 09:18.

For the warehouse version of this problem, ETL root cause analysis follows a daily close that doubles part of the refunds report while the scheduler stays green.

Decim investigates pipeline incidents

It reads your code, logs and tickets, works through the pipeline step by step, and confirms the cause with evidence you can check: every claim links to the log line, commit or check behind it. Then it proposes the fix and writes the report.

Request a demo

← All articles