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

zdb: show dedup table and log attributes #16755

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

robn
Copy link
Member

@robn robn commented Nov 14, 2024

[Sponsors: Klara, Inc., Wasabi Technology, Inc.]

Motivation and Context

Commenting on #16752, and realised we didn't have a way to definitely show what kind dedup options are in place.

Description

Extends dump_ddt() to show container config (version, flags) and log flags and other info. A bit more lowlevel detail as befits a debugger.

$ zdb -D tank
DDT-blake3: version=1 [FDT]; flags=0x03 [FLAT LOG]; rootobj=65
DDT-blake3-zap-duplicate: dspace=0xa3400; mspace=0x88000; entries=1888
DDT-blake3-zap-unique: dspace=0x121800; mspace=0x108000; entries=2968
DDT-log-blake3-0: flags=0x01 [FLUSHING]; obj=66; len=0x0; txg=649; entries=0
DDT-log-blake3-1: flags=0x00; obj=67; len=0x160000; txg=657; entries=360
$ zdb -D tank
DDT-blake3: version=0 [LEGACY]; flags=0x00; rootobj=1
DDT-blake3-zap-duplicate: dspace=0x6e800; mspace=0x48000; entries=1824
DDT-blake3-zap-unique: dspace=0xba400; mspace=0x88000; entries=2752

Goes on to show the histograms and etc as it did before, so something for everyone.

How Has This Been Tested?

Just eyeballing on various test dedup configs and load generators I have lying around.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

cmd/zdb/zdb.c Outdated Show resolved Hide resolved
@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Nov 14, 2024
There's interesting info in there that is going to help with
understanding dedup behaviour at any given moment.

Since this is a format change, tests that rely on that output have been
modified to match.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <[email protected]>
Copy link
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

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

As was told in other thread, len, dspace and mspace should still better be decimal.

(u_longlong_t)count,
(u_longlong_t)dspace,
(u_longlong_t)mspace);
(void) printf("%s: dspace=0x%llx; mspace=0x%llx; entries=%llu\n", name,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
(void) printf("%s: dspace=0x%llx; mspace=0x%llx; entries=%llu\n", name,
(void) printf("%s: dspace=%llu; mspace=%llu; entries=%llu\n", name,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Code Review Needed Ready for review and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants