Skip to content

fix(relay): harden community-deletion lifecycle interactions - #7015

Open
navenduagarwal wants to merge 1 commit into
block:mainfrom
ola-krutrim:fix/deletion-lifecycle-hardening
Open

fix(relay): harden community-deletion lifecycle interactions#7015
navenduagarwal wants to merge 1 commit into
block:mainfrom
ola-krutrim:fix/deletion-lifecycle-hardening

Conversation

@navenduagarwal

Copy link
Copy Markdown

Two production-observed issues on a deployment (~7.7k users) using the community deletion control plane. Both look benign and are permanent:

1. The NIP-43 membership reconciler sweeps deleted communities forever. The sweep iterates every community, including quiescing/fenced/tombstone ones — whose database write fence correctly rejects the snapshot write. After any community deletion reaches its fence step, every reconciliation cycle logs a community write fenced failure per retired community, indefinitely (we observed ~18 log lines/min after retiring three communities). Fix: sweep only lifecycle-active communities via a new writable_community_hosts query.

2. Boot-time serving-fence validation flaps fresh pods under rolling deploys. The validation is fail-closed with no retry, so a transient DB pool timeout — routine while old and new pods briefly share the connection budget — exits the pod into CrashLoopBackOff. We reproduced this repeatedly under connection pressure. Fix: retry 3x with exponential backoff before aborting; persistent failure still fails the boot, preserving the fail-closed contract.

Both fixes are running in our production deployment.

Two production-observed issues on deployments using the community deletion
control plane, both benign-looking but permanent:

1. The NIP-43 membership reconciler sweeps every community, including
   quiescing/fenced/tombstone ones — whose database write fence correctly
   rejects the snapshot write. Result: after any community deletion reaches
   its fence step, every reconciliation sweep logs a 'community write
   fenced' failure per retired community, forever. Sweep only
   lifecycle-'active' communities (new usage::writable_community_hosts).

2. The boot-time deletion serving-fence validation is fail-closed with no
   retry, so a transient DB pool timeout — routine during rolling deploys
   when old and new pods briefly share the connection budget — flaps a
   fresh pod into CrashLoopBackOff. Retry 3x with backoff before aborting;
   persistent failure still fails the boot.

Both observed and fixed in a ~7.7k-user production deployment; the
reconciler loop produced continuous warnings after retiring three
communities, and the boot flap reproduced under connection pressure during
rolling restarts.

Signed-off-by: Navendu Agarwal <navendu.agarwal+ola@olacabs.com>
@navenduagarwal
navenduagarwal requested a review from a team as a code owner August 29, 2026 03:58
@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 00e61eafa917d296104006576b7a2ddbfd58bb5a...1fb4091f883445b635f32bc78ca0ecc66be88db1.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 1fb4091f883445b635f32bc78ca0ecc66be88db1 to authorize a new review.
Any previous review applies only to its recorded range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant