Repository navigation
feat(server)!: route partition requests to their primaries - #4506
Merged
Merged
Conversation
hubcio
force-pushed
the
feat/partition-routing
branch
from
October 13, 2026 11:46
ec777bb to
94aa5de
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4506 +/- ##
============================================
+ Coverage 88.28% 88.99% +0.71%
- Complexity 1726 1735 +9
============================================
Files 1316 1329 +13
Lines 266283 283993 +17710
Branches 224918 242565 +17647
============================================
+ Hits 235081 252746 +17665
+ Misses 25689 25587 -102
- Partials 5513 5660 +147
🚀 New features to boost your workflow:
|
numinnex
reviewed
Oct 13, 2026
numinnex
reviewed
Oct 13, 2026
numinnex
reviewed
Oct 13, 2026
numinnex
reviewed
Oct 13, 2026
numinnex
reviewed
Oct 13, 2026
numinnex
reviewed
Oct 13, 2026
numinnex
reviewed
Oct 14, 2026
numinnex
reviewed
Oct 14, 2026
hubcio
added a commit
that referenced
this pull request
Oct 14, 2026
Repair gaps could discard committed history. Retain unknown entries under proof fences and remove only proven mismatches. Reconcile before repair admission and refresh StartView suffixes so restarted replicas and same-view retries recover safely. Bound forwarded HTTP holds and pin consumer progress and owner fences. Correct lifecycle coverage, avoid duplicate Go context lookups and document coordinated SDK/server upgrades. Extract the unrelated CI timing fallback into the separately preserved patch. Refs #4506
hubcio
force-pushed
the
feat/partition-routing
branch
from
October 14, 2026 09:54
17391af to
ebe761f
Compare
spetz
previously requested changes
Oct 14, 2026
hubcio
added a commit
that referenced
this pull request
Oct 14, 2026
History proof fences commits while repairing missing predecessors. Partition repair waited for commit progress, so each predecessor stalled until the retry timer and restarted replicas timed out. Track the last requested start and continue when proof advances. Keep timer retries for unchanged proof and verify both paths. Refs #4506
Backups refused requests without directing clients to a partition's primary. HTTP tried writes on every node, and partition lookup required send permission. Add command 105 for partition routes with send or poll permission, NotPrimary (89), and replica IDs in cluster metadata. Routes carry incarnation, frontier and view. HTTP forwards to the partition primary in one hop; stale routes cannot chain relays. Run reads, polls and metadata commit waits outside the connection drain. Serialize metadata writes per connection and serve QUIC streams concurrently to prevent stalls. The Rust SDK shares session state, correlates TCP/WebSocket replies by request ID and bounds QUIC requests by deadlines. Add a driver with cached routes, one link per replica and one mutation at a time per partition history and for metadata. Clients do not use the driver yet. Derive owner generations from metadata ops to fence recreated groups. IGGY-OWNERSHIP-HISTORY-5 rejects older data before modifying it. Fence old partition control frames with incarnation in reserved bytes, preserving header sizes and field offsets. Close the owner handoff, retirement and offset-transfer gaps found in transfer emptied-table markers with offsets artifact v8. Exhausted partition repair windows escalate to state transfer. Rotations preserve the session ceiling and yield capacity; transfers reset repair budgets. Prove retained StartView history before committing or serving repair. Preserve unresolved proof across failed truncation and view changes, and retain acknowledged tails on commit-only updates. Metadata recovery protects pipeline-owned prepares; internal completions no longer become external reply attempts. Carry the transport disconnect fix from #4388 and retry relayed reads after primary failure. Simulator checks cover replacement histories and restarts. Keep unresolved requests through same-session re-login and transient refusals, bind the refusing endpoint and preserve committed-offset flags across restart. After offset file loss at boot, including all files or a whole kind directory, deleting the donor's last key can emit an emptied-table marker that drops those offsets on lagging receivers. That key may have been written after boot. Deleted groups remain only while stranded offsets are durable, avoiding permanent catalog retention for unreadable or unremovable files.
Foreign clients decoded command 105 and cluster nodes using the old wire layouts, breaking routing, examples and cross-language tests. Decode exact partition routes and replica IDs across the SDKs. Route polls, sends and explicit offsets through one cache and shared session counter, preserving request identity and context after uncertainty. Keep route discovery and binding outside data-operation retry loops. Cover replica moves, malformed replies, missing partitions, lifecycle refusals and retained uncertainty with protocol and integration tests.
The operation driver is not active yet, so its routing targets should not form part of the public common API. Keep them inside the driver and hide unavailable recovery methods. Document lost recovery state after session reset and the auto-commit lane exemption.
Replica control frames and client route replies both changed. Document the coordinated upgrade requirement and the metadata exposed by an authorized route lookup.
Graceful shutdown discarded accepted streams before their replies were acknowledged. Keep routing replies and serving those streams until completion or close_grace expires.
ViewChange donors could serve abandoned prepares to backups, while blank canonical slots triggered repeated removal of valid history. Restrict suffix serving by view and role, bind terminators to their peer, and keep blank-slot proof pending until repair supplies evidence.
The route deadline could truncate a successful poll after auto-commit. Renew the body idle timeout on progress while retaining bounded read-ahead, cancellation and stalled-reader cleanup.
hubcio
force-pushed
the
feat/partition-routing
branch
from
October 14, 2026 11:23
4dc21ae to
aef9aca
Compare
numinnex
reviewed
Oct 14, 2026
Durability from an old view does not prove an entry belongs to the adopted history. Check each selected commit in the IO continuation and journal walks, and reject eviction-floor substitution while history remains unproven. Cover durable old-view entries and a connected but unproven repair floor. Explain certificate invalidation after divergence removal.
Backward proof repair repeatedly fetched the held suffix and could stall after proving a chain whose canonical head still lacked a body. Fetch chunks ending at the proof hole and continue when it changes. Reconcile only frames that can close that hole. Keep the metadata repair ceiling above the adopted head after a retransmit rewinds its sequencer. Cover metadata suffix refresh and same-view proof renewal, with a large-gap repair regression.
Include Swift initialization, C++ FFI aggregates and both Rust public cluster node types in the SDK upgrade notes.
Borrow the canonical header bytes to preserve their alignment. Vec<u8> does not guarantee PrepareHeader alignment under Miri.
numinnex
approved these changes
Oct 14, 2026
spetz
approved these changes
Oct 14, 2026
RustToMetal
added a commit
to RustToMetal/iggy
that referenced
this pull request
Oct 14, 2026
A client whose connection dropped on its own, through a reply timeout, a cancelled request, or an outage longer than the request timeout, stayed disconnected for every typed call: they failed without dialing and the heartbeat skipped its ping. The heartbeat now pings in every state but shutdown, as in the Rust SDK, and a typed call reconnects first when there are credentials to sign in with. A second connect() no longer restarts the heartbeat, which could abort a ping in flight and the connection with it. Since apache#4506 a backup refuses metadata writes and DeleteSegments with NotPrimary. It now takes the not-accepted path and moves to the new primary at once, since it was never admitted. A replicated write whose outcome is unknown was reported as disconnected, the same error as a request that was never sent, so a caller retrying on disconnect could apply it twice. It now fails with TransientNotCommitted, as the Rust SDK reports it. A request that runs out of time between same-node replays returns its last refusal and keeps the connection instead of closing it. A request replayed on a single node after the failover check kept its request id, while a caller queued behind it could spend the next id and commit first, after which the server refuses the replay as too old. The replay is now stamped afresh, which is safe because the refusal proved it was never admitted. The test server's roster gains the replica id that apache#4506 added to the cluster metadata reply. Relates to apache#4001
This was referenced Oct 14, 2026
hubcio
added a commit
that referenced
this pull request
Oct 19, 2026
Partition-aware components were not active across transports, and uncertain writes lacked a consistent application recovery path. Activate shared session owners, partition lanes and multiplexed replica links across Rust and native SDKs. Retain frozen mutations for explicit resolve or abandon with configurable count and byte limits. End uncertain progress polls without replaying them. Require committed receipt proof before releasing uncertain lanes. Preserve that proof through server reply rewrites and route offset reads through partition-primary history gates. Preserve FIFO admission, frozen payloads and one operation deadline across safe retries and recovery. Refresh session credentials across replica links and release retained buffers at their owning session. BREAKING CHANGE: Require fresh IGGY-BOUND-GRANTS-3 storage and matching servers and SDKs. ReplyHeader byte 220 is the committed-result marker; value 1 proves a committed result. Retire commands 103, 104 and 123, remove producer retry configuration, and update binding recovery/error APIs. VsrSessionControl drops refresh_session_password and refresh_session_username. Direct C++ bridge calls require a per-call ErrorInfo argument. Node Client.destroy() now aborts in-flight requests immediately, a sign-in that reaches no endpoint rejects with NotConnectedError, and consumer stream factories sign in at creation. Relates to #4436. Continues the multi-leader routing work from #4506. Placement and rebalancing will be raised as next PR.
hubcio
added a commit
that referenced
this pull request
Oct 19, 2026
Partition-aware components were not active across transports, and uncertain writes lacked a consistent application recovery path. Activate shared session owners, partition lanes and multiplexed replica links across Rust and native SDKs. Retain frozen mutations for explicit resolve or abandon with configurable count and byte limits. End uncertain progress polls without replaying them. Require committed receipt proof before releasing uncertain lanes. Preserve that proof through server reply rewrites and route offset reads through partition-primary history gates. Preserve FIFO admission, frozen payloads and one operation deadline across safe retries and recovery. Refresh session credentials across replica links and release retained buffers at their owning session. BREAKING CHANGE: Require fresh IGGY-BOUND-GRANTS-3 storage and matching servers and SDKs. ReplyHeader byte 220 is the committed-result marker; value 1 proves a committed result. Retire commands 103, 104 and 123, remove producer retry configuration, and update binding recovery/error APIs. VsrSessionControl drops refresh_session_password and refresh_session_username. Direct C++ bridge calls require a per-call ErrorInfo argument. Node Client.destroy() now aborts in-flight requests immediately, a sign-in that reaches no endpoint rejects with NotConnectedError, and consumer stream factories sign in at creation. Relates to #4436. Continues the multi-leader routing work from #4506. Placement and rebalancing will be raised as next PR.
hubcio
added a commit
that referenced
this pull request
Oct 19, 2026
Partition-aware components were not active across transports, and uncertain writes lacked a consistent application recovery path. Activate shared session owners, partition lanes and multiplexed replica links across Rust and native SDKs. Retain frozen mutations for explicit resolve or abandon with configurable count and byte limits. End uncertain progress polls without replaying them. Require committed receipt proof before releasing uncertain lanes. Preserve that proof through server reply rewrites and route offset reads through partition-primary history gates. Preserve FIFO admission, frozen payloads and one operation deadline across safe retries and recovery. Refresh session credentials across replica links and release retained buffers at their owning session. BREAKING CHANGE: Require fresh IGGY-BOUND-GRANTS-3 storage and matching servers and SDKs. ReplyHeader byte 220 is the committed-result marker; value 1 proves a committed result. Retire commands 103, 104 and 123, remove producer retry configuration, and update binding recovery/error APIs. VsrSessionControl drops refresh_session_password and refresh_session_username. Direct C++ bridge calls require a per-call ErrorInfo argument. Node Client.destroy() now aborts in-flight requests immediately, a sign-in that reaches no endpoint rejects with NotConnectedError, and consumer stream factories sign in at creation. Relates to #4436. Continues the multi-leader routing work from #4506. Placement and rebalancing will be raised as next PR.
hubcio
added a commit
that referenced
this pull request
Oct 20, 2026
Partition-aware components were not active across transports, and uncertain writes lacked a consistent application recovery path. Activate shared session owners, partition lanes and multiplexed replica links across Rust and native SDKs. Retain frozen mutations for explicit resolve or abandon with configurable count and byte limits. End uncertain progress polls without replaying them. Require committed receipt proof before releasing uncertain lanes. Preserve that proof through server reply rewrites and route offset reads through partition-primary history gates. Preserve FIFO admission, frozen payloads and one operation deadline across safe retries and recovery. Refresh session credentials across replica links and release retained buffers at their owning session. BREAKING CHANGE: Require fresh IGGY-BOUND-GRANTS-3 storage and matching servers and SDKs. ReplyHeader byte 220 is the committed-result marker; value 1 proves a committed result. Retire commands 103, 104 and 123, remove producer retry configuration, and update binding recovery/error APIs. VsrSessionControl drops refresh_session_password and refresh_session_username. Direct C++ bridge calls require a per-call ErrorInfo argument. Node Client.destroy() now aborts in-flight requests immediately, a sign-in that reaches no endpoint rejects with NotConnectedError, and consumer stream factories sign in at creation. Relates to #4436. Continues the multi-leader routing work from #4506. Placement and rebalancing will be raised as next PR.
hubcio
added a commit
that referenced
this pull request
Oct 21, 2026
The test pinned that a send keeps its cached route after PartitionNotFound. Since a final namespace miss now marks the route stale, as the Rust SDK has done since #4506, that premise no longer holds. The first send now fails with 41, which leaves the route in both SDKs, so the test still pins that only a refusal of the context drops it. A plain pipe client serves it, because no namespace miss needs the roster of the metadata primary.
This was referenced Oct 24, 2026
2 tasks done
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.
Backups refused requests without directing clients to a partition's
primary. HTTP tried writes on every node, and partition lookup
required send permission.
Add command 105 for partition routes with send or poll permission,
NotPrimary (89), and replica IDs in cluster metadata. Routes carry
incarnation, frontier and view. HTTP forwards to the partition primary
in one hop; stale routes cannot chain relays.
Run reads, polls and metadata commit waits outside the connection
drain. Serialize metadata writes per connection and serve QUIC streams
concurrently to prevent stalls.
The Rust SDK shares session state, correlates TCP/WebSocket replies by
request ID and bounds QUIC requests by deadlines. Add a driver with
cached routes, one link per replica and one mutation at a time per
partition history and for metadata. Clients do not use the driver yet.
Go, Java, Node.js and C# migrate sends, polls and offset operations to
command 105 routes with matching server/SDK releases. Cluster metadata
adds replica_id: Java ClusterNode gains a leading replicaId record
component, changing constructor calls and record patterns; C# callers
must initialize required ReplicaId. Swift's ClusterNode initializer
requires replicaID. C++'s FFI ClusterNode and Rust's ClusterNode
(iggy_common) and ClusterNodeResponse (iggy_binary_protocol) add
replica_id to aggregate/struct initialization. The CLI metadata list
appends a replica ID column.
Derive owner generations from metadata ops to fence recreated groups.
IGGY-OWNERSHIP-HISTORY-5 rejects older data before modifying it. Fence
old partition control frames with incarnation in reserved bytes,
preserving header sizes and field offsets. Mixed server versions and
rolling upgrades are unsupported; older incarnation-zero control frames
are rejected. Existing data needs a separately validated offline
migration or restore procedure.
Close the owner handoff, retirement and offset-transfer gaps found in #4456.
Relay partition completions to the metadata primary and
transfer emptied-table markers with offsets artifact v8. Exhausted
partition repair windows escalate to state transfer. Rotations
preserve the session ceiling and yield capacity; transfers reset
repair budgets.
Prove retained StartView history before committing or serving repair.
Keep entries across unknown gaps, remove only proven mismatches and
recheck the chain as repair fills gaps. Fence acknowledgements and DVC
present bits until the entries are proven. Retry failed reconciliation
on same-view StartView and refresh suffixes before stale-primary replies.
Retain acknowledged tails on commit-only updates. Metadata recovery
protects pipeline-owned prepares; internal completions no
longer become external reply attempts.
Carry the transport disconnect fix from #4388 and retry relayed reads
after primary failure. Simulator checks compare prepare identity chains
and consumer-offset tables across replacement histories and restarts.
Applied message-data/readback digests, simulator partition state
transfer and end-to-end consumer-group owner retirement remain PR6
acceptance work. The retirement checker has unit coverage; the shell
does not yet drive its RetireConsumerGroupOwners producer. Keep unresolved requests through
same-session re-login and transient refusals, bind the refusing endpoint and preserve
committed-offset flags across restart.
After offset file loss at boot, including all files or a whole kind
directory, deleting the donor's last key can emit an emptied-table
marker that drops those offsets on lagging receivers. That key may
have been written after boot. Deleted groups remain only while
stranded offsets are durable, avoiding permanent catalog retention for
unreadable or unremovable files.
Repair requests now carry the requester view. ViewChange donors serve
uncommitted suffixes only to the primary of that view; ordinary backups
receive the locally applied prefix. Range replies must match the chosen
peer and nonce. Blank canonical slots leave proof pending instead of
triggering repeated deletion. Backward proof progress immediately pulls
the next repair chunk. Requests end at the missing proof entry and
fetch a bounded backward chunk, then fetch canonical bodies still
missing after the chain is proven. Partition IO commit selection checks
each entry's history proof, and peer eviction floors cannot substitute
for unproven history. Metadata repair retains the adopted head even
when a retransmission rewinds the sequencer. Reconcile on the frame
that closes the proof hole, rather than every lower entry in a chunk.
Successful forwarded poll bodies use an idle
timeout that renews on progress, preserving cancellation and bounded
read-ahead without applying the routing deadline after auto-commit.
PR5 retains Rust driver activation and native lifecycle, mux and
conformance gates, including independent C# route-generation guard
regressions. PR6 retains placement and performance work plus open
correctness gates: reply backpressure, HTTP target-hold isolation,
requester-side trust for unanchored repair history, the existing recovery
blockers and simulator applied-data/transfer/retirement coverage.
Batched divergence cleanup, durable metadata history certification,
HTTP slow-body admission isolation and deterministic lifecycle stale-store
coverage also remain PR6. Each deferred review thread
records its owner and acceptance criteria; thread resolution does not
mean the deferred implementation is complete.
Local Execution
Passed: workspace build, formatting, manifest sorting, strict Clippy,
Taplo and changed-file prek hooks; 1,979 unit tests and 37 selected
cluster/pipelining integrations with rebuilt binaries (five and two
existing ignores). Partition seeds 7009, 7056, 7016 and 20007 and
metadata seed 7002 converge. Lifecycle shell seed 20037 converges
without the range panic but exits 3 with no stale-owner-store coverage;
that is a PR6 vacuity gap, not a passing lifecycle gate. The full
reviewer campaigns were not rerun.
Regressions reject durable unproven commit selection and floor
substitution. Four negative controls catch same-view proof bypass,
stale metadata suffix replies, a truncated repair target and backward
repair amplification. The large-gap test fetches 2,048 bodies in 17
requests and applies the complete 2,050-op history without retry ticks.
AI Usage
Codex investigated CI and review failures and wrote review fixes,
regression tests and documentation drafts. Verification included
before-fix reproductions, the checks above and source/diff inspection.
The PR author owns the design and review of the resulting changes.