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

ZTS: Fix zpool_import_hostid_changed_unclean_export #16578

Conversation

behlendorf
Copy link
Contributor

Motivation and Context

Apply the same fix from #16570 to this similar test case.

https://github.com/openzfs/zfs/actions/runs/11074121440/job/30772504124

   Test (Linux): /usr/share/zfs/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_hostid_changed_unclean_export (run as root) [00:00] [FAIL]
  21:53:15.14 SUCCESS: zgenhostid -f 01234567
  21:53:15.25 SUCCESS: zpool create testpool1 /var/tmp/dev_import-test/disk0
  21:53:15.27 SUCCESS: cp /var/tmp/dev_import-test/disk0 /var/tmp/dev_import-test/disk0.bak
  21:53:15.31 SUCCESS: zpool export testpool1
  21:53:15.32 SUCCESS: cp -f /var/tmp/dev_import-test/disk0.bak /var/tmp/dev_import-test/disk0
  21:53:15.32 SUCCESS: rm -f /var/tmp/dev_import-test/disk0.bak
  21:53:15.33 SUCCESS: zgenhostid -f 89abcdef
  21:53:15.36 SUCCESS: zpool import -d /var/tmp/dev_import-test testpool1 exited 1
  21:53:15.46 	Recovery is possible, but will result in some data loss.
  21:53:15.46 	Returning the pool to its state as of Fri Sep 27 21:53:15 2024
  21:53:15.46 	should correct the problem.  Recovery can be attempted
  21:53:15.46 	by executing 'zpool import -F testpool1'.  A scrub of the pool
  21:53:15.46 	is strongly recommended after recovery.
  21:53:15.46 cannot import 'testpool1': I/O error

Description

Update the test case to freeze the pool then export it to better simulate a hard failure. This is preferable to copying the vdev while the pool's imported since with a copy we're not guaranteed the on-disk state will be consistent. That can in turn result in a pool import failure and a spurious test failure.

How Has This Been Tested?

Will be tested by the CI, but the fix is identical to ab1b87e.

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)

Update the test case to freeze the pool then export it to better
simulate a hard failure.  This is preferable to copying the vdev
while the pool's imported since with a copy we're not guaranteed
the on-disk state will be consistent.  That can in turn result
in a pool import failure and a spurious test failure.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
@behlendorf behlendorf added Component: Test Suite Indicates an issue with the test framework or a test case Status: Code Review Needed Ready for review and testing labels Sep 28, 2024
@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Sep 28, 2024
@behlendorf behlendorf merged commit 834b90f into openzfs:master Sep 28, 2024
19 of 21 checks passed
robn pushed a commit to robn/zfs that referenced this pull request Nov 5, 2024
Update the test case to freeze the pool then export it to better
simulate a hard failure.  This is preferable to copying the vdev
while the pool's imported since with a copy we're not guaranteed
the on-disk state will be consistent.  That can in turn result
in a pool import failure and a spurious test failure.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#16578
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Test Suite Indicates an issue with the test framework or a test case Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants