-
Notifications
You must be signed in to change notification settings - Fork 21
CNDB-15807: Add hints about the size of redacted query values #2114
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
Conversation
Add hints about value size when redacting column values in CQL queries printed to logs. No size hints will be included for values smaller than 100 bytes, or for values of fixed-size data types (e.g., int, UUID, timestamp). Size hints are provided in logarithmic buckets (e.g., ">100B", ">1KiB", ">10KiB", ">100KiB") to give a rough indication of data size while maintaining privacy.
Checklist before you submit for review
|
| * @return a redacted string representation, either "?" or "?[size_hint]" | ||
| */ | ||
| public static String redact(@Nullable ByteBuffer bytes, boolean isValueLengthFixed) | ||
| { |
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.
Highly unlikely to have negative value but in case of some weird bug, I would say - let's add some precondition check.
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.
I've added an assertion.
|
The failure of |
|
❌ Build ds-cassandra-pr-gate/PR-2114 rejected by Butler1 regressions found Found 1 new test failures
Found 1 known test failures |
Agreed, let's open a ticket and flag it for @pkolaczk in case it appears also on the release branch. |
ekaterinadimitrova2
left a comment
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.
Looks good to me, thank you.
|
Thanks for the review :)
I've created https://github.com/riptano/cndb/issues/15978. |
…lues (#2114) Add hints about value size when redacting column values in CQL queries printed to logs. No size hints will be included for values smaller than 100 bytes, or for values of fixed-size data types (e.g., int, UUID, timestamp). Size hints are provided in logarithmic buckets (e.g., ">100B", ">1KiB", ">10KiB", ">100KiB") to give a rough indication of data size while maintaining privacy.
…lues (#2114) Add hints about value size when redacting column values in CQL queries printed to logs. No size hints will be included for values smaller than 100 bytes, or for values of fixed-size data types (e.g., int, UUID, timestamp). Size hints are provided in logarithmic buckets (e.g., ">100B", ">1KiB", ">10KiB", ">100KiB") to give a rough indication of data size while maintaining privacy.



What is the issue
Redaction of queried values in CQL queries printed to logs (added by CNDB-15280) benefits privacy and query aggregation,
but it might lose some useful information when analyzing logs. Probably the biggest miss is whether a queried value is large or small.
What does this PR fix and why was it fixed
Add hints about value size when redacting column values in CQL queries printed to logs. No size hints will be included for values smaller than 100 bytes, or for values of fixed-size data types (e.g., int, UUID, timestamp).
Size hints are provided in logarithmic buckets (e.g., ">100B", ">1KiB", ">10KiB", ">100KiB") to give a rough indication of data size while maintaining privacy.