-
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
lease: unredact lease struct #138800
lease: unredact lease struct #138800
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. |
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.
Oh nice find!
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 @aa-joshi)
pkg/sql/catalog/lease/descriptor_version_state.go
line 39 at r1 (raw file):
// SafeFormat implements redact.SafeFormatter. func (s storedLease) SafeFormat(w redact.SafePrinter, _ rune) {
could you say more about how this fixes it? i did a quick search in the code, and we seem to use the pointer type mostly. also i see above that the String()
method uses a pointer receiver.
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 @rafiss)
pkg/sql/catalog/lease/descriptor_version_state.go
line 39 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
could you say more about how this fixes it? i did a quick search in the code, and we seem to use the pointer type mostly. also i see above that the
String()
method uses a pointer receiver.
When we are printing the arguments, we are validating the SafeFormat method on object type. Previously, it couldn't find the method. Hence it was getting redacted.
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 @aa-joshi)
pkg/sql/catalog/lease/descriptor_version_state.go
line 39 at r1 (raw file):
Previously, aa-joshi (Akshay Joshi) wrote…
When we are printing the arguments, we are validating the SafeFormat method on object type. Previously, it couldn't find the method. Hence it was getting redacted.
Right, but what I am saying is that in all the code I have found, we use the type *storedLease
. Can you link me to an area of the code that uses the type storedLease
?
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 @rafiss)
pkg/sql/catalog/lease/descriptor_version_state.go
line 39 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
Right, but what I am saying is that in all the code I have found, we use the type
*storedLease
. Can you link me to an area of the code that uses the typestoredLease
?
Apologies, I misunderstood. Here it is:
cockroach/pkg/sql/catalog/lease/lease.go
Line 2225 in c8a1890
log.Infof(ctx, "released orphaned lease: %+v", lease) |
It was flagged by support team as overly redacted info.
Previously, ID from lease was getting redacted in logs. This was creating challenge to support team to debug issues. This change makes sure that SafeFormat is getting invoked during logging. Epic: CRDB-37533 Part of: CRDB-44885 Release note: None
a6ea46d
to
019a20f
Compare
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 @rafiss)
pkg/sql/catalog/lease/descriptor_version_state.go
line 39 at r1 (raw file):
Previously, aa-joshi (Akshay Joshi) wrote…
Apologies, I misunderstood. Here it is:
cockroach/pkg/sql/catalog/lease/lease.go
Line 2225 in c8a1890
log.Infof(ctx, "released orphaned lease: %+v", lease)
It was flagged by support team as overly redacted info.
I have updated to pointer as it makes more sense to have it as pointer.
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.
nice find!
would we want to backport this change? seems like it might help with supportability.
Reviewable status: complete! 0 of 0 LGTMs obtained
TFTR! |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from 019a20f to blathers/backport-release-23.2-138800: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 23.2.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Previously, ID from lease was getting redacted in logs. This was creating challenge to support team to debug issues. This change makes sure that SafeFormat is getting invoked during logging.
Epic: CRDB-37533
Part of: CRDB-44885
Release note: None