blog
AI-assisted database incident response: evidence before action
Picture the alert: one node of your Galera cluster went down. You ask an AI assistant what happened, and it answers in seconds. “Probably out of memory.”
Maybe. But a plausible reason is not evidence.
This post follows one node failure in a synthetic lab, from the first question to the final check. We want to keep four things separate:
- what the assistant guessed,
- what the evidence shows,
- which identity may act, and
- how you confirm the node is really back.
Most setups make that hard, so let’s start with what goes wrong.
Our incident: one node down, one lab
The lab. A three-node Percona XtraDB Cluster 8.0 (Galera), with synthetic data and a short sysbench write load and managed using ClusterControl as Cluster manager.
The fault. We stop the MySQL service on one node, outside the cluster manager. It’s a designed fault, and the assistant isn’t told. In our first try on an older build, the cluster manager restarted the node within a minute. So we block automatic recovery with a lock file on that node.
Why it matters. The cluster keeps running on two of three nodes, a majority. If another unexpected failure or a network partition hits, it can lose quorum and stop serving queries. The goal is the third node, back and in sync.
What goes wrong when an assistant has the keys
Give an assistant a shell and a password, and this incident can go wrong in five ways:
- A guess becomes a fact. The assistant names a cause with no evidence, and it sounds verified.
- A risky shortcut looks helpful. Bootstrapping the stopped node as a new cluster looks like a quick way back. But with the other two nodes alive, it can form a second primary component, and the two drift apart.
- One login hides who did what. With a shared admin login, the audit trail can’t tell the assistant from you.
- A chat prompt is not a control. Configurable server controls include read-only mode, an execution guard and approval. This lab tested the identity, command-policy and bootstrap checks described below.
- Nothing proves it worked. A node that says “running” is not a synced member.
These are risks, and a few showed up in our lab. Each needs a control outside the chat.
The manual way, and where it hurts
Without an assistant, the same incident goes like this:
- Read the node alarm and the cluster status. Confirm the other two nodes are Primary and Synced.
- On the stopped node, check the MySQL service status, the error log, the journal, memory and disk.
- Don’t bootstrap it. Under a change record, start MySQL on it and let it rejoin normally.
- Watch the join until the node reads Synced and the cluster size is three. Write a marker row on one node and read it on the others.
- Check the alarms, then record the outcome.
This path is safe, and it’s the baseline. In an isolated network it may be the only path, because AI is optional. But one person holds the alarms, logs, host state and recovery decision at once. An assistant can help, if its access is bounded.
What a node loss leaves behind
When a Galera node stops, the other two keep the cluster running. Two of three is still a majority, so it stays Primary and keeps accepting writes. The stopped node falls behind.
When it returns, it catches up. If the other nodes still hold the writes it missed, it receives just those: an incremental state transfer (IST). If not, it receives a full copy: a state snapshot transfer (SST). One remaining node acts as donor.
With only two active members in this lab, another unexpected node loss or network partition could remove quorum before redundancy is restored.
Evidence rules and what “recovered”means
Three rules hold with or without AI.
- Label every statement as Observed, Inferred or Unknown. A cause that nobody observed is a hypothesis.
- Read the primary source yourself. Open the alarm and the host logs. Don’t confirm one AI summary with another.
- Write down what you still don’t know. An unknown stays until a check removes it.
Our evidence table looked like this:
| Observation | Source | Timestamp | Interpretation | Uncertainty | Next check |
|---|---|---|---|---|---|
| br1-svr3 CmonHostRecovery, critical alarm “Server disconnected” | Node status, alarm #220 | 03:56:10Z | Cluster lost one node | Cause not established | Check service status, log and journal on br1-svr3 |
| Recovery jobs #285 and #286 failed: lock file exists | Job log #286 | 03:56:14Z | Our lock file blocked automatic recovery | None here; a real failure needs its own cause | Read the job log |
| Clean shutdown in the MySQL log (“Shutdown complete”) | MySQL error log on br1-svr3 | 03:56:18Z | Not a crash | Who asked for the stop is not in the log | Check the change record |
A running service is not proof. The node is recovered only when all hold:
- The cluster manager lists the node online, with no open alarm for it.
- On every node,
wsrep_cluster_sizeis 3 (nodes seen),wsrep_cluster_statusis Primary (quorum),wsrep_local_state_commentis Synced (caught up) andwsrep_readyis ON. - A marker row written on one node appears on the other two, and a busy table’s checksum matches on all three.
Read every action before you take it
Before anyone acts, write the action down. This template is ours. For planned changes across multiple clusters, see our walkthrough of safe database change at fleet scale, including canaries, maintenance waves and recovery gates.
| Field | Value |
|---|---|
| Target | The stopped node. |
| Exact action | Start MySQL on it and let it rejoin. Don’t bootstrap. |
| Executing identity | The operator, under a change record. |
| Expected effect | The node joins and catches up by IST or SST. A donor carries the load. |
| Prerequisite evidence | The other two nodes are Primary and Synced. The cause of the failure is not left as unknown. |
| Authorization decision | Lab operator, one of us: start at 04:08:56Z, no bootstrap. |
| Verification | The “recovered” checks above. |
| Fallback | Stop, read the error log, then recover or re-add the node from the GUI. |
Recovery time matters because the cluster is operating with reduced redundancy: another unexpected failure or partition could remove quorum.
So far, every control here is something a person does. The next question is how to give an assistant the same discipline, without giving it the keys.
ClusterControl MCP: the solution
This is where ClusterControl MCP comes in. In this lab the cluster manager is ClusterControl, and the assistant reaches it through the MCP Server that ships with it. MCP, the Model Context Protocol, gives the assistant defined tools instead of a shell. Each pain gets a control.
| Pain | What ClusterControl MCP gives you |
|---|---|
| A guess becomes a fact | Advisors return findings with codes. Missing or partial data is reported as unknown, not as clean. |
| A risky shortcut | Defined tools, allow lists, a job command policy and a Galera bootstrap guard. A bootstrap is refused unless every member is down. |
| One login hides who did what | Each assistant gets its own identity, so rights and audit records belong to that user. |
| A chat prompt is not a control | Read-only mode, an execution guard and approval are enforced on the server, not the client. |
| Nothing proves it worked | Job records, an audit log and advisors give evidence you can check. |
MCP doesn’t make the assistant right. It bounds and records what it does.
Who can do what. The assistant used a CMON account with read-only access. A separate account with execute rights was used only for our direct-client preview tests.
Keep the credentials apart. The assistant never sees database passwords. ClusterControl holds those. With an identity map, each assistant holds only its own bearer token, and the matching ClusterControl credential stays on the MCP host. Don’t use a shared admin account.
Tools used:
| Item | Build or setting |
|---|---|
| Database | Percona XtraDB Cluster 8.0.46-38.1 (Galera 4.27), three nodes, equal weight, no arbitrator |
| ClusterControl | 2.5.0-27208 |
| MCP Server | 1.0.0-246 |
| agent-observe | CMON account, ACL r–. MCP read-only mode off |
| agent-change | CMON account, ACL rwx. MCP read-only mode off. Control tests only |
| Client and model | Claude for Windows, Claude Sonnet |
The assistant ran as the read-only identity agent-observe. We used the change-capable identity only for our control tests.
Where your data and permissions go

The client calls the MCP Server over HTTP, with a bearer token held by the client or its connector. In our lab that link was plain HTTP on a private network, with no TLS. The token was the only protection, and it appeared in the connector’s log. Production needs TLS. The server calls the CMON controller as the identity that token maps to.
What leaves your environment? Every tool result goes back to the client and the model, so a hosted model sees cluster names, host names, job logs and alarm text. Exclude from the allow list any tool whose output the assistant shouldn’t see. Outputs overlap, so removing one tool may leave the same data reachable through another allowed tool, such as the incident bundle or an advisor. We added no allow or deny list of our own.
An “are you sure?” prompt is not authorization
Tool annotations such as readOnlyHint and destructiveHint are advisory metadata for the client. A dry-run preview does not by itself authorize or execute a change. When the execution guard is enabled, the server requires a single-use confirmation from a preview of the same call before a destructive execution can proceed. Approval is a separate, configurable control.
In this lab, both identities connected with MCP read-only mode off. The investigation account had read-only CMON access (r--); the change account had rwx access and was used only for direct-client preview tests. Those tests exercised the MCP Server’s identity, command-policy and bootstrap checks. They did not exercise approval followed by job execution.
Logs sit in three places: the MCP Server’s audit log, the controller, and the chat transcript, held by the client or provider. In our lab the audit log named agent-observe or agent-change on every call. An older setup with one shared account logged every call as “default”.
Approval proves only who answered, and nothing stops an operator from giving one agent both credentials. These checks cover only jobs submitted through the MCP Server, not the GUI or the s9s CLI.
How the assistant gathers evidence
We asked for evidence, not an answer, under the read-only identity. The request looked like this:
Inspect the Galera cluster br1-galera (cluster id 2). One node is down. Separate observed facts from possible causes, identify missing evidence, and propose the next diagnostic step. Do not change configuration or start operational jobs.
That wording is a request, not a security boundary.
The MCP Server gives the assistant good places to look. Get_incident_bundle returns alarms, jobs, log tails, metrics and topology in one read-only call. A Galera cluster has two advisors. advise_replication_topology judges Galera for redundancy only, so it stayed quiet with a node missing. advise_galera_health raised a critical GALERA_SIZE_BELOW_EXPECTED for that node.
What the assistant did:
| Call | Result | Label |
|---|---|---|
get_incident_bundle | Critical alarm on br1-svr3. Recovery jobs #285 and #286 failed. Cluster DEGRADED. 4 of 24 metrics flagged, all load average. The auto-selected logs were old, and the shutdown is not in them. | Observed |
get_job_log #286 | Lock file exists, node will not recover automatically. Two survivors Synced. The stopped node is labeled JOINING. | Observed |
| Cause of the stop | Not available from these tools. | Unknown |
What it got right. It found the lock file as the reason recovery failed, split facts from guesses, and listed the right missing evidence: the MySQL error log, who placed the lock file, disk space, service status and the journal. It also said an operator would need to check the host.
Where it went wrong.
- It never called
advise_galera_health. - It read “disk utilization 9x baseline” as a sign of a full disk. That metric is how busy the disk was, not how full. The tool didn’t even flag it, and the host disk was 63% to 67% used. The busy disk was most likely our sysbench load.
- It said the stopped node was “trying to rejoin, not down”. The job log did label it JOINING, but MySQL on the host had been stopped for minutes. The assistant trusted a status word over the host.
That’s why rule two exists. The assistant sees what ClusterControl collected, not the host.
One caveat: this wasn’t a perfectly clean blind test. The assistant didn’t know the cause, but we ran it in the chat we’d used to test the connector, with other connectors loaded. The audit log shows it used only the read-only one.
Where the assistant stops and the operator starts

Here the assistant can diagnose but can’t fix. That’s a result, not a failure.
The operate profile lets create_job submit seven commands, including bootstrap_cluster and find_most_advanced. None can bring back one stopped node in a running cluster. The sop_galera_recovery procedure is for a cluster where every member is down — we attached it anyway. The assistant read it, saw two nodes still running, and stopped at Step 2. It asked for no job.
So the operator starts the node, under the change record above. At 04:08:56Z we ran a normal start, no bootstrap. The node received an IST of 1,049 events and read Synced at 04:09:07Z.
We verified at 04:09:38Z. The sysbench workload had a 150-second limit and had started 14 minutes earlier, so we expected it to have finished before verification. We did not independently confirm that no writers remained. All three nodes read size 3, Primary, Synced, ready ON and receive queue 0. On each node we ran CHECKSUM TABLE on the ten sysbench tables, and a shell loop compared the values:
t1:ok t2:ok t3:ok t4:ok t5:ok t6:ok t7:ok t8:ok t9:ok t10:ok
Marker check: five rows existed before the fault. After the rejoin we inserted one on br1-svr1, and all three nodes counted six. We did not compare wsrep_last_committed, which would be a stronger check.
Try to break it: boundary tests
A happy path proves little. We ran these on the disposable lab cluster through a small direct client, one token per identity. They were dry runs, so no job was created.
| Test | What we asked | What came back |
|---|---|---|
| Denial | The read-only identity previews a job (find_most_advanced). | “cluster 2: this identity lacks readable execute access; no job was created”. The change identity got a preview for the same request. |
| Outside the policy | The change identity asks for a command that isn’t on the allow list (backup). | JOB_COMMAND_NOT_PERMITTED, with no preview, confirmation or approval. |
| Bootstrap, recovery on | The change identity asks to bootstrap from the stopped node, then from a running one. | GALERA_BOOTSTRAP_NOT_ADMITTED: both automatic recovery settings must read false. |
| Bootstrap, recovery off | The same request, after we switched recovery off. | GALERA_BOOTSTRAP_NOT_ADMITTED: br1-svr1 and br1-svr2 read running; a bootstrap is only for a cluster whose every node has stopped. |
The responses and the audit log show the MCP Server as the rejecting layer in every row: its identity access check, job command allow list and Galera bootstrap check. In the tested configuration, the MCP Server refused this bootstrap preview twice, for two reasons. These direct-client tests show that the MCP Server refused the specified requests during preview, independently of the assistant’s response. They do not exercise a successful approval followed by job execution.
Close-out. We removed the lock file right after the recovery checks, at about 04:10Z. Recovery was off only for the bootstrap test. Both automatic recovery settings read true again, in the guard’s message and the controller configuration. The test-only node_recovery_lock_file setting stayed, and has no effect without the file. The lab was not destroyed.
Without AI vs. with AI, side-by-side
| Stage | Without AI | With AI via MCP | Stays with the person |
|---|---|---|---|
| Find the failure | Read the node alarm and status. Reason from logs and experience. | Observed: the assistant read the incident bundle and one job log, and listed facts, guesses and gaps. Recommended: also call advise_galera_health. | Confirming the alarm. |
| Check the host | Check service, log, journal, memory and disk. | Observed: collected log tails only. | The host check. |
| Restore the node | Start MySQL and watch it rejoin. | Observed: no admitted job fits, so the assistant proposed. A bootstrap preview was refused in a separate direct-client test. | The action. |
| Prove it is healthy | Check wsrep status, a marker row and checksums on all nodes. | Recommended: re-read node status and advisors. The operator ran advise_galera_health after recovery (direct client); it returned to one info finding. | The database checks. |
N.B. We claim no time saved. Without a baseline, any number is a guess.
FAQ
Is human confirmation the same as authorization? No. A client confirmation is advisory. Authorization means the identity has the right, the server controls allow the call, and, where you require it, a separate approver said yes.
Does MCP make an operation safe? No. MCP is how an assistant calls tools. Safety comes from what you expose and who runs it.
Can the same workflow run disconnected? Only in part. The MCP Server and the advisors work without internet. A hosted model needs a connection, so it isn’t air-gapped. A local model or client needs its own test and review.
Next step
Evaluate an evidence-led incident workflow for your database estate. We can scope the discussion around supported tasks, the access you allow and who owns each operation.