Catalogue / hightouch-2025-aurora-failover-race

Two manual Aurora failovers at Hightouch reversed themselves and broke writes; AWS confirmed a signaling fault in demoting the old writer

Hightouch, 2025. Hightouch Events (event collection and delivery) and its Aurora PostgreSQL queue metadata store.

Organisation
Hightouch
Evidence
Incident report
System
Hightouch Events (event collection and delivery) and its Aurora PostgreSQL queue metadata store
As of
2025-10
Source
How we Uncovered a Race Condition in Aurora RDS

Hightouch blog, published 2025-11-11

Architecture

The events system scales on three levers: Kubernetes clusters that run the collectors and batch workers, Kafka through which events are processed, and a Postgres store holding virtual queue metadata. The Postgres store is an Amazon Aurora PostgreSQL cluster with one writer and read replicas over shared storage; backend services reach the writer through the cluster endpoint, not directly.

Near: Our system scales on three levers | Section: AWS Aurora RDS | Near: Our services do not connect directly to

Components

ComponentRoleWhere
Event collectors and batch workersRun on Kubernetes clusters; collectors accept customer events and batch workers process them.Near: Our system scales on three levers
KafkaCarries events for processing; its brokers are managed by AWS MSK, and its durability meant accepted events were not dropped during the regional outage.Near: Kafka brokers managed by AWS MSK | Near: Kafka’s durability meant that no events were
Aurora PostgreSQL clusterThe main datastore behind both real-time streaming of customer events and their delivery to warehouses; it acts as the queue for batch metadata. One writer, read replicas, and a cluster endpoint that points to the writer.Section: AWS Aurora RDS | Near: ability to act as a queue for
Customer functionsCustomer-defined functions for real-time data transformation; when they were unavailable the retry queues grew.Near: Customer functions for realtime data transformation were

Figures, as the source states them

FigureAs statedNoteWhere
Events handled by the events system500,000 events per secondScaled to; at about 1s end-to-end latency on a small Aurora instanceNear: for events scaled to 500K events per
Syncs served by Postgres queues in the non-events architecture1,000,000 syncs per dayApproximate; a different part of the productNear: non-events architecture well at ~1M syncs/day
Expected downtime of the planned failover15 secondsLess than; the expectation before the attemptNear: expected downtime less than 15s

Records

Failure#f1

A manual Aurora failover twice reverted to the old writer, and backend services could not write until restarted after the first attempt

hightouch-2025-aurora-failover-race#f1 at corpus version 26a1b3a7e3dd
Trigger

To gain headroom after the backlog left by the AWS us-east-1 outage of October 20, the team set out to upsize the database. At 16:39 EDT on October 23, 2025 it triggered a manual failover to a newly upsized read replica (instance #2), outside a scheduled maintenance window and with the services that write to the database still running. A second attempt followed at 16:43.

Section: The Upgrade Attempt | Near: without a scheduled maintenance window | Near: We wanted to upsize the DB to

How it failed

Each time the replica was promoted briefly and the original writer then became primary again. Some backend pods got errors that an UPDATE could not run in a read-only transaction. Logs on both instances showed a server process running a backend write query killed, followed by a storage runtime crash. The team's hypothesis was that Aurora briefly let both instances process writes and the storage layer rejected them. AWS later confirmed an internal signaling issue in demoting the old writer.

Section: The Upgrade Attempt | Section: The Investigation | Section: AWS Confirms the Root Cause

Why defences did not hold

The procedure was supported by the AWS documentation and had completed successfully in a staging environment under a load test earlier the same day. AWS reported everything as healthy, and later confirmed that nothing unique in the team's configuration or usage would trigger the bug.

Section: The Plan | Section: The Upgrade Attempt | Section: AWS Confirms the Root Cause

Impact

After the first attempt backend services could not execute write queries until they were restarted, which cleared the errors. The second attempt gave the same brief promotion and immediate reversal, so the upgrade failed twice within five minutes. The post gives no figure for customer-facing effect.

Section: The Upgrade Attempt

Fix

A controlled failover with every service that writes to the database scaled down completed successfully, and the cluster in us-east-1 was upsized. Internal playbooks now pause writers before an intentional failover, and monitoring was added to detect unexpected flips in which instance advertises the writer role. Planned: AWS has indicated a fix is on its roadmap; until then it recommends using failover as needed with no writes running against the database.

Section: Testing the Hypothesis | Section: Final State | Near: AWS has indicated a fix is on

Reviewer's notes

The dual-writer explanation is the team's hypothesis, supported by their controlled test; the wording AWS confirmed is narrower, an internal signaling issue in the demotion of the old writer.

The reviewer's reading, not the source's claim

Decision#d1

Pause every writer before an intentional Aurora failover

hightouch-2025-aurora-failover-race#d1 at corpus version 26a1b3a7e3dd
Chosen

The team updated its playbooks so that services writing to the database are paused before an intentional failover, and added monitoring for unexpected changes in which instance advertises itself as the writer.

Section: Final State

What forced it

Two failovers attempted with writers running reversed themselves and left backend services unable to write. AWS confirmed the fault lay in its demotion process and that the conditions were outside the team's control.

Section: The Upgrade Attempt | Section: AWS Confirms the Root Cause

Reasoning

A controlled attempt with all writing services scaled down completed, which the team took as strong support for the race-condition hypothesis. The mitigation AWS recommends is the same: fail over only as needed and make sure no writes run against the database during it.

Section: Testing the Hypothesis | Near: the recommended mitigation aligns with our solution

What worked before

The plan relied on Aurora's fast failover with writers live, expecting less than 15s of downtime that the backend would handle gracefully. That procedure had succeeded in staging during a load test.

Section: The Plan

Decision#d2

Keep queue metadata in Postgres beside Kafka, on a small Aurora instance

hightouch-2025-aurora-failover-race#d2 at corpus version 26a1b3a7e3dd
Chosen

Postgres serves as the metadata store for the events system's virtual queues, next to Kafka for event processing, and ran on a small Aurora PostgreSQL instance.

Near: Postgres as our virtual queue metadata store | Near: on a small Aurora instance

Reasoning

The author states the company's habit of starting with Postgres wherever it can.

Near: we start with Postgres where we can

Outcome

The author reports that the events system scaled to 500K events per second at about 1s end-to-end latency on a small Aurora instance. The backlog left by the AWS outage of October 20 then tested the limits of that instance as a queue for batch metadata, and the team chose to upsize it for headroom.

Near: for events scaled to 500K events per | Near: testing the limits of our (small) Postgres | Near: We wanted to upsize the DB to

Reviewer's notes

The post does not give the instance size before or after, so 'small' cannot be made more precise.

The reviewer's reading, not the source's claim

Review

Extracted by
Claude (feed 37)
Human review
Not started. Status recorded on 2026-12-02.