-
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
When receiving a stream with the large block flag, activate feature #18105
Conversation
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.
Pull request overview
This PR fixes issue #18101 where incremental ZFS send/receive operations can fail with a large_blocks feature mismatch error. The solution automatically activates the large_blocks feature on the destination dataset when receiving a stream that has the large block feature flag set, ensuring feature consistency between source and destination datasets.
Key Changes
- Modified
dmu_recv_begin_sync()to activate thelarge_blocksfeature on the destination dataset when receiving streams with theDMU_BACKUP_FEATURE_LARGE_BLOCKSflag - Added two new test cases to verify the feature activation works correctly for both full and incremental sends
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
module/zfs/dmu_recv.c |
Adds logic to activate the large_blocks feature on the destination dataset during receive operations, following the same pattern as the existing longname feature activation |
tests/zfs-tests/tests/functional/rsend/send_large_blocks_inital.ksh |
New test verifying that full send streams propagate large_blocks feature activation even when no large blocks are present |
tests/zfs-tests/tests/functional/rsend/send_large_blocks_incremental.ksh |
New test verifying that incremental sends activate the large_blocks feature when the source dataset has it activated |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tests/zfs-tests/tests/functional/rsend/send_large_blocks_inital.ksh
Outdated
Show resolved
Hide resolved
d49befb to
b44313e
Compare
amotin
left a comment
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.
While the actual change makes sense to me, please take a look on the AI comment about the test name, and also you should probably add the tests into Makefile.am and runfiles. Also I wonder why have you inserted the feature activation at the end? I would do it earlier, considering the flag was introduced earlier that longname.
b44313e to
3af961c
Compare
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.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Thanks, I addressed the misspelling of the test case and added the new test to the runfile an Makefile.am. I moved the activation of large block feature above the long name feature as requested. I also extended the comment to explain why the feature activation is needed. |
ZFS send streams include a feature flag DMU_BACKUP_FEATURE_LARGE_BLOCKS to indicate the presence of large blocks in the dataset. On the sending side, this flag is included if the `-L` flag is passed to `zfs send` and the feature is active in the dataset. On the receive side, the stream is refused if the feature is active in the destination dataset but the stream does not include the feature flag. The problem is the feature is only activated when a large block is born. If a large block has been born in the destination, but never the source, the send can't work. This can arise when sending streams back and forth between two datasets. This commit fixes the problem by always activating the large blocks feature when receiving a stream with the large block feature flag. Signed-off-by: Austin Wise <[email protected]>
3af961c to
ea29048
Compare
Motivation and Context
When sending snapshots back and forth between two datasets, it is currently possible to end up in a state where a receive fails with this error message:
Adding the
-Lflag to thezfs senddoes not fix the problem.See issue #18101 for details.
Description
When receiving a stream with the large block feature flag, activate the
large_blocksfeature in the destination dataset.I think this is a reasonable way to solve the problem I'm having for a number of reasons:
-Lor--raw.How Has This Been Tested?
Some new tests have been included in this PR. They fail when run on
mastercurrently and pass on this PR. They test that both full sends and incremental sends cause the large blocks feature to be activated in the destination dataset.I ran these tests on Ubuntu 24.04, with kernel 6.14.0-37.
Types of changes
Checklist:
Signed-off-by.