Skip to content

[DONT MERGE]SDSTOR-22908 craft: majority quorum + stale-term fence in pre_resolve… - #186

Draft
sbinmalek wants to merge 2 commits into
eBay:dev/v6.xfrom
sbinmalek:SDSTOR-22908
Draft

sbinmalek wants to merge 2 commits into
eBay:dev/v6.xfrom
sbinmalek:SDSTOR-22908

Conversation

@sbinmalek

Copy link
Copy Markdown
Contributor

…_slots

Addresses szmyd's PR #183 review follow-ups ahead of wiring append():

  • Empty verdicts now need a majority of the replica set (member_count/2 + 1, leader counting itself) via a new CraftRaftProposer::member_count() seam; sub-majority fails NO_QUORUM with no local mutation, unknown membership fails closed before the fetch.
  • Discard the round (STALE_TERM, nothing written) if an InternalLogin moves the term while the quorum fetch is in flight.
  • Return pre_resolution{empty_slots, first_unresolved} so the proposer can avoid proposing past a slot whose local write failed (the only signal for a beyond-frontier slot).
  • Raise homestore floor to ^8.3.5 (SDSTOR-20656: clear wbc chunk selector #179 needs evict_chunk_blkids); bump to 6.0.13.

…_slots

Addresses szmyd's PR eBay#183 review follow-ups ahead of wiring append():

- Empty verdicts now need a majority of the replica set (member_count/2 + 1,
  leader counting itself) via a new CraftRaftProposer::member_count() seam;
  sub-majority fails NO_QUORUM with no local mutation, unknown membership
  fails closed before the fetch.
- Discard the round (STALE_TERM, nothing written) if an InternalLogin moves
  the term while the quorum fetch is in flight.
- Return pre_resolution{empty_slots, first_unresolved} so the proposer can
  avoid proposing past a slot whose local write failed (the only signal for
  a beyond-frontier slot).
- Raise homestore floor to ^8.3.5 (eBay#179 needs evict_chunk_blkids); bump to
  6.0.13.

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Oct 14, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 43.18182% with 25 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (dev/v6.x@87cb23e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/lib/craft/craft_repl_dev.cpp 32.43% 10 Missing and 15 partials ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff             @@
##             dev/v6.x     #186   +/-   ##
===========================================
  Coverage            ?   49.78%           
===========================================
  Files               ?       19           
  Lines               ?     1392           
  Branches            ?      615           
===========================================
  Hits                ?      693           
  Misses              ?      286           
  Partials            ?      413           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…p loop

Wire the leader-side SyncRSCommitLSN proposal and its four triggers, and make
apply's peer catch-up follow the CRAFT-Design wiki's FetchData loop.

- append()/propose_sync(): leader-only; runs pre_resolve_slots, clamps
  rs_commit_lsn below the first unresolved slot, carries only verdicts <= it,
  skips proposals that add nothing over the last committed one, and proposes
  via the new CraftRaftProposer::is_leader()/propose() seam.
- request_resolution(): client Resolve; recovery gates + term fence, then
  propose_sync; returns resolved_upto and every Empty verdict <= it.
- Background rounds (periodic every sync_rs_commit_lsn_interval writes, and
  the watchdog): GetRSCommitLSN(is_login=false) poll via the new
  CraftPeerFetcher::get_rs_commit_lsn_from_quorum (majority required), then
  append(max(quorum.last_append)). Silent on followers; coalesced while one
  is in flight. FIXME: this can mark an in-flight write Empty after it was
  acked -- open with szmyd.
- Catch-up: one worker per device loops until no missing slot <= N remains
  (wiki "loop until no missing slot <= N"), with backoff via an injected
  sleep_fn_t (unwired = single attempt, as before) and a stop() hook.
  Overlapping applies hand off to the running worker; filled slots are
  claimed against concurrent late writes; truncate() clamps the target.
- pre_resolve_slots scans missing slots from commit_lsn + 1 explicitly.
- subtasks.md S5: catch-up retries until filled, per the wiki.

Login (S7) is still a stub; the ReplDev binding for CraftRaftProposer, the
iomgr sleep and stop() wiring are S8.

Co-Authored-By: Claude <noreply@anthropic.com>
@sbinmalek sbinmalek changed the title SDSTOR-22908 craft: majority quorum + stale-term fence in pre_resolve… [DONT MERGE]SDSTOR-22908 craft: majority quorum + stale-term fence in pre_resolve… Oct 15, 2026
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.

2 participants