-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Handle interaction between gang blocks, copies, and FDT. #17123
Open
pcd1193182
wants to merge
3
commits into
openzfs:master
Choose a base branch
from
pcd1193182:gang_ddt_copies
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
tests/zfs-tests/tests/functional/gang_blocks/gang_blocks_ddt_copies.ksh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/bin/ksh | ||
# | ||
# This file and its contents are supplied under the terms of the | ||
# Common Development and Distribution License ("CDDL"), version 1.0. | ||
# You may only use this file in accordance with the terms of version | ||
# 1.0 of the CDDL. | ||
# | ||
# A full copy of the text of the CDDL should have accompanied this | ||
# source. A copy of the CDDL is also available via the Internet at | ||
# http://www.illumos.org/license/CDDL. | ||
# | ||
|
||
# | ||
# Copyright (c) 2025 by Klara Inc. | ||
# | ||
|
||
# | ||
# Description: | ||
# Verify that mixed gang blocks and copies interact correctly in FDT | ||
# | ||
# Strategy: | ||
# 1. Store a block with copies = 1 in the DDT unganged. | ||
# 2. Add a new entry with copies = 2 that gangs, ensure it doesn't panic | ||
# 3. Store a block with copies = 1 in the DDT ganged. | ||
# 4. Add a new entry with copies = 3 that doesn't gang, ensure that it doesn't panic. | ||
# | ||
|
||
. $STF_SUITE/include/libtest.shlib | ||
. $STF_SUITE/tests/functional/gang_blocks/gang_blocks.kshlib | ||
|
||
log_assert "Verify that mixed gang blocks and copies interact correctly in FDT" | ||
|
||
save_tunable DEDUP_LOG_TXG_MAX | ||
|
||
function cleanup2 | ||
{ | ||
zfs destroy $TESTPOOL/fs1 | ||
zfs destroy $TESTPOOL/fs2 | ||
restore_tunable DEDUP_LOG_TXG_MAX | ||
cleanup | ||
} | ||
|
||
preamble | ||
log_onexit cleanup2 | ||
|
||
log_must zpool create -f -o ashift=9 -o feature@block_cloning=disabled $TESTPOOL $DISKS | ||
log_must zfs create -o recordsize=64k -o dedup=on $TESTPOOL/fs1 | ||
log_must zfs create -o recordsize=64k -o dedup=on -o copies=3 $TESTPOOL/fs2 | ||
set_tunable32 DEDUP_LOG_TXG_MAX 1 | ||
log_must dd if=/dev/urandom of=/$TESTPOOL/fs1/f1 bs=64k count=1 | ||
log_must sync_pool $TESTPOOL | ||
set_tunable32 METASLAB_FORCE_GANGING 20000 | ||
set_tunable32 METASLAB_FORCE_GANGING_PCT 100 | ||
log_must dd if=/$TESTPOOL/fs1/f1 of=/$TESTPOOL/fs2/f1 bs=64k count=1 | ||
log_must sync_pool $TESTPOOL | ||
|
||
log_must rm /$TESTPOOL/fs*/f1 | ||
log_must sync_pool $TESTPOOL | ||
log_must dd if=/dev/urandom of=/$TESTPOOL/fs1/f1 bs=64k count=1 | ||
log_must sync_pool $TESTPOOL | ||
log_must zdb -D $TESTPOOL | ||
set_tunable32 METASLAB_FORCE_GANGING_PCT 0 | ||
log_must dd if=/$TESTPOOL/fs1/f1 of=/$TESTPOOL/fs2/f1 bs=64k count=1 | ||
log_must sync_pool $TESTPOOL | ||
|
||
log_must rm /$TESTPOOL/fs*/f1 | ||
log_must sync_pool $TESTPOOL | ||
set_tunable32 METASLAB_FORCE_GANGING_PCT 50 | ||
set_tunable32 METASLAB_FORCE_GANGING 40000 | ||
log_must dd if=/dev/urandom of=/$TESTPOOL/f1 bs=64k count=1 | ||
for i in `seq 1 16`; do | ||
log_must cp /$TESTPOOL/f1 /$TESTPOOL/fs2/f1 | ||
log_must cp /$TESTPOOL/f1 /$TESTPOOL/fs1/f1 | ||
log_must sync_pool $TESTPOOL | ||
log_must zdb -D $TESTPOOL | ||
done | ||
|
||
log_pass "Verify that mixed gang blocks and copies interact correctly in FDT" |
Oops, something went wrong.
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.
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.
nit: we should technically
save_tunable/restore_tunable
these two params as well.