-
Notifications
You must be signed in to change notification settings - Fork 409
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
pagectl: key command for dumping what we know about the key #7890
Conversation
115cbae
to
dc9a884
Compare
3156 tests run: 3017 passed, 0 failed, 139 skipped (full report)Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
804d15b at 2024-05-31T18:27:45.566Z :recycle: |
it doesn't matter if the internals are borrowed or not for the implementation.
make it a type, so that it is explicit and formatting it is easier. add also query methods for relsize and slru dir kind, add a kind_query for "slru segment size".
example: ``` $ cargo run -qp pagectl -- rel-block-to-key --forknum 0 1663 16389 24615 1052204 000000067F00004005000060270000100E2C ```
also adds a ShardStripeSize::default
Oki the auxfilesv2 work is done. |
b9148c9
to
152b76e
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.
Rest LGTM
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 would still prefer taking Key by-value.
Also, maybe we should integrate the output of this command into the alternative debug output, e.g. when encountering errors. But we can do that later as well.
turns out not all of them were by value.
Well.. It seems not all of the current were by-value. What a mess, I'll merge this as it was when you approved it. It is possible I did some mistake, but I am very sure I tried to make only the ones I added as by-value. |
What we know about the key via added `pagectl key $key` command: - debug formatting - shard placement when `--shard-count` is specified - different boolean queries in `key.rs` - aux files v2 Example: ``` $ cargo run -qp pagectl -- key 000000063F00004005000060270000100E2C parsed from hex: 000000063F00004005000060270000100E2C: Key { field1: 0, field2: 1599, field3: 16389, field4: 24615, field5: 0, field6: 1052204 } rel_block: true rel_vm_block: false rel_fsm_block: false slru_block: false inherited: true rel_size: false slru_segment_size: false recognized kind: None ```
The keyspace utils like `is_rel_size_key` or `is_rel_fsm_block_key` and many others are free functions and have to be either imported separately or specified with the full path starting in `pageserver_api::key::`. This is less convenient than if these functions were just inherent impls. Follow-up of #7890 Fixes #6438
What we know about the key via added
pagectl key $key
command:--shard-count
is specifiedkey.rs
Example: