Repository navigation
feat(sdk)!: activate partition routing and recovery - #4561
Conversation
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (42.34%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #4561 +/- ##
============================================
+ Coverage 89.03% 89.68% +0.65%
- Complexity 1785 2146 +361
============================================
Files 1332 1343 +11
Lines 288630 289943 +1313
Branches 247077 246218 -859
============================================
+ Hits 256971 260028 +3057
+ Misses 26006 24181 -1825
- Partials 5653 5734 +81
🚀 New features to boost your workflow:
|
89500c4 to
3504d9b
Compare
spetz
left a comment
There was a problem hiding this comment.
Five critical defects and ten warnings, all inline. Four of the criticals let a client lose track of a write that can have committed: the Rust producer and consumer resolve and discard another caller's uncertain operation, Go reports an uncertain write as ErrUnauthenticated, and Java grades a STALE_CLIENT eviction as a final refusal. The fifth is in Rust and Node: a one-node server behind NAT, a port-forward or a container port mapping becomes unreachable after a link drop in Rust, and right after login in Node, because both clients dial the advertised roster address instead of the configured one.
16676ce to
118eed2
Compare
spetz
left a comment
There was a problem hiding this comment.
Follow-up at 118eed2. The fixes for the first review hold, with the gaps noted in the thread replies. One new critical: after a routine replica restart in a multi-node cluster, a Rust IggyConsumer stops consuming for good (core/sdk/src/driver.rs:954). The other inline comments are warnings that leave a group consumer, a connector source or a Java resolve stuck. Smaller findings can follow separately.
54dc47d to
a722221
Compare
a23f92a to
95625fb
Compare
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.
A restored replica can refuse a live session's reads with status 40. Rebind that link and retry refused reads within the existing deadline, preserving mutation refusals and session identity.
An uncertain create or join blocked every later group initialization. Remember and resolve the consumer's operation before joining again, keeping unknown outcomes and other callers' operations intact.
A restarted producer loses the previous producer's uncertain IDs. Resolve its retained lane blocker before retrying the full unsent batch, while preserving the earlier operation's outcome.
Timeout and cancellation callbacks could replay before pending-ID cleanup, then release the next resolver's claim a second time. Replace terminal pending entries and retain each attempt only once.
Authenticated reads lost the authentication failure after user deletion and eventually surfaced NotConnected. Preserve the operation's session requirement across retries and finish with Unauthenticated when automatic recovery ends unbound. Keep successful reauthentication and detached-link recovery intact.
Cleanup swallowed uncertain stream deletions, leaving the shared client's metadata lane blocked for subsequent tests. Resolve retained operations and verify deletion before continuing. Stop the test session on cleanup failure, and allow the maximum partition test enough time for bounded recovery.
A leave resolved after a lost reply did not record the caller's intent, so the next poll could join the group again. Apply membership effects from the frozen request before releasing its lane, for typed calls, raw requests and recovery. Cover a lost leave reply and subsequent poll.
A coordinator that stopped replying without closing TCP never triggered failover. Close the timed-out PING channel and notify connection recovery while keeping ordinary request timeouts isolated. Cover automatic failover from an open but silent coordinator to a responsive replica.
The bridge timeout canceled sent metadata writes and left the shared client blocked on their retained operations. Resolve a blocker before retrying a later, unsent write within the same request deadline. Preserve unknown outcomes and never abandon or resubmit the earlier mutation. Cover delayed committed success and rejection, canceled recovery, and subsequent topic creation on the same bridge against a real server.
Treating every PING timeout as a heartbeat failure closed the shared channel for explicit system pings and broke late-reply isolation. Mark scheduled heartbeats in their request state and restrict channel recovery to that marker. Preserve explicit request timeout semantics.
Session replacement and cancellation could strand mutation lanes or leave consumers stalled. Delayed sign-in could also undo disconnect. Release stale reservations, settle refusals before roster refresh, and guard sign-in finalization. Let session events control polling, surface retained operation IDs, and restart interrupted connects.
Timed-out Produce and OffsetCommit operations left later writes blocked on their clients. Resolve their retained outcomes before admitting later writes, and report unresolved recovery as a timeout.
Token admission limits arrive in result bodies without commit proof. Count them as denials instead of asserting a committed result type.
A lost binding can leave its session and writes recoverable. Rebind NoSession links and replay frozen requests without resetting their identity; retain terminal handling for other eviction reasons. Close links after failed managed keepalive so silent peers redial.
A restored replica can reject an attachment while its session lives. Rebind before resetting recovery state, preserve frozen mutations, and restart replica slots after a finite retry budget is exhausted. Document the recovery interface and routing API compatibility changes.
An unbound connection must not discard unrelated retained writes. Rebind first and retain the eviction reason for terminal failures. Retry malformed bind replies and accept positive pending byte limits consistently with the other SDKs.
Detached links and uncertain group joins could strand recovery or clear retained writes. Rebind live sessions and resolve owned joins. Use per-lane waiter queues to avoid quadratic hot-lane admission, and align positive pending byte limits with the other SDKs.
An uncertain tool write could block its lane without a recovery API. Expose resolve and abandon tools with exact decimal operation IDs, write permission checks, and documented commitment semantics.
A replayed token creation can prove commitment while returning an already-exists error because its secret is unrecoverable. Document that exception and Swift's narrower protocol compatibility scope.
A detached binding can still have a live session. Replay frozen mutations after rebinding, while a NoSession bind ends recovery. Router clearing reports sent writes as uncertain with their IDs.
Simplify the detached-link guards without changing their behavior. Move the router-clear regression into the existing recovery suite to keep the shared fixture class within its size limit.
12c0ee9 to
12d34f0
Compare
Adapt the earlier redirect/shutdown and wrapper fixes to the replica-link architecture introduced by apache#4561. Keep immediate request cancellation and wait for every physical socket close before one final end event. Refuse new links after destruction, retain listener removal, and await custom raw-client destruction through SimpleClient. SingleClient now inherits Client's events. Separate link diagnostics from the raw stream's special error event so internal events.once recovery waits are not rejected by an expected replica failure. Add focused wrapper and routing/destruction regression coverage and update the lazy first-dial and all-replica event documentation. Preserve the original contribution's AI attribution below. OpenAI Codex ported the feature and tests to the new architecture and prepared this rebase. Local validation and environment limitations are recorded separately; this commit does not attest to human review or claim the PR is ready. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KqEXKVMqfFH6hmLUyQvjdS AI-Assistance: OpenAI Codex
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, Go, C#, Java and Node SDKs. Retain frozen mutations for
explicit resolve or abandon with configurable count and byte limits.
End uncertain progress polls without replaying them. Swift supplies protocol
and retry compatibility; it does not expose retained-operation recovery,
mutation lanes, or pending-operation limits. Rust-backed C++, Python and PHP
bindings expose the Rust recovery APIs.
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. A detached
connection rebinds before deciding whether its session ended. MCP exposes
explicit resolve/abandon tools and exact operation IDs in recovery errors.
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. Replayed successful
PAT creation returns PersonalAccessTokenAlreadyExists because the secret is
unrecoverable while preserving that commitment proof.
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. The public Node Client._pool property
is removed. Go contracts.Client implementors must add ResolveOperation and
AbandonOperation, and IggyTcpClient.HandleLeaderRedirection is removed.
Relates to #4436. Continues the multi-leader routing work from #4506.
Placement and rebalancing will be raised as next PR.