You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by gk...@apache.org on 2026/08/31 18:39:01 UTC

(iggy) branch fix_sdk_request_id_for_partition updated: cleanup stale comments

This is an automated email from the ASF dual-hosted git repository.

numinnex pushed a commit to branch fix_sdk_request_id_for_partition
in repository https://gitbox.apache.org/repos/asf/iggy.git


The following commit(s) were added to refs/heads/fix_sdk_request_id_for_partition by this push:
     new f3075cc28 cleanup stale comments
f3075cc28 is described below

commit f3075cc28fa949bf79d4fa3cc0bd02a74f5e5633
Author: Grzegorz Koszyk <g....@gmail.com>
AuthorDate: Mon Aug 31 20:38:56 2026 +0200

    cleanup stale comments
---
 core/binary_protocol/src/consensus/header.rs                        | 4 +++-
 core/consensus/src/client_table.rs                                  | 6 ++++--
 core/server/src/http/session.rs                                     | 5 ++++-
 foreign/csharp/Iggy_SDK/Vsr/VsrHeader.cs                            | 6 ++++--
 foreign/go/internal/vsr/header.go                                   | 5 ++++-
 .../main/java/org/apache/iggy/client/async/tcp/vsr/VsrHeaders.java  | 6 +++++-
 foreign/node/src/wire/vsr/header.ts                                 | 6 ++++--
 7 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/core/binary_protocol/src/consensus/header.rs b/core/binary_protocol/src/consensus/header.rs
index a9d20ed3c..233396c18 100644
--- a/core/binary_protocol/src/consensus/header.rs
+++ b/core/binary_protocol/src/consensus/header.rs
@@ -287,7 +287,9 @@ pub struct RequestHeader {
     /// catch a `request` number reused for a different operation: a retry that
     /// disagrees with the stamp of the cached reply is refused rather than
     /// answered with the wrong reply. Zero means unstamped, which disables the
-    /// comparison; the wire currently sends zero.
+    /// comparison. The Rust SDK stamps the ops the table dedups; partition and
+    /// non-replicated ops, and the other SDKs, leave it zero. The server
+    /// verifies any nonzero stamp before routing.
     pub request_checksum: u128,
     pub timestamp: u64,
     pub request: u64,
diff --git a/core/consensus/src/client_table.rs b/core/consensus/src/client_table.rs
index 47c1be62f..0737e23bf 100644
--- a/core/consensus/src/client_table.rs
+++ b/core/consensus/src/client_table.rs
@@ -578,8 +578,10 @@ pub struct ClientTable {
 
 /// Whether two integrity stamps for the same request number disagree.
 ///
-/// Zero means unstamped (the wire integrity fields are zeroed today), and an
-/// unstamped side carries no evidence either way, so it never conflicts.
+/// Zero means unstamped, and an unstamped side carries no evidence either way,
+/// so it never conflicts. The Rust SDK stamps the ops this table dedups;
+/// partition ops and the other SDKs still send zero, so a conflict is only ever
+/// detectable between two stamped frames.
 const fn checksums_conflict(stored: u128, received: u128) -> bool {
     stored != 0 && received != 0 && stored != received
 }
diff --git a/core/server/src/http/session.rs b/core/server/src/http/session.rs
index 2e104268d..aa1db608c 100644
--- a/core/server/src/http/session.rs
+++ b/core/server/src/http/session.rs
@@ -99,7 +99,10 @@ pub(in crate::http) struct HttpSession {
     /// Serializes this session's writes: the guarded value is the NEXT request
     /// id. A `tokio::sync::Mutex` because the write path holds it across the
     /// submit `.await` so each session's request numbers reach the primary in
-    /// order and stay gap-free for the depth-1 consensus dedup.
+    /// order. Ordering is what matters, not contiguity: the client table dedups
+    /// on a watermark (see `submit.rs`), so gaps are free but an id overtaken by
+    /// a larger one would arrive at or below the watermark and be refused as a
+    /// duplicate.
     pub(in crate::http) gate: Mutex<u64>,
     /// Next data-plane request id. A separate, gate-free counter: partition ops
     /// are at-least-once with no consensus dedup, so the id only correlates the
diff --git a/foreign/csharp/Iggy_SDK/Vsr/VsrHeader.cs b/foreign/csharp/Iggy_SDK/Vsr/VsrHeader.cs
index 3de62116b..6dce9d3af 100644
--- a/foreign/csharp/Iggy_SDK/Vsr/VsrHeader.cs
+++ b/foreign/csharp/Iggy_SDK/Vsr/VsrHeader.cs
@@ -21,8 +21,10 @@ namespace Apache.Iggy.Vsr;
 
 /// <summary>
 ///     The 256-byte consensus header, read and written by wire offset. Offsets mirror
-///     <c>core/binary_protocol/src/consensus/header.rs</c>. Checksums stay zero: the server does not verify
-///     them for client frames.
+///     <c>core/binary_protocol/src/consensus/header.rs</c>. Checksums stay zero: the frame and body checksums
+///     are not read on the client request path, and <c>request_checksum</c> treats zero as unstamped, which
+///     opts out of the server's payload comparison. Stamping it is optional -- the Rust SDK does so for
+///     deduped operations, this SDK does not yet.
 /// </summary>
 internal static class VsrHeader
 {
diff --git a/foreign/go/internal/vsr/header.go b/foreign/go/internal/vsr/header.go
index 789237efd..93580ff83 100644
--- a/foreign/go/internal/vsr/header.go
+++ b/foreign/go/internal/vsr/header.go
@@ -116,7 +116,10 @@ func (c ClientID) IsZero() bool {
 }
 
 // RequestFields are the header fields a client fills in. The rest of the 256
-// bytes stay zero, including both checksums, which the server does not read.
+// bytes stay zero. The frame and body checksums are not read on the client
+// request path. request_checksum is read, but zero means unstamped and opts out
+// of the server's payload comparison, so leaving it zero is legal; the Rust SDK
+// stamps it for deduped ops, this SDK does not yet.
 type RequestFields struct {
 	// Size is the header plus body total.
 	Size uint32
diff --git a/foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/vsr/VsrHeaders.java b/foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/vsr/VsrHeaders.java
index 35b933ef5..c49244cb0 100644
--- a/foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/vsr/VsrHeaders.java
+++ b/foreign/java/java-sdk/src/main/java/org/apache/iggy/client/async/tcp/vsr/VsrHeaders.java
@@ -26,7 +26,11 @@ import org.apache.iggy.exception.IggyServerException;
  * Byte offsets and readers for the 256-byte consensus headers, mirroring the
  * {@code #[repr(C)]} layouts in
  * {@code core/binary_protocol/src/consensus/header.rs}. All fields are
- * little-endian; the checksum fields stay zero by protocol contract.
+ * little-endian. The checksum fields stay zero by choice, not by protocol
+ * requirement: the frame and body checksums are not read on the client request
+ * path, and {@code request_checksum} treats zero as unstamped, which opts out of
+ * the server's payload comparison. The Rust SDK stamps it for deduped
+ * operations; this SDK does not yet.
  */
 public final class VsrHeaders {
 
diff --git a/foreign/node/src/wire/vsr/header.ts b/foreign/node/src/wire/vsr/header.ts
index d54182c5b..e7128a115 100644
--- a/foreign/node/src/wire/vsr/header.ts
+++ b/foreign/node/src/wire/vsr/header.ts
@@ -113,8 +113,10 @@ const U64_MASK = 0xFFFFFFFFFFFFFFFFn;
 
 /**
  * Encodes a 256-byte request header. Only the six fields the server reads
- * are written; the checksums stay zero, matching the Rust SDK's contract
- * with the VSR server.
+ * are written. The checksums stay zero: the frame and body checksums are not
+ * read on the client request path, and `request_checksum` treats zero as
+ * unstamped, which opts out of the server's payload comparison. Stamping it is
+ * optional -- the Rust SDK does for deduped ops, this SDK does not yet.
  */
 export const encodeRequestHeader = (fields: RequestHeaderFields): Buffer => {
   const header = Buffer.alloc(HEADER_SIZE);