Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: don't log for missing locality #122283

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pkg/kv/kvpb/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2873,9 +2873,10 @@ message Header {
// current batch. When set, it allows the server to handle pushes and write
// too old conditions locally.
bool can_forward_read_timestamp = 16;
// gateway_node_id is the ID of the gateway node where the request originated.
// For requests from tenants, this is set to the NodeID of the KV node handling
// the BatchRequest.
// gateway_node_id is the ID of the gateway node where the request
// originated. For requests from a shared-process cluster, this is set to the
// NodeID of the KV node which created the BatchRequest. For requests from a
// separate-process SQL Pod or a CLI, this is set to 0.
int32 gateway_node_id = 11 [(gogoproto.customname) = "GatewayNodeID",
(gogoproto.casttype) = "github.com/cockroachdb/cockroach/pkg/roachpb.NodeID"];
// client_range_info represents the kvclient's knowledge about the state of
Expand Down
6 changes: 6 additions & 0 deletions pkg/server/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,12 @@ func (n *Node) getLocalityComparison(
return roachpb.LocalityComparisonType_UNDEFINED
}

// In separate-process multi-tenant mode the gatewayNodeID is 0.
if gatewayNodeID == 0 {
if _, ok := roachpb.ClientTenantFromContext(ctx); ok {
return roachpb.LocalityComparisonType_UNDEFINED
}
}
gatewayNodeDesc, err := gossip.GetNodeDescriptor(gatewayNodeID)
if err != nil {
log.VInfof(ctx, 2,
Expand Down
Loading