Project

General

Profile

Actions

Bug #15508

closed

zfstest: zpool_initialize_verify_initialized fails to get data

Added by Toomas Soome 2 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
tests
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

The zpool_initialize_verify_initialized test fails:

Test: /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_initialized (run as root) [00:07] [FAIL]
01:24:02.53 zfs_initialize_value:           0xdeadbeefdeadbeef      =       0xdeadbeefdeadbeef
01:24:02.55 SUCCESS: mdb -kwe zfs_initialize_value/Z deadbeefdeadbeef
01:24:02.56 SUCCESS: mkdir /var/tmp/testdir
01:24:02.69 SUCCESS: mkfile 268435456 /var/tmp/testdir/smallfile
01:24:02.75 SUCCESS: zpool create testpool /var/tmp/testdir/smallfile
01:24:02.79 SUCCESS: zpool initialize testpool
01:24:03.49 SUCCESS: zpool export testpool
01:24:04.61 /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_initialized: line 78:  / 512: arithmetic syntax error
01:24:04.63 egrep: RE error in deadbeefdeadbeef|\*|: invalid regular expression
01:24:04.63 ERROR: egrep deadbeefdeadbeef|\*| exited 2

The clue there is first error, we attempt to divide something by 512, and that something is not there. The value to be divided is supposed to come from zdb:

"$(zdb -p $TESTDIR -Pme $TESTPOOL | egrep 'spacemap[ ]+0 ' | \
    awk '{print $4, $8}')" 

output from zdb is like this:

        metaslab      0   offset            0   spacemap   1599   free    34878070784
        metaslab      1   offset   2000000000   spacemap    375   free    127712002048

All cases I did check manually, I never got 'spacemap 0'. After consulting OpenZFS, I did base the fix on OpenZFS commit:

commit 2844ad60d41717f4713ed01df2d46bc12f590ddd
Author: Brian Behlendorf <behlendorf1@llnl.gov>
Date:   Fri Dec 18 08:42:59 2020 -0800

    ZTS: Simplify zpool_initialize_verify_initialized

    Consider the test to be a success as long as the initializing pattern
    is found at least once per metaslab.  This indicates that at least
    part of the free space was initialized.  Ideally we'd check that the
    pattern was written to all free space but that's much trickier so this
    check is a reasonable compromise.

    Using a here-string to feed the loop in this test causes an empty
    string to still trigger the loop so we miss the `spacemaps=0` case.
    Pipe into the loop instead.

    While here, we can use `zpool wait -t initialize $TESTPOOL` to wait for
    the pool to initialize.

    Co-authored-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
    Closes #11365

Testing done: zfstests:

tsoome@test:~$ /opt/zfs-tests/bin/zfstest -T zpool_initialize
Test: /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_attach_detach_add_remove (run as root) [00:01] [PASS]
Test: /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_import_export (run as root) [00:04] [PASS]
Test: /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_offline_export_import_online (run as root) [00:01] [PASS]
Test: /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_online_offline (run as root) [00:00] [PASS]
Test: /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_split (run as root) [00:02] [PASS]
Test: /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_neg (run as root) [00:00] [PASS]
Test: /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_start_and_cancel_pos (run as root) [00:00] [PASS]
Test: /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_suspend_resume (run as root) [00:09] [PASS]
Test: /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_unsupported_vdevs (run as root) [00:00] [PASS]
Test: /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_checksums (run as root) [00:15] [PASS]
Test: /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/zpool_initialize_verify_initialized (run as root) [00:20] [PASS]
Test: /opt/zfs-tests/tests/functional/cli_root/zpool_initialize/cleanup (run as root) [00:00] [PASS]

Results Summary
PASS      12

Running Time:   00:00:57
Percent passed: 100.0%
Log directory:  /var/tmp/test_results/20230323T143241

Actions #1

Updated by Electric Monk 2 months ago

  • Gerrit CR set to 2737
Actions #2

Updated by Toomas Soome 2 months ago

  • Description updated (diff)
Actions #3

Updated by Toomas Soome 2 months ago

  • Description updated (diff)
Actions #4

Updated by Toomas Soome about 2 months ago

  • Status changed from In Progress to Pending RTI
Actions #5

Updated by Electric Monk about 2 months ago

  • Status changed from Pending RTI to Closed
  • % Done changed from 90 to 100

git commit 133d96a86dd791c469e03dc4c80ace8f7775aa93

commit  133d96a86dd791c469e03dc4c80ace8f7775aa93
Author: Brian Behlendorf <behlendorf1@llnl.gov>
Date:   2023-04-17T21:50:15.000Z

    15508 zfstest: zpool_initialize_verify_initialized fails to get data
    Reviewed by: Yuri Pankov <yuri@aetern.org>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Dan McDonald <danmcd@mnx.io>

Actions

Also available in: Atom PDF