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

pagectl: key command for dumping what we know about the key #7890

Merged
merged 29 commits into from
May 31, 2024

Conversation

koivunej
Copy link
Member

@koivunej koivunej commented May 27, 2024

What we know about the key via added pagectl key $key command:

  • its debug formatting (helpful in cases of on-demand slru download key not found)
  • its sharding 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

@koivunej koivunej requested a review from a team as a code owner May 27, 2024 11:37
@koivunej koivunej requested a review from VladLazar May 27, 2024 11:37
Copy link

github-actions bot commented May 27, 2024

3156 tests run: 3017 passed, 0 failed, 139 skipped (full report)


Flaky tests (1)

Postgres 15

  • test_pageserver_restarts_under_worload: release

Code coverage* (full report)

  • functions: 31.4% (6531 of 20791 functions)
  • lines: 48.3% (50403 of 104250 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
804d15b at 2024-05-31T18:27:45.566Z :recycle:

pageserver/ctl/src/main.rs Outdated Show resolved Hide resolved
pageserver/ctl/src/main.rs Outdated Show resolved Hide resolved
@koivunej
Copy link
Member Author

Oki the auxfilesv2 work is done.

Copy link
Member

@skyzh skyzh left a comment

Choose a reason for hiding this comment

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

Rest LGTM

pageserver/ctl/src/key.rs Show resolved Hide resolved
Copy link
Member

@arpad-m arpad-m left a 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.

@koivunej
Copy link
Member Author

@arpad-m sorry I almost forgot, did the change even though I disliked it :) 672f9cc

@koivunej koivunej enabled auto-merge (squash) May 31, 2024 16:43
turns out not all of them were by value.
@koivunej
Copy link
Member Author

koivunej commented May 31, 2024

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.

@koivunej koivunej merged commit ef83f31 into main May 31, 2024
59 of 60 checks passed
@koivunej koivunej deleted the joonas/pagectl_key branch May 31, 2024 18:19
a-masterov pushed a commit that referenced this pull request Jun 3, 2024
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
```
arpad-m added a commit that referenced this pull request Jun 3, 2024
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
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