zdb: dump ZAP_FLAG_UINT64_KEY
ZAPs properly
#16334
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Sponsors: Klara, Inc., Wasabi Technology, Inc.]
Motivation and Context
I was using zdb to look around my local pool, and it kept crashing on this very strange ZAP that made no sense to me. Turns out it was the BRT ZAP, which has binary keys rather than text keys, and zdb had no idea what to make of that.
Description
Detect
ZAP_FLAG_UINT64_KEY
ZAPs indump_zap()
. If seen, synthesize a text "key" from the first uint64, and show the value using the same "array of integers" code used elsewhere.This is not especially useful for keys longer than one uint64 (eg DDT keys, which are 40 bytes), but that's sorta difficult to make a generic display for and zdb already has structured formatters for dedup and block reference tables, so not super useful anyway. Really, I just wanted something useful and not-crashy.
How Has This Been Tested?
Hand tested on Linux and FreeBSD.
Types of changes
Checklist:
Signed-off-by
.