Incident Library

IL-0430 Hatena · 2018-09-26database

Mackerel's Redis stopped answering during a replication setup, keepalived failed over by mistake, and Mackerel degraded

Mackerel keeps monitoring data in Redis, and Redis memory use had been rising. On 26 September 2018 operators started building a Redis replica to scale Redis up. The replication setup took long enough that Redis did not answer for a time, keepalived, the clustering software used for Redis, judged the node to have failed, and an unintended failover followed at 10:51 JST. The application servers then could not reach Redis. Operators switched to the correct Redis at 10:55 and the application briefly recovered, but latency and timeouts came back, and rolling restarts of the application servers did not help.

Between 11:00 and 14:50 the team blocked requests from organizations that were posting inappropriate metrics, adjusted the application server timeouts, temporarily added capacity to Diamond (the TSDB), raised the number of Kinesis shards and Redis Cluster shards, and scaled out the API application servers. Mackerel was then put in maintenance mode, checked internally, and outside requests were let back in step by step. Recovery was declared at 15:20.

Hatena states that the failure started with the unintended failover, but it could not determine why recovery took so long and has stopped investigating. The review put forward one hypothesis: under a particular access pattern that continued for a while, the Scala application slowed down from waiting on synchronisation or lock contention in a thread pool or connection pool. An attempt to reproduce the situation in an isolated environment did not reproduce it.

Severity
–
Scope
The whole Mackerel service malfunctioned and alive monitoring stopped from 10:51 to 15:20 JST
Users affected
–
Region
–
Time to detect
–
Time to resolve
4h 29m

Symptoms

On 26 September 2018 at 10:51 JST the whole Mackerel monitoring service stopped working properly and its alive monitoring stopped. The application servers could not connect to Redis, which stores Mackerel's monitoring data, and could not return correct responses.

At 10:55 operators switched the application back to the correct Redis and the application seemed to come back. It did not stay stable: application server latency got worse and requests timed out. Restarting the application servers one after another did not improve the symptoms.

The failure went on until 15:20 JST. Recovery was declared when application server responses were stable, the metrics that mackerel-agent resent had settled and the delay in writing data to the time series database (TSDB) was gone. A network problem and growing Redis memory use had already been present before the incident, and Hatena names both among the combined factors that kept the application unstable.

Symptom Monitoring outageHigh latencyIntermittent timeouts

Root cause

Trigger
Redis memory use had been growing, so operators set up replication in order to scale Redis up. Building the replication took a long time and Redis stopped answering for a while, and keepalived treated this as a node failure and started a failover nobody intended.

Detection

–

Remediation

Action items

Lessons

Hatena did not find why recovery took so long, but expects that keeping failover from reacting to short load spikes and giving the application more performance headroom would prevent an outage this long. It also aims to keep problems contained to a small part of the service when a failure does happen.

Sources

Related cases

Check your cluster for this

kubegap audits a Kubernetes cluster for conditions like the ones in this case, In-memory cache, Database replication, Database failover manager 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.