fix(server): back off commit retries after store failures; sharpen fault drill

The first dev drill showed a full volume driving ~140 refused publications a
second. Commit retries now back off 100 ms doubling to a 2 s cap, reset on the
next confirmed commit. fault-drill.sh reports the empty-volume pod's exit code,
restarts and logs, and prints node-specific iptables rules for db-outage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-09-30 15:12:58 -04:00
co-authored by Claude Opus 5.5
parent 6b5da397e8
commit 4a900b0bd3
6 changed files with 97 additions and 11 deletions
+17 -6
View File
@@ -185,8 +185,9 @@ void starvation_accrues_bounded_debt() {
CHECK(s.queued == 10);
}
// Object store outage: the sealed batch waits, nothing is acknowledged, and the
// region resumes once storage is durable again.
// Object store outage: the sealed batch waits, nothing is acknowledged, retries
// back off (100 ms doubling, not one upload per step), and the region resumes once
// storage is durable again.
void storage_outage_pauses_the_region() {
const auto r = provisioned<LineageRegion>(3, 0x41);
ObjectStoreFaults faults;
@@ -202,12 +203,22 @@ void storage_outage_pauses_the_region() {
const auto& s = h->step(t);
CHECK(s.simulated_tick == 20 && s.committed_tick == 0); // Paused at the death.
}
CHECK(h->status().store_failures >= 5 && h->take_acks().empty() && h->take_outcomes().empty());
// Attempts at +0 and +100 ms; the next waits until +300 ms.
CHECK(h->status().store_failures == 2 && h->take_acks().empty() && h->take_outcomes().empty());
CHECK(h->status().tick_debt == 4);
for (int i = 5; i < 40; ++i) { // Two seconds of 50 ms steps: +300, +700, +1500 only.
t += 50ms;
CHECK(h->step(t).committed_tick == 0);
}
CHECK(h->status().store_failures == 5 && h->take_acks().empty());
faults.fail_directory_syncs = 0;
t += 50ms;
auto s = h->step(t);
CHECK(s.committed_tick == 20 && h->take_acks().size() == 20 && h->take_outcomes().size() == 1);
int waited = 0; // The next attempt (+3100 ms, delay capped at 2 s) succeeds.
auto s = step_until(*h, t, 50ms, [&](const HostStatus& x) {
++waited;
return x.committed_tick == 20;
});
CHECK(waited <= 23 && s.store_failures == 5);
CHECK(h->take_acks().size() == 20 && h->take_outcomes().size() == 1);
s = h->step(t); // Catch-up after the outage is bounded but continues.
CHECK(s.simulated_tick > 20 && s.simulated_tick <= 28);
}