{"action":"created","issue":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4987","repository_url":"https://api.github.com/repos/zfsonlinux/zfs","labels_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4987/labels{/name}","comments_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4987/comments","events_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4987/events","html_url":"https://github.com/zfsonlinux/zfs/issues/4987","id":171911285,"number":4987,"title":"address of TEST occasional failure occurs in zpool_import_001_pos where it fails to import by guid","user":{"login":"liaoyuxiangqin","id":16525985,"avatar_url":"https://avatars.githubusercontent.com/u/16525985?v=3","gravatar_id":"","url":"https://api.github.com/users/liaoyuxiangqin","html_url":"https://github.com/liaoyuxiangqin","followers_url":"https://api.github.com/users/liaoyuxiangqin/followers","following_url":"https://api.github.com/users/liaoyuxiangqin/following{/other_user}","gists_url":"https://api.github.com/users/liaoyuxiangqin/gists{/gist_id}","starred_url":"https://api.github.com/users/liaoyuxiangqin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liaoyuxiangqin/subscriptions","organizations_url":"https://api.github.com/users/liaoyuxiangqin/orgs","repos_url":"https://api.github.com/users/liaoyuxiangqin/repos","events_url":"https://api.github.com/users/liaoyuxiangqin/events{/privacy}","received_events_url":"https://api.github.com/users/liaoyuxiangqin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-18T14:13:51Z","updated_at":"2016-08-19T01:44:04Z","closed_at":null,"body":"Dear All:\r\n\r\n    Some address information of TEST occasional failure occurs in zpool_import_001_pos where it fails to import by guid as follows:\r\n    \r\n    conditions:\r\n    OS: Centos7 3.10.0-123.el7.x86_64\r\n    ZFS: zfs-cf2731e65b2015988b2cae7970886279e11b013f\r\n    SPL: spl-576865be20ce4a0d4365cd62a589edec070fe08c\r\n   \r\n    Failures:\r\n    Test: /home/yuxiang/zfs-cf2/tests/zfs-tests/tests/functional/cli_root/zpool_import/setup (run as root) [02:18] [PASS]\r\n    11:15:30.36 SUCCESS: /home/yuxiang/zfs-cf2/cmd/zpool/zpool create -f foopool15672 loop0\r\n    11:15:30.63 SUCCESS: cleanup_devices loop0\r\n    11:15:30.99 SUCCESS: /home/yuxiang/zfs-cf2/cmd/zpool/zpool create -f foopool15672 loop1\r\n    11:15:31.26 SUCCESS: cleanup_devices loop1\r\n    11:15:31.35 SUCCESS: /usr/sbin/parted /dev/loop0 -s -- mklabel gpt\r\n    11:15:31.51 SUCCESS: /usr/sbin/parted /dev/loop0 -s -- mkpart part0 1cyl 16cyl\r\n    11:16:54.63 SUCCESS: set_partition 0  128m loop0\r\n    11:16:55.53 SUCCESS: /usr/sbin/parted /dev/loop0 -s -- mkpart part1 17cyl 32cyl\r\n    11:16:56.18 SUCCESS: set_partition 1 17 128m loop0\r\n    11:16:57.36 SUCCESS: /usr/sbin/parted /dev/loop0 -s -- mkpart part2 32cyl 47cyl\r\n    11:16:57.99 SUCCESS: set_partition 2 32 128m loop0\r\n    11:16:59.51 SUCCESS: /usr/sbin/parted /dev/loop0 -s -- mkpart part3 48cyl 63cyl\r\n    11:16:59.94 SUCCESS: set_partition 3 48 128m loop0\r\n    11:17:03.30 SUCCESS: /home/yuxiang/zfs-cf2/cmd/zpool/zpool create -f testpool.32389 loop0p1\r\n    11:17:04.46 SUCCESS: /home/yuxiang/zfs-cf2/cmd/zfs/zfs create testpool.32389/testfs.32389\r\n    11:17:04.55 SUCCESS: /home/yuxiang/zfs-cf2/cmd/zfs/zfs set mountpoint=/var/tmp/testdir32389 testpool.32389/testfs.32389\r\n    11:17:04.68 SUCCESS: /usr/sbin/parted /dev/loop1 -s -- mklabel gpt\r\n    11:17:04.75 SUCCESS: /usr/sbin/parted /dev/loop1 -s -- mkpart part0 1cyl 128cyl\r\n    11:17:43.37 SUCCESS: set_partition 0  1g loop1\r\n    11:17:43.49 SUCCESS: /usr/bin/mkdir -p /var/tmp/dev_import-test\r\n    11:17:43.50 SUCCESS: /usr/bin/mount /dev/loop1p1 /var/tmp/dev_import-test\r\n    11:17:43.88 SUCCESS: /home/yuxiang/zfs-cf2/tests/zfs-tests/cmd/mkfile/mkfile 64m /var/tmp/dev_import-test/disk0\r\n    11:17:44.29 SUCCESS: /home/yuxiang/zfs-cf2/tests/zfs-tests/cmd/mkfile/mkfile 64m /var/tmp/dev_import-test/disk1\r\n    11:17:44.74 SUCCESS: /home/yuxiang/zfs-cf2/tests/zfs-tests/cmd/mkfile/mkfile 64m /var/tmp/dev_import-test/disk2\r\n    11:17:46.37 SUCCESS: /home/yuxiang/zfs-cf2/tests/zfs-tests/cmd/mkfile/mkfile 64m /var/tmp/dev_import-test/disk3\r\n    11:17:48.10 SUCCESS: /home/yuxiang/zfs-cf2/tests/zfs-tests/cmd/mkfile/mkfile 64m /var/tmp/dev_import-test/disk4\r\n    Test: /home/yuxiang/zfs-cf2/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_001_pos (run as root) [00:03] [FAIL]\r\n    11:17:48.50 ASSERTION: Verify that an exported pool can be imported.\r\n    11:17:49.42 SUCCESS: /home/yuxiang/zfs-cf2/cmd/zpool/zpool create -f testpool1.32389 /var/tmp/dev_import-test/disk0 /var/tmp/dev_import-test/disk1 /var/tmp/dev_import-test/disk2\r\n    11:17:49.48 SUCCESS: /usr/bin/mkdir -p /var/tmp/testdir132389\r\n    11:17:49.55 SUCCESS: /home/yuxiang/zfs-cf2/cmd/zfs/zfs create testpool1.32389/testfs.32389\r\n    11:17:49.60 SUCCESS: /home/yuxiang/zfs-cf2/cmd/zfs/zfs set mountpoint=/var/tmp/testdir132389 testpool1.32389/testfs.32389\r\n    11:17:51.38 SUCCESS: /usr/bin/cp /home/yuxiang/zfs-cf2/tests/zfs-tests/include/libtest.shlib /var/tmp/testdir32389/testfile0.32389\r\n    11:17:51.41 SUCCESS: /home/yuxiang/zfs-cf2/cmd/zfs/zfs umount /var/tmp/testdir32389\r\n    11:17:51.45 SUCCESS: /home/yuxiang/zfs-cf2/cmd/zpool/zpool export testpool.32389\r\n    11:17:51.76 ERROR: /home/yuxiang/zfs-cf2/cmd/zpool/zpool import 4012590715811873734 exited 1\r\n    11:17:51.84 cannot import 'testpool.32389': no such pool available\r\n    11:17:51.84 ERROR: /home/yuxiang/zfs-cf2/cmd/zpool/zpool import testpool.32389 exited 1\r\n\r\n    From the above log we can learn that '/dev/loop0' have parted to 4 partitions, and testpool.32389 create based on '/dev/loop0p1', \r\n    and the pool's guid is 4012590715811873734. Further more, from the import by guid fail result is 'no such pool available' we can learn \r\n    the reason may be is that '/dev/loop0p1' lost or pool label lost, so continue to the following tests and analyses.\r\n      \r\n    Analysis:   \r\n    step1: from zdb dump we can learn that the pool is export success and it's label is correct, \r\n           so i think failure reason is '/dev/loop0p1' lost, and continue to the step2.    \r\n    [root@localhost tmp]# zdb -l /dev/loop0p1 \r\n    --------------------------------------------\r\n    LABEL 0\r\n    --------------------------------------------\r\n        version: 5000\r\n        name: 'testpool.32389'\r\n        state: 1\r\n        txg: 13\r\n        pool_guid: 4012590715811873734\r\n        errata: 0\r\n        hostname: 'localhost.localdomain'\r\n        top_guid: 5718357308702798668\r\n        guid: 5718357308702798668\r\n        vdev_children: 1\r\n        vdev_tree:\r\n            type: 'disk'\r\n            id: 0\r\n            guid: 5718357308702798668\r\n            path: '/dev/loop0p1'\r\n            whole_disk: 0\r\n            metaslab_array: 67\r\n            metaslab_shift: 24\r\n            ashift: 9\r\n            asize: 119013376\r\n            is_log: 0\r\n            create_txg: 4\r\n        features_for_read:\r\n            com.delphix:hole_birth\r\n            com.delphix:embedded_data\r\n    --------------------------------------------\r\n    LABEL 1\r\n    --------------------------------------------\r\n        version: 5000\r\n        name: 'testpool.32389'\r\n        state: 1\r\n        txg: 13\r\n        pool_guid: 4012590715811873734\r\n        errata: 0\r\n        hostname: 'localhost.localdomain'\r\n        top_guid: 5718357308702798668\r\n        guid: 5718357308702798668\r\n        vdev_children: 1\r\n        vdev_tree:\r\n            type: 'disk'\r\n            id: 0\r\n            guid: 5718357308702798668\r\n            path: '/dev/loop0p1'\r\n            whole_disk: 0\r\n            metaslab_array: 67\r\n            metaslab_shift: 24\r\n            ashift: 9\r\n            asize: 119013376\r\n            is_log: 0\r\n            create_txg: 4\r\n        features_for_read:\r\n            com.delphix:hole_birth\r\n            com.delphix:embedded_data\r\n    --------------------------------------------\r\n    LABEL 2\r\n    --------------------------------------------\r\n        version: 5000\r\n        name: 'testpool.32389'\r\n        state: 1\r\n        txg: 13\r\n        pool_guid: 4012590715811873734\r\n        errata: 0\r\n        hostname: 'localhost.localdomain'\r\n        top_guid: 5718357308702798668\r\n        guid: 5718357308702798668\r\n        vdev_children: 1\r\n        vdev_tree:\r\n            type: 'disk'\r\n            id: 0\r\n            guid: 5718357308702798668\r\n            path: '/dev/loop0p1'\r\n            whole_disk: 0\r\n            metaslab_array: 67\r\n            metaslab_shift: 24\r\n            ashift: 9\r\n            asize: 119013376\r\n            is_log: 0\r\n            create_txg: 4\r\n        features_for_read:\r\n            com.delphix:hole_birth\r\n            com.delphix:embedded_data\r\n    --------------------------------------------\r\n    LABEL 3\r\n    --------------------------------------------\r\n        version: 5000\r\n        name: 'testpool.32389'\r\n        state: 1\r\n        txg: 13\r\n        pool_guid: 4012590715811873734\r\n        errata: 0\r\n        hostname: 'localhost.localdomain'\r\n        top_guid: 5718357308702798668\r\n        guid: 5718357308702798668\r\n        vdev_children: 1\r\n        vdev_tree:\r\n            type: 'disk'\r\n            id: 0\r\n            guid: 5718357308702798668\r\n            path: '/dev/loop0p1'\r\n            whole_disk: 0\r\n            metaslab_array: 67\r\n            metaslab_shift: 24\r\n            ashift: 9\r\n            asize: 119013376\r\n            is_log: 0\r\n            create_txg: 4\r\n        features_for_read:\r\n            com.delphix:hole_birth\r\n            com.delphix:embedded_data\r\n    [root@localhost tmp]# \r\n   \r\n    step2: add some log information in function: zpool_find_import_blkid and manual import pool by guid, \r\n           from follows log we learn that use libblkid enumerate all known zfs devices not search '/dev/loop0p1',\r\n           so that we can't read label config from '/dev/loop0p1', and return 'no such pool available'. So i think\r\n           the blkid lib in current OS exist bug, and occasional search partition dev exist miss.\r\n    [root@localhost tmp]# zpool import 4012590715811873734\r\n    zpool_do_import:name[(nil)] guid[4012590715811873734] file[(nil)] unique[-1] san[0] path[0] begin>>>>>\r\n    zpool_search_import:name[(nil)] guid[4012590715811873734] exist[0] >>>>>\r\n    zpool_find_import_blkid:blkid_dev_next rn_name[/dev/loop2]>>>>>\r\n    zpool_find_import_blkid:blkid_dev_next rn_name[/dev/loop0]>>>>>\r\n    zpool_find_import_blkid:blkid_dev_next rn_name[/dev/loop1]>>>>>\r\n    zpool_do_import:2533:cannot import '4012590715811873734': no such pool available\r\n    [root@localhost tmp]# \r\n    \r\n    step3: use blkid tool to check zfs devices whether exist and correct.\r\n    [root@localhost ~]# rpm -qa |grep libblkid*\r\n    libblkid-devel-2.23.2-16.el7.x86_64\r\n    libblkid-2.23.2-16.el7.x86_64\r\n    \r\n    scenario1: when import pool by guid success, we searched '/dev/loop0p1' is zfs device.\r\n    [root@localhost dev]# blkid -t TYPE=\"zfs_member\"\r\n    /dev/loop0: LABEL=\"foopool32126\" UUID=\"6012303043484070649\" UUID_SUB=\"17530838439788337295\" TYPE=\"zfs_member\" \r\n    /dev/loop0p1: LABEL=\"testpool.31967\" UUID=\"6104980183779630722\" UUID_SUB=\"11512063207612755591\" TYPE=\"zfs_member\" PARTLABEL=\"part0\" PARTUUID=\"c7893d48-6a95-40d3-8dc4-2db29ce6ab3a\" \r\n    /dev/loop1: LABEL=\"foopool32126\" UUID=\"14228737093700064280\" UUID_SUB=\"9895466244927853809\" TYPE=\"zfs_member\" \r\n    [root@localhost dev]# \r\n\r\n    scenario2: when import pool by guid fail, we can't search '/dev/loop0p1' as zfs device.\r\n    [root@localhost dev]# blkid -t TYPE=\"zfs_member\"\r\n    /dev/loop0: LABEL=\"foopool8403\" UUID=\"11985523947629466248\" UUID_SUB=\"8903826087660517904\" TYPE=\"zfs_member\" \r\n    /dev/loop1: LABEL=\"foopool8403\" UUID=\"17591282247125289509\" UUID_SUB=\"545812641500644200\" TYPE=\"zfs_member\" \r\n    [root@localhost dev]#     \r\n       And then, we download and install latest e2fsprogs-1.43.1 tools which iclude libblkid,\r\n       and we also can search '/dev/loop0p1' is zfs device, although the device tag of TYPE'S value exist differences, but also \r\n       can explain the latest blkid lib is working correctly.\r\n    [root@localhost ~]# blkid \r\n    /dev/sda1: UUID=\"62e2db02-a6a1-434f-82fe-df6b853ecace\" TYPE=\"xfs\" \r\n    /dev/sda2: UUID=\"WpGMey-Tvld-aSRJ-DnjZ-B7tW-txsk-m5kS1i\" TYPE=\"lvm2pv\" \r\n    /dev/sr0: LABEL=\"CentOS 7 x86_64\" TYPE=\"iso9660\" \r\n    /dev/mapper/centos-swap: TYPE=\"swap\" UUID=\"0c3996b1-15d7-4669-8ac5-6f129caeb47f\" \r\n    /dev/mapper/centos-root: UUID=\"0fc2156e-91a3-49ce-ac33-a0a4a17b0584\" TYPE=\"xfs\" \r\n    /dev/loop0: TYPE=\"zfs\" \r\n    /dev/loop0p1: TYPE=\"zfs\" \r\n    /dev/loop1: TYPE=\"zfs\" \r\n    /dev/loop1p1: UUID=\"85f21f6d-abde-4f56-9f98-2bd481307280\" TYPE=\"ext2\" \r\n    [root@localhost ~]#    \r\n   \r\n    Solution:\r\n    From what has been discussed above, \r\n    i think the reason of TEST occasional failure occurs in zpool_import_001_pos where it fails to import by guid is blkid lib in centos 7 exist bug, \r\n    but imperfect that i have not been able to update blkid lib to latest in current OS and prove my analysis.\r\n    so welcome to everybody give advice and instruction,thanks!"},"comment":{"url":"https://api.github.com/repos/zfsonlinux/zfs/issues/comments/240906091","html_url":"https://github.com/zfsonlinux/zfs/issues/4987#issuecomment-240906091","issue_url":"https://api.github.com/repos/zfsonlinux/zfs/issues/4987","id":240906091,"user":{"login":"liaoyuxiangqin","id":16525985,"avatar_url":"https://avatars.githubusercontent.com/u/16525985?v=3","gravatar_id":"","url":"https://api.github.com/users/liaoyuxiangqin","html_url":"https://github.com/liaoyuxiangqin","followers_url":"https://api.github.com/users/liaoyuxiangqin/followers","following_url":"https://api.github.com/users/liaoyuxiangqin/following{/other_user}","gists_url":"https://api.github.com/users/liaoyuxiangqin/gists{/gist_id}","starred_url":"https://api.github.com/users/liaoyuxiangqin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liaoyuxiangqin/subscriptions","organizations_url":"https://api.github.com/users/liaoyuxiangqin/orgs","repos_url":"https://api.github.com/users/liaoyuxiangqin/repos","events_url":"https://api.github.com/users/liaoyuxiangqin/events{/privacy}","received_events_url":"https://api.github.com/users/liaoyuxiangqin/received_events","type":"User","site_admin":false},"created_at":"2016-08-19T01:44:04Z","updated_at":"2016-08-19T01:44:04Z","body":"@behlendorf The address information of TEST occasional failure occurs in zpool_import_001_pos where it fails to import by guid as above described, I found the reason for failure is use libblkid enumerate all known zfs devices but miss '/dev/loop0p1', so we can't read pool label config and return 'no such pool available'.\r\n\r\nAnd then  we download and install latest e2fsprogs-1.43.1 tools which iclude libblkid, and we also can search '/dev/loop0p1' is zfs device, although the device tag of TYPE's value exist differences. \r\n\r\nAt last, i think the blkid lib in Centos7 not very good to search loop device partition, but imperfect that i have not been able to update libblkid rpm pkg to latest in Centos7 and prove my analysis. so welcome to offer advice and instruction,thanks!"}}
{"actor":{"display_login":"liaoyuxiangqin"}}