Skip to content

Rebuilding a lost Region on FoundationDB 7.3, and why the fast path is unsafe

Prefer a repair whose exposure you can name and audit over a shortcut whose loss you cannot see. On FoundationDB 7.3.51, the safe rebuild of a lost Region opens a window in which new writes live in one Region only. In one local check, 54 acknowledged writes fell in that window. The audit could list each one by commit version. The repopulate_anti_quorum shortcut can drop history that the rebuilt Region still needs, with no record of what.

Multi-Region is off in production

This fdyno version does not support global tables. The multi-Region strong consistency (MRSC) prototype is deferred to a later version, and its code is removed. Nothing here qualifies multi-Region operation. This post is about the FoundationDB operator procedure underneath, as written in the Region-rebuild runbook.

The layout

The required layout on the global tables page is one FoundationDB cluster across three AWS Regions. Two data Regions, A and B, each hold a full copy. A third Region, C, is a witness: it holds only synchronous transaction-log replicas called satellites. Satellite set ca serves A, and cb serves B, each with one_satellite_double. This was not the shape tested on AWS (see the end).

The rule: each data Region, when active, waits for synchronous logs in another AWS Region. When B is active, a commit is acknowledged only after B's logs and the cb satellites in C have it. If B vanishes, the acknowledged write still exists in C.

In this example, A is lost for good. B serves, with a healthy current log set and two healthy cb copies, so its new writes are still protected across Regions. Now we want A back.

Why the safe path has a gap

When storage is permanently lost, the repair can require the 2 → 1 → 2 procedure (deploy page): set usable_regions=1, then usable_regions=2 again. The catch is a FoundationDB 7.3 behavior: at usable_regions=1, new log generations recruit no satellites, even if the region configuration still lists them. Writes acknowledged in those generations are kept in one Region only.

Rebuild of a lost Region A, step by step. 1. B with cb satellites at usable_regions=2: new writes are protected across Regions. 2. Reset to usable_regions=1: new B log generations have no satellites; new writes live in one Region (exposure). 3. Back to usable_regions=2 with A at priority -1: a new B epoch with cb ends the exposure; A fills in the background. 4. Full A copy, quiet data movement, audited acknowledgements. 5. Only then A becomes eligible for promotion again.

The procedure

The runbook has the exact commands. Each step exists for a reason:

  1. Fence A and check B. Fence the lost A processes permanently. Verify that B holds a complete readable source. Audit the existing acknowledged-write journal. Check that B's current log generation has its three-log quorum and two healthy cb copies. It must have zero write anti-quorums. Old generations and stored region JSON do not count. Keep five live coordinators, split 2+2+1. Use fresh addresses and disks for the new A.
  2. Make A ineligible, then reset to one Region. Keep B preferred, set A's priority to -1, then configure usable_regions=1. The gap opens here. The runbook asks the operator to accept it explicitly and to inject no other fault during the repair.
  3. Record the one-Region epoch. Record its activation and commit version. Native commit-version witnesses can then be assigned to the epoch. API acknowledgements carry no commit version. So journal and audit all of them through the end of the repair (global tables).
  4. Return to two Regions, A still ineligible. configure usable_regions=2, A still at -1. Negative priority blocks promotion, not replication: A starts receiving data. Verify that a new current B epoch has its cb quorum again. That ends the exposure for new writes. It does not mean A is full.
  5. Wait for a complete, quiet A, audit, then make it eligible. Wait for both complete storage replicas and healthy team trackers. Two quiet samples must show zero known queued or in-flight data movement. A missing metric is unknown, not zero. Audit every acknowledgement taken during the repair, including those after B+cb returned. Then set A's priority to 0, leaving B at 1. If a checked CLI command refuses, stop; never override it with FORCE.

What one local check found

The runbook records one local FoundationDB 7.3.51 check of this sequence. It ran a B+cb epoch, a B-only one, then B+cb again. Then came full A and two quiet samples before the final audit.

Recorded in that check Result
Acknowledged writes with commit versions in the B-only epoch 54
Acknowledged keys matched by the final B-client audit 350 of 350

Those 54 writes were acknowledged while B had no synchronous copy in another Region. A permanent loss of B in that window could have lost them. Returning to two Regions protects new writes, not these. The check did not record when each key reached A.

It was a local run, not over WAN links. It does not time the gap, show uninterrupted availability, audit reads from A alone, or qualify continuous MRSC.

The fast path, and why it is unsafe on 7.3.51

The region setting repopulate_anti_quorum relaxes what a recovery waits for while a remote Region is repopulated. On 7.3.51, with a nonzero value, recovery stops waiting for the remote logs to finish recovering. It can mark storage recovered, and drop older log generations from coordinator state, before the rebuilt Region's logs have copied them.

A rebuilt Region's new logs must copy the older history (the prefix) from previous generations before those generations are discarded. The barrier is the rule "do not discard an old generation until the remote logs have durably copied what they need from it". FoundationDB 7.3.51 lacks the remote log-prefix barrier fix. Without it, the rebuilt side can be missing history it was supposed to have. The runbook says: do not use it on this pin.

With the barrier: old log generations stay until the rebuilt Region's logs report the prefix as durable; then they are discarded. Without the barrier (7.3.51 with repopulate_anti_quorum): old generations can be discarded while the rebuilt Region's logs are still copying, leaving a gap.

Two caveats. The hazard comes from code analysis of the fix, not from an observed loss. And the normal CLI may accept the setting, so the runbook repeats the warning right before the step that opens the gap.

What we have tested on AWS

The whole-Region fault records on the deploy page cover a different step: losing the primary Region and failing over. Two shapes ran once each, with one whole-Region fault per shape.

Shape Satellite logs Failover API writes lost
A In the primary Region 21.65 s, forced recovery 0 of 5,635 acknowledged
B In a third Region 13.85 s, no forced recovery 0 of 5,103 acknowledged

In shape B, only the original primary had a satellite policy. So after promotion, the survivor had reduced Region-loss durability until a symmetric policy was configured. A later prototype spike repeated the primary-Region loss once on a small fleet, with the API running without the global tables setting. The fault was a network cut of the active Region, then EC2 stop. Results:

  • Failover took 13.61 s from the scheduled cut, with no forced recovery.
  • No acknowledged write was lost: 0 of 3,808 API writes and 0 of 8,176 native commits.
  • Before the fault, 1,000 cross-Region write-then-read pairs showed 0 stale reads. That is a finite sample, not a proof.

The run ended there, with no repair or failback. The run did not get a full verdict, because the witness-loss check sampled PutItem only and stopped early. There, too, only the first active Region had a satellite policy. So after promotion, new writes had no synchronous cross-Region copy. That is a different cause with the same effect as the rebuild's one-Region epoch.

These are single runs with small data. No zero-loss claim extends to a second Region loss, failback, asynchronous loss, an SLA or recovery at scale.

Still open

  • Timing. No public measurement times the one-Region gap over WAN links.
  • Qualification. Primary-Region loss, witness loss and remote-Region isolation need multi-Region Elle or Jepsen histories before production (open gaps).
  • A newer FoundationDB. The fast path becomes a candidate only on a version with the barrier fix, after its own fault testing.

What to do with this

When a repair must reduce redundancy, choose the procedure that tells you exactly what was exposed. Journal every acknowledgement through the whole repair. Record the versions where the exposure starts and ends. Audit every repair acknowledgement before the rebuilt side may take over. Restored protection for new writes is not proof that the rebuilt copy is ready.

Do not take a shortcut whose failure leaves no record. On FoundationDB 7.3.51, that means 2 → 1 → 2, and leave repopulate_anti_quorum alone.