All posts
DVR Playback for ClickHouse® Database Incidents

DVR Playback for ClickHouse® Database Incidents

May 23, 20264 min readGayathri
Share:

The worst part of any incident is the question you cannot answer: what was actually happening at 2:47am when the cluster fell over. By the time you are looking, the moment has passed. The queries that were running have finished. The memory spike is gone. You are reconstructing a crime scene from whatever logs survived. DVR-style playback fixes this, and it has changed how my team does on-call.

The problem with live-only monitoring

Most monitoring shows you now. That is great for catching a problem as it happens, and useless an hour later when you are trying to understand one that already resolved. The classic incident goes like this: something pages, by the time someone is at a laptop the symptom is gone, and now you are guessing. You look at the current state, which is fine, and you have no way to see the state during the incident.

So you piece it together. You grep logs. You query system.query_log for what ran around that time. You ask whoever was awake what they saw. It is slow, it is incomplete, and you often never find the real cause, which means it happens again.

What DVR playback does

DVR playback records your cluster's monitoring state over time, so you can scrub back to any moment and see what the dashboards showed then. Not a summary, the actual picture: which queries were running, what memory looked like, how replication was doing, what the part counts were. It is like a security camera for your cluster.

In CHOps this means that when an incident hits, the first thing you do is rewind to when it started and watch it unfold. You see the memory climb. You see the query that kicked it off. You see replication start to lag. The story tells itself, because you are watching the recording instead of guessing from leftovers.

How this changes an incident review

Before playback, our incident reviews had a lot of "we think" in them. We think a big query caused it. We think replication was already behind. Those are guesses dressed up as findings, and you cannot fix a guess.

With playback, the review changes. We rewind to the start, and we watch. Often the cause is obvious within a minute: a specific query at a specific time pushed memory over the line, and everything else cascaded from there. Now we have a real finding, which means we can do something about it, whether that is optimizing the query, adding a limit, or rescheduling the job that ran it.

The difference between "we think a query caused it" and "this query, at this time, caused it, here is the recording" is the difference between an incident that recurs and one that is actually fixed.

It is also how you learn the normal

A quieter benefit: playback teaches you what normal looks like. By scrubbing through ordinary days, you build intuition for the shapes of healthy cluster behavior, the daily rhythm of load, the way merges ebb and flow. Then, when something is off, you recognize it faster because you know what off looks like compared to a normal Tuesday.

This pairs naturally with the live monitoring and alerting side. Alerts tell you something is wrong now. Live monitoring shows you the present. Playback lets you understand the past. You need all three, and the past is the one most tools leave out.

The honest caveat

Playback does not prevent incidents, and it does not replace good alerting or sensible capacity planning. What it does is make the investigation afterward fast and grounded in evidence instead of memory. For on-call work, where the person responding is often not the person who knows the system best, having a recording to scrub through is the difference between solving it and shrugging. The query profiler and playback page shows how it fits with the rest of the monitoring tools.

Incident response is stressful work. When you are in the middle of one, lean on the recording rather than your memory, and take it one step at a time.

Share: