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

Add more DDT tests #17049

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add more DDT tests #17049

wants to merge 2 commits into from

Conversation

pcd1193182
Copy link
Contributor

Motivation and Context

The new Fast Dedup feature has a lot of moving parts, and only some of them have tests. We have some tests for prefetch and quota, and a generic ZAP shrinking test, but we don't have anything for the pruning command or specific to DDT zap shrinking. We also don't have anything for the dedup log, but I added a test for that in #17038 .

Description

We add a couple small new tests for zpool ddtprune and DDT-specific ZAP shrinking.

How Has This Been Tested?

Ran the ZTS with the new tests, they passed

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:

Paul Dagnelie added 2 commits February 12, 2025 09:10
Signed-off-by: Paul Dagnelie <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Comment on lines +45 to +47
# we set the dedup log txg interval to 1, to get a log flush every txg,
# effectively disabling the log. without this it's hard to predict when and
# where things appear on-disk
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# we set the dedup log txg interval to 1, to get a log flush every txg,
# effectively disabling the log. without this it's hard to predict when and
# where things appear on-disk
# We set the dedup log txg interval to 1, to get a log flush every txg,
# effectively disabling the log. Without this it's hard to predict when the
# entries appear in DDT ZAP

And the same in the other test.


log_must zpool create -f -o feature@block_cloning=disabled $TESTPOOL $DISKS

log_must zfs create -o recordsize=512 -o xattr=sa -o dedup=on $TESTPOOL/$TESTFS
Copy link
Member

Choose a reason for hiding this comment

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

Why do we care about xattr=sa here?


log_must truncate -s 128k $mountpoint/f2
sync_pool $TESTPOOL
sleep 1
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this sleep 1?

log_onexit cleanup

log_must create_pool $TESTPOOL $DISKS
log_must zfs create -o dedup=on -o recordsize=512 $TESTPOOL/$TESTFS
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
log_must zfs create -o dedup=on -o recordsize=512 $TESTPOOL/$TESTFS
log_must zfs create -o dedup=sha256 -o recordsize=512 $TESTPOOL/$TESTFS

It seems below you depend on the algorithm.

nleafs=$(zdb -dddd $TESTPOOL "$zap_obj" | grep "Leaf blocks:" | awk -F\: '{print($2);}')
log_must test $nleafs -lt $nleafs_old

log_pass "ZAP object shrank after rmeoving entries."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
log_pass "ZAP object shrank after rmeoving entries."
log_pass "ZAP object shrank after removing entries."

@amotin amotin added the Status: Code Review Needed Ready for review and testing label Feb 20, 2025
@amotin
Copy link
Member

amotin commented Feb 20, 2025

And please squash the commits and write some commit message.

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.

2 participants