Skip to content

feat(consensus): add session registration protocol with combined login+register#3108

Merged
numinnex merged 12 commits intoapache:masterfrom
krishvishal:client-table-sdk
Apr 17, 2026
Merged

feat(consensus): add session registration protocol with combined login+register#3108
numinnex merged 12 commits intoapache:masterfrom
krishvishal:client-table-sdk

Conversation

@krishvishal
Copy link
Copy Markdown
Contributor

Summary

  • Add Operation::Register as a VSR-level operation that goes through consensus to create durable client sessions, giving each client a deterministic session number (= commit op number) agreed upon by all replicas.
  • Add session field to RequestHeader with wire-layer validation: register requires session=0, request=0; all other operations require session>0, request>0.
  • Split ClientTable into session-aware paths: check_register() / commit_register() for registration, and check_request() / commit_reply() with session + strict request monotonicity validation (NoSession, SessionMismatch, `RequestGap).
  • Add ConsensusSession (SDK) for client-side session lifecycle and SessionManager (server-ng) for transport-to-consensus bridging.
  • Add combined login_register handler: phase 1 verifies credentials locally, phase 2 submits register through consensus.
  • Add RequestFrame2/ResponseFrame2 with request_id for request-response correlation and pipelining support.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 91.68185% with 137 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.13%. Comparing base (6d44521) to head (e5012b2).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
core/metadata/src/impls/metadata.rs 43.85% 32 Missing ⚠️
core/server-ng/src/login_register.rs 88.80% 18 Missing and 10 partials ⚠️
core/consensus/src/client_table.rs 91.26% 12 Missing and 8 partials ⚠️
core/server-ng/src/session_manager.rs 90.14% 16 Missing and 4 partials ⚠️
core/partitions/src/iggy_partition.rs 70.58% 9 Missing and 1 partial ⚠️
core/binary_protocol/src/framing.rs 95.77% 0 Missing and 9 partials ⚠️
core/consensus/src/plane_helpers.rs 69.23% 8 Missing ⚠️
core/sdk/src/session.rs 97.19% 3 Missing ⚠️
core/simulator/src/lib.rs 95.83% 1 Missing and 1 partial ⚠️
...nary_protocol/src/requests/users/login_register.rs 99.25% 0 Missing and 1 partial ⚠️
... and 4 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3108      +/-   ##
============================================
+ Coverage     72.62%   73.13%   +0.51%     
  Complexity      943      943              
============================================
  Files          1117     1123       +6     
  Lines         96380    97892    +1512     
  Branches      73555    75082    +1527     
============================================
+ Hits          69997    71595    +1598     
+ Misses        23831    23682     -149     
- Partials       2552     2615      +63     
Components Coverage Δ
Rust Core 74.02% <91.68%> (+0.69%) ⬆️
Java SDK 62.30% <ø> (ø)
C# SDK 69.13% <ø> (-0.28%) ⬇️
Python SDK 81.43% <ø> (ø)
Node SDK 91.31% <ø> (-0.10%) ⬇️
Go SDK 39.41% <ø> (ø)
Files with missing lines Coverage Δ
core/binary_protocol/src/codes.rs 100.00% <ø> (ø)
core/binary_protocol/src/consensus/header.rs 80.56% <100.00%> (+4.60%) ⬆️
core/binary_protocol/src/consensus/operation.rs 95.18% <100.00%> (+0.81%) ⬆️
core/binary_protocol/src/dispatch.rs 91.15% <100.00%> (+0.15%) ⬆️
...nary_protocol/src/requests/users/login_register.rs 99.25% <99.25%> (ø)
...ocol/src/requests/users/login_register_with_pat.rs 99.18% <99.18%> (ø)
...ary_protocol/src/responses/users/login_register.rs 97.72% <97.72%> (ø)
core/consensus/src/observability.rs 40.18% <0.00%> (-0.10%) ⬇️
core/simulator/src/client.rs 52.60% <97.14%> (+10.04%) ⬆️
core/simulator/src/lib.rs 86.22% <95.83%> (+1.79%) ⬆️
... and 8 more

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@numinnex
Copy link
Copy Markdown
Contributor

I've looked through this PR and I wonder how does it differ from the login and login with personal access token ?

@krishvishal
Copy link
Copy Markdown
Contributor Author

@numinnex I've only implemented login functionality with register but didn't implement login with personal access token. But its easily implementable because register doesn't care about how we logged in.

Comment thread core/consensus/src/plane_helpers.rs
Comment thread core/metadata/src/impls/metadata.rs
@numinnex numinnex merged commit 2d6562b into apache:master Apr 17, 2026
80 checks passed
@krishvishal krishvishal deleted the client-table-sdk branch April 17, 2026 08:18
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.

4 participants