feat(java): migrate the TCP client to the VSR wire protocol - #3841
Merged
Conversation
mmodzelewski
force-pushed
the
java-vsr
branch
2 times, most recently
from
August 7, 2026 20:33
0271112 to
2530c70
Compare
The Java SDK spoke only the legacy TCP framing, so it could not talk to server-ng, which frames every request in the VSR (Viewstamped Replication) consensus protocol. The Netty pipeline now encodes requests with VSR headers from a per-connection consensus session (client id, request counter, fence epoch) and decodes VSR replies, replacing the legacy frame codec. The server binds the session to one transport connection, so the pool pins a single channel and the connectionPoolSize builder option is gone. Transient denials replay the same encoded frame so the server dedup sees one request id: not-committed for the full 30s budget (outcome unknown), not-accepted for 2s only (refused outright, typically a demoted primary). A failed pool acquire starts a background redial that alternates the current node with the seed and replays the builder credentials. The VSR broker routes explicit partitions only, so balanced and key-based sends resolve to a concrete partition client-side (round-robin cursor, xxh32(key) % count) and group polls pick the partition from the member's assignment, synced through the new consumer-group SYNC command and fenced by generation, matching the Rust SDK. Cached routing facts refresh past a 5s staleness budget. sendMessages returns the commit confirmation (partition and base offset) instead of Void. Java CI, BDD, and examples lanes run against iggy-server-ng with the vsr feature; the SDK version bumps to 0.9.0-SNAPSHOT. On the server side, a login whose credentials were rejected no longer falls through to the malformed-payload rejection but reports InvalidCredentials.
slbotbm
previously requested changes
Aug 8, 2026
Member
Author
|
@slbotbm Thanks for the review. I've addressed all the comments. /ready |
numinnex
previously approved these changes
Aug 10, 2026
hubcio
previously approved these changes
Aug 10, 2026
numinnex
previously approved these changes
Aug 10, 2026
spetz
approved these changes
Aug 10, 2026
numinnex
approved these changes
Aug 10, 2026
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.
The Java SDK spoke only the legacy TCP framing, so it could not
talk to server-ng, which frames every request in the VSR
(Viewstamped Replication) consensus protocol.
The Netty pipeline now encodes requests with VSR headers from a
per-connection consensus session (client id, request counter,
fence epoch) and decodes VSR replies, replacing the legacy frame
codec. The server binds the session to one transport connection,
so the pool pins a single channel and the connectionPoolSize
builder option is gone. Transient denials replay the same encoded
frame so the server dedup sees one request id: not-committed for
the full 30s budget (outcome unknown), not-accepted for 2s only
(refused outright, typically a demoted primary). A failed pool
acquire starts a background redial that alternates the current
node with the seed and replays the builder credentials.
The VSR broker routes explicit partitions only, so balanced and
key-based sends resolve to a concrete partition client-side
(round-robin cursor, xxh32(key) % count) and group polls pick the
partition from the member's assignment, synced through the new
consumer-group SYNC command and fenced by generation, matching
the Rust SDK. Cached routing facts refresh past a 5s staleness
budget. sendMessages returns the commit confirmation (partition
and base offset) instead of Void.
Java CI, BDD, and examples lanes run against iggy-server-ng with
the vsr feature; the SDK version bumps to 0.9.0-SNAPSHOT. On the
server side, a login whose credentials were rejected no longer
falls through to the malformed-payload rejection but reports
InvalidCredentials.