ZTS: Zpool_initialize_import_export Race (initialization Finishes Before Export)
ZTS: zpool_initialize_import_export race (initialization finishes before export)
System Information
Type | Version/Name |
---|---|
Distribution Name | Debian |
Distribution Version | 13 |
Kernel Version | 6.12.27 |
Architecture | amd64 |
OpenZFS Version | 2.2.7 |
Describe the Problem
The zpool_initialize_import_export
test appears to be failing due to a race condition between the initialization and export of a ZFS pool. The test creates a pool, initializes it, exports it, and then imports it again. However, the initialization process seems to be completing before the export process, causing the import to fail.
Describe How to Reproduce the Problem
To reproduce this issue, you can run the zpool_initialize_import_export
test in the ZFS test suite. This test creates a pool, initializes it, exports it, and then imports it again. The test is designed to check the behavior of the ZFS pool when it is initialized and then exported and imported again.
Include Any Warning/Errors/Backtraces from the System Logs
The system logs show the following output:
22:00:41.38 1746655238 dsl_scan.c:4432:dsl_scan_sync(): finish scan clearing for testpool
22:00:41.38 1746655238 dsl_scan.c:4551:dsl_scan_sync(): scan issuing complete txg 39 for testpool
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 39 scan done errors=0
22:00:41.38 1746655238 vdev.c:3164:vdev_dtl_reassess(): guid:14026271582013443500 txg:39 scrub:34 started:1 dtl:10/34 errors:0
22:00:41.38 1746655238 vdev.c:3223:vdev_dtl_reassess(): DTL_MISSING is now empty
22:00:41.38 1746655238 spa.c:8925:spa_async_request(): spa=testpool async request task=8
22:00:41.38 1746655238 vdev.c:166:vdev_dbgmsg(): disk vdev '/dev/loop1': txg 39, spa testpool, DTL old object 0, new object 142
22:00:41.38 1746655238 spa_history.c:293:spa_history_log_sync(): command: zpool clear testpool loop0
22:00:41.38 1746655238 spa_history.c:293:spa_history_log_sync(): command: zpool destroy -f testpool
22:00:41.38 1746655238 spa_misc.c:418:spa_load_note(): spa_load(testpool, config trusted): UNLOADING
22:00:41.38 1746655238 mmp.c:259:mmp_thread_stop(): MMP thread stopped pool 'testpool' gethrtime 3048997769115
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 create pool version 5000; software version zfs-2.2.7-0-ge269af1b3-dist; uts host 6.1227-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.27-1 (2025-05-06) x86_64
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@async_destroy=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@empty_bpobj=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@lz4_compress=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@multi_vdev_crash_dump=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@spacemap_histogram=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@enabled_txg=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@hole_birth=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@extensible_dataset=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@embedded_data=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@bookmarks=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@filesystem_limits=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@large_blocks=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@large_dnode=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@sha512=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@skein=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@edonr=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@userobj_accounting=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@encryption=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@project_quota=enabled
22:00:41.38 1746655238 spa_history.c:306spa_history_log_sync(): txg 4 set feature@device_removal=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@obsolete_counts=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@zpool_checkpoint=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@spacemap_v2=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@allocation_classes=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@resilver_defer=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@bookmark_v2=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@redaction_bookmarks=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@redacted_datasets=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@bookmark_written=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@log_spacemap=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@livelist=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@device_rebuild=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@zstd_compress=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@draid=enabled
22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set<br/>
**Q&A: ZTS: zpool_initialize_import_export race (initialization finishes before export)**
**Q: What is the issue with the zpool_initialize_import_export test?**
A: The issue with the zpool_initialize_import_export test is that the initialization process completes before the export process, causing the import to fail.
**Q: What is the expected behavior of the zpool_initialize_import_export test?**
A: The expected behavior of the zpool_initialize_import_export test is that the initialization process should complete after the export process, allowing the import to succeed.
**Q: What is the cause of the issue?**
A: The cause of the issue is a race condition between the initialization and export processes. The initialization process is completing before the export process, causing the import to fail.
**Q: How can the issue be reproduced?**
A: The issue can be reproduced by running the zpool_initialize_import_export test in the ZFS test suite.
**Q: What are the system logs showing?**
A: The system logs show the following output:
22:00:41.38 1746655238 dsl_scan.c:4432:dsl_scan_sync(): finish scan clearing for testpool 22:00:41.38 1746655238 dsl_scan.c:4551:dsl_scan_sync(): scan issuing complete txg 39 for testpool 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 39 scan done errors=0 22:00:41.38 1746655238 vdev.c:3164:vdev_dtl_reassess(): guid:14026271582013443500 txg:39 scrub:34 started:1 dtl:10/34 errors:0 22:00:41.38 1746655238 vdev.c:3223:vdev_dtl_reassess(): DTL_MISSING is now empty 22:00:41.38 1746655238 spa.c:8925:spa_async_request(): spa=testpool async request task=8 22:00:41.38 1746655238 vdev.c:166:vdev_dbgmsg(): disk vdev '/dev/loop1': txg 39, spa testpool, DTL old object 0, new object 142 22:00:41.38 1746655238 spa_history.c:293:spa_history_log_sync(): command: zpool clear testpool loop0 22:00:41.38 1746655238 spa_history.c:293:spa_history_log_sync(): command: zpool destroy -f testpool 22:00:41.38 1746655238 spa_misc.c:418:spa_load_note(): spa_load(testpool, config trusted): UNLOADING 22:00:41.38 1746655238 mmp.c:259:mmp_thread_stop(): MMP thread stopped pool 'testpool' gethrtime 3048997769115 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 create pool version 5000; software version zfs-2.2.7-0-ge269af1b3-dist; uts host 6.12.27-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.27-1 (2025-05-06) x86_64 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@async_destroy=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@empty_bpobj=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@lz4_compress=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@multi_vdev_crash_dump=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@spacemap_histogram=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@enabled_txg=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@hole_birth=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@extensible_dataset=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@embedded_data=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@bookmarks=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@filesystem_limits=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@large_blocks=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@large_dnode=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@sha512=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@skein=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@edonr=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@userobj_accounting=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@encryption=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@project_quota=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@device_removal=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@obsolete_counts=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@zpool_checkpoint=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@spacemap_v2=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@allocation_classes=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@resilver_defer=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@bookmark_v2=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@redaction_bookmarks=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@redacted_datasets=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@bookmark_written=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@log_spacemap=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@livelist=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@device_rebuild=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@zstd_compress=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@draid=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history_log_sync(): txg 4 set feature@zilsaxattr=enabled 22:00:41.38 1746655238 spa_history.c:306:spa_history