Skip to content

Commit

Permalink
tests/block_cloning: try harder to stay on same txg in fallback test
Browse files Browse the repository at this point in the history
We've observed this test failing intermittently. When it does, the
"same block" check shows that both files have the same content, that is,
the file was cloned.

The only way this could have happened is if the open txg moved between
the dd and clonefile calls. That's possible because although we set
zfs_txg_timeout to be large, that only affects the wait time in the sync
thread at the start of a new txg; it doesn't change anything if its
currently waiting or working.

So here we just force the txgs to move immediately before, which should
get both operations onto the same txg as intented.

Sponsored-By: OpenDrives Inc.
Sponsored-By: Klara Inc.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rob Norris Rob Norris <[email protected]>
Closes openzfs#15303
  • Loading branch information
robn authored Sep 22, 2023
1 parent b53077a commit 2dc89b9
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ log_onexit cleanup
log_must zpool create -o feature@block_cloning=enabled $TESTPOOL $DISKS

log_must set_tunable64 TXG_TIMEOUT 5000
log_must sync_pool $TESTPOOL true

log_must dd if=/dev/urandom of=/$TESTPOOL/file bs=128K count=4
log_must clonefile -f /$TESTPOOL/file /$TESTPOOL/clone 0 0 524288
Expand Down

0 comments on commit 2dc89b9

Please sign in to comment.