-
Notifications
You must be signed in to change notification settings - Fork 1.9k
When receiving a stream with the large block flag, activate feature #18105
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
Merged
behlendorf
merged 1 commit into
openzfs:master
from
AustinWise:austin/large-block-send-receive
Jan 8, 2026
Merged
Changes from all commits
Commits
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 hidden or 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 hidden or 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 hidden or 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
83 changes: 83 additions & 0 deletions
83
tests/zfs-tests/tests/functional/rsend/send_large_blocks_incremental.ksh
This file contains hidden or 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,83 @@ | ||
| #!/bin/ksh -p | ||
| # SPDX-License-Identifier: CDDL-1.0 | ||
|
|
||
| # | ||
| # 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) 2026 by Austin Wise. All rights reserved. | ||
| # | ||
|
|
||
| . $STF_SUITE/tests/functional/rsend/rsend.kshlib | ||
| . $STF_SUITE/include/properties.shlib | ||
|
|
||
| # | ||
| # Description: | ||
| # Verifies that an incremental receive activates the large block feature when the stream was sent | ||
| # from a dataset whose large block feature was activated. | ||
| # | ||
| # Strategy: | ||
| # 1. Create a dataset with 1MB recordsize. | ||
| # 2. Create a snapshot at where the feature is inactive. | ||
| # 3. Create and delete a large file to activate the large_blocks feature. | ||
| # 4. Create a snapshot where the feature is active. | ||
| # 5. Send the initial snapshot to a second dataset, where the large_blocks feature remains inactive. | ||
| # 6. Send the second snapshot to the dataset incrementally, which should activate the large_blocks feature. | ||
| # | ||
|
|
||
| verify_runnable "both" | ||
|
|
||
| log_assert "Verify incremental receive handles inactive large_blocks feature correctly." | ||
|
|
||
| function cleanup | ||
| { | ||
| cleanup_pool $POOL | ||
| cleanup_pool $POOL2 | ||
| } | ||
| log_onexit cleanup | ||
|
|
||
| function assert_feature_state { | ||
| typeset pool=$1 | ||
| typeset expected_state=$2 | ||
|
|
||
| typeset actual_state=$(zpool get -H -o value feature@large_blocks $pool) | ||
| log_note "Zpool $pool feature@large_blocks=$actual_state" | ||
| if [[ "$actual_state" != "$expected_state" ]]; then | ||
| log_fail "pool $pool feature@large_blocks=$actual_state (expected '$expected_state')" | ||
| fi | ||
| } | ||
|
|
||
| typeset srcfs=$POOL/src | ||
| typeset destfs=$POOL2/dest | ||
|
|
||
| # Create a dataset with a large recordsize (1MB) where the feature is inactive in the initial snapshot | ||
| # but active in a later snapshots. | ||
| log_must zfs create -o recordsize=1M $srcfs | ||
| typeset mntpnt=$(get_prop mountpoint $srcfs) | ||
| log_must zfs snapshot $srcfs@feature-inactive | ||
| log_must dd if=/dev/urandom of=$mntpnt/big.bin bs=1M count=1 | ||
| log_must zpool sync $POOL | ||
| log_must rm $mntpnt/big.bin | ||
| log_must zfs snapshot $srcfs@feature-active | ||
|
|
||
| # Assert initial state of pools | ||
| assert_feature_state $POOL "active" | ||
| assert_feature_state $POOL2 "enabled" | ||
|
|
||
| # Initial send does not activate feature. | ||
| log_must eval "zfs send -p -L $srcfs@feature-inactive | zfs receive $destfs" | ||
| assert_feature_state $POOL2 "enabled" | ||
|
|
||
| # Incremental send activates feature. | ||
| log_must eval "zfs send -L -i $srcfs@feature-inactive $srcfs@feature-active | zfs receive $destfs" | ||
| assert_feature_state $POOL2 "active" | ||
|
|
||
| log_pass "Feature activation propagated successfully." |
86 changes: 86 additions & 0 deletions
86
tests/zfs-tests/tests/functional/rsend/send_large_blocks_initial.ksh
This file contains hidden or 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,86 @@ | ||
| #!/bin/ksh -p | ||
| # SPDX-License-Identifier: CDDL-1.0 | ||
|
|
||
| # | ||
| # 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) 2026 by Austin Wise. All rights reserved. | ||
| # | ||
|
|
||
| . $STF_SUITE/tests/functional/rsend/rsend.kshlib | ||
| . $STF_SUITE/include/properties.shlib | ||
|
|
||
| # | ||
| # Description: | ||
| # Verifies that creating a dataset from a send stream propagates the activation of the large blocks | ||
| # feature, even if the send stream contains no large blocks. | ||
| # Regression test for https://github.com/openzfs/zfs/issues/18101 | ||
| # | ||
| # Strategy: | ||
| # 1. Create a dataset with 1MB recordsize. | ||
| # 2. Create and delete a large file to activate the large_blocks feature. | ||
| # 3. Send a full stream to a second dataset. | ||
| # 4. Send an incremental send back to the original dataset. | ||
| # | ||
|
|
||
| verify_runnable "both" | ||
|
|
||
| log_assert "Verify incremental receive handles inactive large_blocks feature correctly." | ||
|
|
||
| function cleanup | ||
| { | ||
| cleanup_pool $POOL | ||
| cleanup_pool $POOL2 | ||
| } | ||
| log_onexit cleanup | ||
|
|
||
| function assert_feature_state { | ||
| typeset pool=$1 | ||
| typeset expected_state=$2 | ||
|
|
||
| typeset actual_state=$(zpool get -H -o value feature@large_blocks $pool) | ||
| log_note "Zpool $pool feature@large_blocks=$actual_state" | ||
| if [[ "$actual_state" != "$expected_state" ]]; then | ||
| log_fail "pool $pool feature@large_blocks=$actual_state (expected '$expected_state')" | ||
| fi | ||
| } | ||
|
|
||
| typeset repro=$POOL/repro | ||
| typeset second=$POOL2/second | ||
|
|
||
| # Create a dataset with a large recordsize (1MB) | ||
| log_must zfs create -o recordsize=1M $repro | ||
| typeset mntpnt=$(get_prop mountpoint $repro) | ||
|
|
||
| # Activate the large_blocks feature by creating a large file, then delete it | ||
| # This leaves the feature 'active' on the dataset level even though large blocks no longer exist. | ||
| log_must dd if=/dev/urandom of=$mntpnt/big.bin bs=1M count=1 | ||
| log_must zpool sync $POOL | ||
| log_must rm $mntpnt/big.bin | ||
|
|
||
| # Assert initial state of pools | ||
| assert_feature_state $POOL "active" | ||
| assert_feature_state $POOL2 "enabled" | ||
|
|
||
| # Create initial snapshot and send to 'second' dataset. | ||
| # The send stream will have the large blocks feature flag active but not actually contain any large blocks. | ||
| log_must zfs snapshot $repro@initial | ||
| log_must eval "zfs send -p -L $repro@initial | zfs receive $second" | ||
| assert_feature_state $POOL2 "active" | ||
|
|
||
| # Send an incremental stream back to the original dataset. | ||
| # The send stream should have the large_blocks feature flag despite no large blocks ever being | ||
| # born in the 'second' dataset. | ||
| log_must zfs snapshot $second@second | ||
| log_must eval "zfs send -L -i $second@initial $second@second | zfs receive -F $repro" | ||
|
|
||
| log_pass "Feature activation propagated successfully." | ||
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.
Uh oh!
There was an error while loading. Please reload this page.