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

cli: debug decode-key to support base64 #78158

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

aliher1911
Copy link
Contributor

@aliher1911 aliher1911 commented Mar 20, 2022

Previously decode-key supported hex encoded keys. When using json serialization of descriptors and recovery plans you need to decode keys that are base64 encoded.
This patch adds flag to select key encoding format.
The default mode stays the same so any existing tooling willwork as expected.

Release note: None

@aliher1911 aliher1911 requested a review from erikgrinaker March 20, 2022 19:05
@aliher1911 aliher1911 requested review from a team as code owners March 20, 2022 19:05
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@aliher1911 aliher1911 self-assigned this Mar 21, 2022
Copy link
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remind me how this works, what's an example of a non-MVCC key? I thought we used an MVCC timestamp of zero for such keys, and could treat them as MVCC keys that way. I'm sure that's not right given this PR but apparently I am in need of a refresher.

@aliher1911 aliher1911 force-pushed the debug_keys_decode_base65 branch from b713489 to 7e85fbc Compare March 21, 2022 09:31
@aliher1911
Copy link
Contributor Author

You are correct about mvcc having 0 timestamp for non mvcc keys. I was getting an error before, but it looks like it was because of some corrupted key itself. I just retested that and it indeed just adds ,0 suffix when I give it range keys.
So I removed mvcc flag.

pkg/cli/debug.go Outdated Show resolved Hide resolved
@aliher1911 aliher1911 force-pushed the debug_keys_decode_base65 branch 2 times, most recently from b01986a to 51d5c94 Compare March 22, 2022 18:41
Previously decode-key supported hex encoded keys. When using
json serialization of descriptors and recovery plans you need
to decode keys that are base64 encoded.
This patch adds flag to select key encoding format.
The default mode stays the same so any existing tooling will
work as expected.

Release note: None
@aliher1911 aliher1911 force-pushed the debug_keys_decode_base65 branch from 51d5c94 to 87610fe Compare March 23, 2022 11:36
@aliher1911
Copy link
Contributor Author

bors r=tbg,erikgrinaker

@craig
Copy link
Contributor

craig bot commented Mar 23, 2022

Build succeeded:

@craig craig bot merged commit 4eca06c into cockroachdb:master Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants