Incident Library

IL-0443 Repro · 2019-11-11databaseaws

A Repro Aurora MySQL reader restarted unexpectedly and writer insert latency rose about sevenfold for a day or more

AWS Support found from internal information that the rollback segment area had kept growing until the reader restarted, and that it began to be released after the restart. For this occurrence the rollback segment grew from about 11/05 10:16 JST, its release began when the reader restarted at about 11/11 19:20 JST, and the release finished at about 11/13 14:31 JST; the restart on 11/5 had followed the same sequence of growth, release and higher commit latency. The rollback segment keeps old versions of updated rows for rollbacks and for other transactions that need to read old data. It is released when transactions end, but a large one takes a long time to release, and the I/O of the release affects the latency of other work. Long transactions on a reader can also keep it growing. AWS considered the higher commit latency after the restart most likely an effect of the release, and suggested that slower commits held locks longer and that the changed spin waits were related to the long transactions and the release. The length of the rollback segment shows as "History list length" in `show engine innodb status`.

The rollback segment is shared by the whole cluster, not tied to one DB instance, so deleting or adding instances or changing I/O performance could not speed up the release, and the only option was to wait for it to finish. AWS advised keeping transactions small so the rollback segment does not grow large.

Repro added a monitor on the rollback segment (mysql.innodb.history_list_length in Datadog) and from then on killed queries that ran long enough to make the reader restart as soon as they were found, which prevented the same failure. About two years after the monitor was added it began alerting almost every week, so Repro, after telling the company, set max_execution_time so that queries are stopped after a fixed time.

Severity
–
Scope
Writer performance of the Aurora MySQL cluster for a day or more after each reader restart; the applications processing data collected by the Repro SDK were delayed
Users affected
–
Region
–
Time to detect
–
Time to resolve
–

Symptoms

A reader of Repro's Aurora MySQL cluster restarted for no known reason, and right after that the writer's insert latency rose to about seven times normal and writer performance stayed badly degraded for a long time. This happened more than once, twice within two weeks by 11 November 2019. While the writer was slow, the applications that process data collected by the Repro SDK fell behind, and the team could only watch until the writer recovered.

The metrics had the same pattern every time: the reader restarted; its freeable memory dropped fast before the restart; mutex spin waits fell sharply; Rw-excl spin rounds / RW-excl spin waits roughly doubled; commit latency and other latencies rose; replication lag rose; volume read iops increased; and everything returned to normal after one or two days. On the writer, the metric trends changed sharply at the restart and stayed that way for more than a day.

The team's first hypothesis was that the reader restart emptied its buffer pool, which raised network traffic between the DB instances and the cluster storage and the storage IOPS, and that this also hurt the writer. With this hypothesis the team asked AWS Support.

Symptom High latencyReplication lagThroughput degradation

Root cause

Trigger
Long-running queries on the reader; the author recalls that the cause was a query sent to the reader from Redash.

Detection

–

Remediation

Action items

Lessons

Once the rollback segment has grown large, nothing speeds up its release across the cluster, so the way to avoid the latency is to keep transactions small and stop long-running queries before the rollback segment grows.

Sources

Related cases

Check your cluster for this

kubegap audits a Kubernetes cluster for conditions like the ones in this case, Database, Database replication among them, read-only, from Claude Code or Codex. Its checks cite public reports like this one.

For AI tools and scripts

The API needs no key. The MCP server offers search_incidents, get_incident, list_incidents, get_topic and vocab; both are explained on API and MCP.