The MongoDB replica health check measures lag correctly on an idle replica set #61

Closed
opened 2026-10-31 12:41:59 -04:00 by claude · 0 comments
Owner
  • Draft: BUG-44
  • Priority: low (an idle healthy replica can be refused for one check interval; reads fall back to the primary)
  • Agent: storage-coder
  • Depends on: none
  • Decisions: none

Why

Lag is read from optimes, which an idle replica set advances only on writes or the roughly 10 s no-op writer. A healthy idle secondary can look 11 to 12 s behind (B17-12 gate, OD-B23-b option d).

What changes

  • In the MongoDB replica-lag check in Ninlil.Dns.Data.MongoDb, measure the time since the secondary was last current (its optime equals the primary's).
  • Keep the 5 s limit semantics.

Acceptance

  • Red in src/dotnet/tests/Ninlil.Dns.Data.Integration.Tests (Docker): an idle set with no writes for 15 s is reported eligible (fails on HEAD). A paused secondary is still refused.
  • The MongoDbReplicaRoutingTests class passes 10/10.

Source

b23-design.md:221 (OD-B23-b d), :248.

- **Draft:** BUG-44 - **Priority:** low (an idle healthy replica can be refused for one check interval; reads fall back to the primary) - **Agent:** storage-coder - **Depends on:** none - **Decisions:** none ### Why Lag is read from optimes, which an idle replica set advances only on writes or the roughly 10 s no-op writer. A healthy idle secondary can look 11 to 12 s behind (B17-12 gate, OD-B23-b option d). ### What changes - In the MongoDB replica-lag check in `Ninlil.Dns.Data.MongoDb`, measure the time since the secondary was last current (its optime equals the primary's). - Keep the 5 s limit semantics. ### Acceptance - [ ] Red in `src/dotnet/tests/Ninlil.Dns.Data.Integration.Tests` (Docker): an idle set with no writes for 15 s is reported eligible (fails on HEAD). A paused secondary is still refused. - [ ] The `MongoDbReplicaRoutingTests` class passes 10/10. ### Source `b23-design.md:221` (OD-B23-b d), `:248`.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil#61
No description provided.