-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
server: don't log for missing locality #122283
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
This logging was quite annoying and useless on requests from sql pods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @andrewbaptist)
pkg/server/node.go
line 1566 at r1 (raw file):
// We can't lookup the locality of SQL gateway nodes for cross locality // metrics, ignore them. if gatewayNodeID == 0 {
When do we expect this to be 0? The comment at:
cockroach/pkg/kv/kvpb/api.proto
Lines 2876 to 2879 in 5cb2264
// 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. | |
int32 gateway_node_id = 11 [(gogoproto.customname) = "GatewayNodeID", |
would indicate it's set for all requests, including ones from SQL tenants. But evidently that's not the case -- so is this case unexpected to you?
pkg/server/node.go
line 1572 at r1 (raw file):
if err != nil { log.VInfof(ctx, 2, "failed to perform look up for node descriptor %v", err)
Should we be just deleting this log line instead of adding that extra if condition above?
Interesting, I hadn't noticed the comment on and as that commit suggests it is only available in shared process multi-tenancy not in separate-process |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just not log anything for separate process pods - we know that we are in such setup when GatewayNodeID
is 0 and roachpb.ClientTenantFromContext
returns ok=true
.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @andrewbaptist and @arulajmani)
Previously we would always log a message that the locality was unknown for requests from sql gateways. We should remove unnecessary logs from traces. Epic: none Release note: None
f57a032
to
aa89e09
Compare
I updated the comment in api.proto as well to make this consistent. I agree it is worth logging in the case of a request that should have set it as it may help debugging. Can you validate my change to the comment as well as the check that is now in place. I'm not 100% sure about whether a CLI will cause logging, but either way it is not overly important to suppress it in that case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @andrewbaptist and @arulajmani)
bors r=yuzefovich TFTR! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @andrewbaptist)
pkg/kv/kvpb/api.proto
line 2879 at r2 (raw file):
// 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.
Thanks for capturing this here.
Previously we would always log a message that the locality was unknown for requests from sql gateways. We should remove unnecessary logs from traces.
Epic: none
Release note: None