You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by hg...@apache.org on 2026/09/14 17:32:46 UTC

(iggy) branch server_perf_cut_extra_work updated: fix(sdk): synchronize offset routing command tables

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

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


The following commit(s) were added to refs/heads/server_perf_cut_extra_work by this push:
     new 1e4a01df7 fix(sdk): synchronize offset routing command tables
1e4a01df7 is described below

commit 1e4a01df78d6e27df8a547d65869145d42ee6e99
Author: Hubert Gruszecki <h....@gmail.com>
AuthorDate: Mon Sep 14 19:30:03 2026 +0200

    fix(sdk): synchronize offset routing command tables
    
    Command 123 was missing from the foreign SDK registries, breaking
    Node, Go and C# protocol parity checks. Synchronize the tables and
    cover both omitted Rust codes with a registry completeness assertion.
    
    Go's I/O deadline can expire before context cancellation is visible.
    Return the caller's deadline error instead of a transient status in
    that window, keeping the existing timeout regression assertion.
---
 core/binary_protocol/src/codes.rs             | 7 +++++++
 foreign/csharp/Iggy_SDK/Utils/CommandCodes.cs | 1 +
 foreign/go/client/tcp/tcp_core.go             | 4 ++++
 foreign/go/internal/command/code.go           | 1 +
 foreign/node/src/wire/command.code.ts         | 1 +
 5 files changed, 14 insertions(+)

diff --git a/core/binary_protocol/src/codes.rs b/core/binary_protocol/src/codes.rs
index 5ff1a308e..3a21e1f6a 100644
--- a/core/binary_protocol/src/codes.rs
+++ b/core/binary_protocol/src/codes.rs
@@ -117,6 +117,7 @@ mod tests {
         GET_STATS_CODE,
         GET_SNAPSHOT_FILE_CODE,
         GET_CLUSTER_METADATA_CODE,
+        DESCRIBE_OPTIONS_CODE,
         ATTACH_CONSUMER_SESSION_CODE,
         GET_ME_CODE,
         GET_CLIENT_CODE,
@@ -144,6 +145,7 @@ mod tests {
         GET_CONSUMER_OFFSET_CODE,
         STORE_CONSUMER_OFFSET_CODE,
         DELETE_CONSUMER_OFFSET_CODE,
+        GET_CONSUMER_OFFSET_ROUTING_CODE,
         GET_STREAM_CODE,
         GET_STREAMS_CODE,
         CREATE_STREAM_CODE,
@@ -170,6 +172,11 @@ mod tests {
 
     #[test]
     fn every_code_has_a_name() {
+        assert_eq!(
+            ALL_CODES.len(),
+            crate::dispatch::COMMAND_TABLE.len(),
+            "command-code tests must cover the complete dispatch registry"
+        );
         for &code in ALL_CODES {
             assert!(
                 command_name(code).is_ok(),
diff --git a/foreign/csharp/Iggy_SDK/Utils/CommandCodes.cs b/foreign/csharp/Iggy_SDK/Utils/CommandCodes.cs
index c33b7dd73..5ee64533e 100644
--- a/foreign/csharp/Iggy_SDK/Utils/CommandCodes.cs
+++ b/foreign/csharp/Iggy_SDK/Utils/CommandCodes.cs
@@ -51,6 +51,7 @@ internal static class CommandCodes
     internal const int GET_CONSUMER_OFFSET_CODE = 120;
     internal const int STORE_CONSUMER_OFFSET_CODE = 121;
     internal const int DELETE_CONSUMER_OFFSET_CODE = 122;
+    internal const int GET_CONSUMER_OFFSET_ROUTING_CODE = 123;
     internal const int GET_STREAM_CODE = 200;
     internal const int GET_STREAMS_CODE = 201;
     internal const int CREATE_STREAM_CODE = 202;
diff --git a/foreign/go/client/tcp/tcp_core.go b/foreign/go/client/tcp/tcp_core.go
index ed1708951..8ae2ccf79 100644
--- a/foreign/go/client/tcp/tcp_core.go
+++ b/foreign/go/client/tcp/tcp_core.go
@@ -841,6 +841,10 @@ func (c *IggyTcpClient) attempt(
 		if ctxErr := ctx.Err(); ctxErr != nil {
 			return nil, stamped, generation, ctxErr
 		}
+		// The I/O deadline can fire before the context's cancellation callback.
+		if deadline, ok := ctx.Deadline(); ok && !time.Now().Before(deadline) {
+			return nil, stamped, generation, context.DeadlineExceeded
+		}
 	}
 	return response, stamped, generation, err
 }
diff --git a/foreign/go/internal/command/code.go b/foreign/go/internal/command/code.go
index 36fd9ad2f..39e0ccd91 100644
--- a/foreign/go/internal/command/code.go
+++ b/foreign/go/internal/command/code.go
@@ -51,6 +51,7 @@ const (
 	GetOffsetCode             Code = 120
 	StoreOffsetCode           Code = 121
 	DeleteConsumerOffsetCode  Code = 122
+	GetOffsetRoutingCode      Code = 123
 	GetStreamCode             Code = 200
 	GetStreamsCode            Code = 201
 	CreateStreamCode          Code = 202
diff --git a/foreign/node/src/wire/command.code.ts b/foreign/node/src/wire/command.code.ts
index 2c8e1c0e5..9af84711f 100644
--- a/foreign/node/src/wire/command.code.ts
+++ b/foreign/node/src/wire/command.code.ts
@@ -50,6 +50,7 @@ export const COMMAND_CODE = {
   GetOffset: 120,
   StoreOffset: 121,
   DeleteConsumerOffset: 122,
+  GetConsumerOffsetRouting: 123,
   GetStream: 200,
   GetStreams: 201,
   CreateStream: 202,