feat(server-ng): add partition reconciliation loop#3436
Merged
numinnex merged 2 commits intoJun 11, 2026
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3436 +/- ##
============================================
+ Coverage 74.33% 74.55% +0.22%
Complexity 943 943
============================================
Files 1247 1249 +2
Lines 122232 123567 +1335
Branches 98504 99867 +1363
============================================
+ Hits 90858 92130 +1272
- Misses 28413 28415 +2
- Partials 2961 3022 +61
🚀 New features to boost your workflow:
|
f62c61a to
dfe5fb8
Compare
hubcio
requested changes
Jun 9, 2026
hubcio
left a comment
Contributor
There was a problem hiding this comment.
overall all these comments are just nits. gj krishna, despite the size change is very reasonable.
68fc78a to
7bbfc82
Compare
numinnex
approved these changes
Jun 11, 2026
hubcio
approved these changes
Jun 11, 2026
Contributor
Author
|
/ready |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A level-triggered partition reconciliation loop, one task per shard, that converges each shard's local partition set to the committed Streams metadata.
How
Single-writer via the pump funnel. The reconciler runs off-pump. It stages
ReconcileOp::{InsertOwned, InsertRouted, ConfirmRemove, RemoveRouted}and the pump applies them single-writer.Two-phase tombstone teardown. The reconciler fences writes synchronously (tombstone +
shards_tablerow removal), awaits the disk delete, then enqueuesConfirmRemove. A failed delete stays tombstoned and backed off; the in-memory partition is never dropped while its data still exists.Epoch / fast-skip model. A monotonic
Streams::revision(bumped in the STM on every partition-shaping commit) lets a converged pass skip the O(N) diff when nothing changed. A per-partitioncreated_revisiondistinguishes a delete +recreate that reused the same slab-key namespace from the original incarnation, triggering a rebuild instead of serving stale segments.
Failure handling. Per-cause exponential backoff (separate budgets for build vs delete) and recovery for a permanently-wedged tombstone after a failed disk delete.