Skip to content

Commit ca67da4

Browse files
committed
kgo: fix batch coordinator fetching
v1.10.0 introduced batch coordinator fetching, but had a bug: when fetching many coordinators in a batch, we would not use the proper NodeID (we would use the top level NodeID, not the per-coordinator NodeID). This worked for non-batch coordinator fetching because we mirrored the first coordinator to the top level response, if the request/response was batched.
1 parent c6f7f9a commit ca67da4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/kgo/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,12 +1229,12 @@ func (cl *Client) loadCoordinators(ctx context.Context, typ int8, keys ...string
12291229
}
12301230
}
12311231
} else {
1232-
resp, _ := shard.Resp.(*kmsg.FindCoordinatorResponse)
1232+
resp := shard.Resp.(*kmsg.FindCoordinatorResponse)
12331233
for _, rc := range resp.Coordinators {
12341234
c, ok := key2load[rc.Key]
12351235
if ok {
12361236
c.err = kerr.ErrorForCode(rc.ErrorCode)
1237-
c.node = resp.NodeID
1237+
c.node = rc.NodeID
12381238
}
12391239
}
12401240
}

0 commit comments

Comments
 (0)