Bug 1707461
| Summary: | stratisd tries to extremely grow thin metadata device on large disk | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Jakub Krysl <jkrysl> |
| Component: | stratisd | Assignee: | mulhern <amulhern> |
| Status: | CLOSED ERRATA | QA Contact: | Filip Suba <fsuba> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.4 | CC: | amulhern, dkeefe, rhandlin |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | 8.5 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | stratisd-2.4.0-1.el8 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-11-09 18:16:03 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Some notes:
In drivers/md/dm-thin-metadata.h:
/*
* The metadata device is currently limited in size.
*/
#define THIN_METADATA_MAX_SECTORS DM_SM_METADATA_MAX_SECTORS
Most relevant commit:
commit 7d48935eff401bb7970e73e822871a10e3643df1
Author: Mike Snitzer <snitzer>
Date: Wed Feb 12 23:58:15 2014 -0500
dm thin: allow metadata space larger than supported to go unused
It was always intended that a user could provide a thin metadata device
that is larger than the max supported by the on-disk format. The extra
space would just go unused.
Unfortunately that never worked. If the user attempted to use a larger
metadata device on creation they would get an error like the following:
device-mapper: space map common: space map too large
device-mapper: transaction manager: couldn't create metadata space map
device-mapper: thin metadata: tm_create_with_sm failed
device-mapper: table: 252:17: thin-pool: Error creating metadata object
device-mapper: ioctl: error adding target to table
Fix this by allowing the initial metadata space map creation to cap its
size at the max number of blocks supported (DM_SM_METADATA_MAX_BLOCKS).
get_metadata_dev_size() must also impose DM_SM_METADATA_MAX_BLOCKS (via
THIN_METADATA_MAX_SECTORS), otherwise extending metadata would cap at
THIN_METADATA_MAX_SECTORS_WARNING (which is larger than supported).
Also, the calculation for THIN_METADATA_MAX_SECTORS didn't account for
the sizeof the disk_bitmap_header. So the supported maximum metadata
size is a bit smaller (reduced from 33423360 to 33292800 sectors).
Lastly, remove the "excess space will not be used" warning message from
get_metadata_dev_size(); it resulted in printing the warning multiple
times. Factor out warn_if_metadata_device_too_big(), call it from
pool_ctr() and maybe_resize_metadata_dev().
It looks like the value has been stable since 2014.
Generally speaking, we don't want to restrict our code based on a max
value that may change in our dependency. Ideally, our dependency would
publish that value in some programmatic way. But likely this one will
not change, so we could incorporate the knowledge that this is the DM max into
our source, if we have to.
Mass migration to Guangwu. Upstream issue: https://github.com/stratis-storage/stratisd/issues/1495. Fix merged upstream. Verified with stratisd-2.4.0-3.el8. May 27 16:33:31 storageqe-90 kernel: XFS (dm-113): Mounting V5 Filesystem May 27 16:33:31 storageqe-90 kernel: XFS (dm-113): Ending clean mount May 27 16:33:31 storageqe-90 systemd[1]: run-stratisd-.mdv\x2d66d8df924c754eda8f7cf712c55fd601.mount: Succeeded. May 27 16:33:31 storageqe-90 systemd[53459]: run-stratisd-.mdv\x2d66d8df924c754eda8f7cf712c55fd601.mount: Succeeded. May 27 16:33:31 storageqe-90 kernel: XFS (dm-113): Unmounting Filesystem May 27 16:33:31 storageqe-90 stratisd[38584]: [2021-05-27T14:33:31Z INFO libstratis::engine::strat_engine::thinpool::thinpool] Attempting to extend thinpool metadata sub-device belonging to pool 66d8df92-4c75-4eda-8f7c-f712c55fd601 by 33260032 sectors May 27 16:33:31 storageqe-90 kernel: device-mapper: thin: 253:114: growing the metadata device from 4096 to 4161536 blocks May 27 16:33:31 storageqe-90 stratisd[38584]: [2021-05-27T14:33:31Z INFO libstratis::engine::strat_engine::thinpool::thinpool] Extended thinpool metadata sub-device belonging to pool with uuid 66d8df92-4c75-4eda-8f7c-f712c55fd601 by 33259520 sectors May 27 16:33:31 storageqe-90 stratisd[38584]: [2021-05-27T14:33:31Z INFO libstratis::engine::strat_engine::thinpool::thinpool] Attempting to extend thinpool data sub-device belonging to pool 66d8df92-4c75-4eda-8f7c-f712c55fd601 by 58562889728 sectors May 27 16:33:32 storageqe-90 kernel: device-mapper: thin: 253:114: growing the data device from 768 to 28595929 blocks May 27 16:33:32 storageqe-90 stratisd[38584]: [2021-05-27T14:33:32Z INFO libstratis::engine::strat_engine::thinpool::thinpool] Extended thinpool data sub-device belonging to pool with uuid 66d8df92-4c75-4eda-8f7c-f712c55fd601 by 58562889728 sectors May 27 16:33:32 storageqe-90 stratisd[38584]: [2021-05-27T14:33:32Z INFO libstratis::engine::strat_engine::thinpool::thinpool] Status of thinpool device with "devicemapper name: stratis-1-private-66d8df924c754eda8f7cf712c55fd601-thinpool-pool, device number: 253:114, device node: /dev/dm-114" changed from "none" to "rw" May 27 16:33:32 storageqe-90 stratisd[38584]: [2021-05-27T14:33:32Z INFO libstratis::dbus_api::api::shared] Pool with UUID 66d8df92-4c75-4eda-8f7c-f712c55fd601 was created successfully May 27 16:33:32 storageqe-90 stratisd[38584]: [2021-05-27T14:33:32Z DEBUG libstratis::engine::strat_engine::liminal::identify] Stratis block device with Stratis device description: Stratis pool UUID: "66d8df92-4c75-4eda-8f7c-f712c55fd601", Stratis device UUID: "37398669-953c-4dd8-94e4-11108b449dbf", device number: "9:127", devnode: "/dev/md127" identified May 27 16:33:32 storageqe-90 stratisd[38584]: [2021-05-27T14:33:32Z DEBUG libstratis::engine::strat_engine::liminal::identify] Stratis block device with Stratis device description: Stratis pool UUID: "66d8df92-4c75-4eda-8f7c-f712c55fd601", Stratis device UUID: "37398669-953c-4dd8-94e4-11108b449dbf", device number: "9:127", devnode: "/dev/md127" identified Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (stratis-cli bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:4217 |
Description of problem: When creating stratis pool over very large device (27.3T RAID5 in my case - 4 9.1T 4K block disks) syslog is spammed with stratisd trying to extend metadata device to size that dm-thin does not allow. Plus the requested size is so big, thinpool runs out of space and cannot further extend it. The metadata end up being 28GB big: # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 9.1T 0 disk └─md127 9:127 0 27.3T 0 raid5 └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-physical-originsub 253:0 0 27.3T 0 stratis ├─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-flex-thinmeta 253:1 0 28G 0 stratis │ └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-thinpool-pool 253:4 0 27.3T 0 stratis ├─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-flex-thindata 253:2 0 27.3T 0 stratis │ └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-thinpool-pool 253:4 0 27.3T 0 stratis └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-flex-mdv 253:3 0 16M 0 stratis sdc 8:32 0 9.1T 0 disk └─md127 9:127 0 27.3T 0 raid5 └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-physical-originsub 253:0 0 27.3T 0 stratis ├─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-flex-thinmeta 253:1 0 28G 0 stratis │ └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-thinpool-pool 253:4 0 27.3T 0 stratis ├─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-flex-thindata 253:2 0 27.3T 0 stratis │ └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-thinpool-pool 253:4 0 27.3T 0 stratis └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-flex-mdv 253:3 0 16M 0 stratis sdd 8:48 0 9.1T 0 disk └─md127 9:127 0 27.3T 0 raid5 └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-physical-originsub 253:0 0 27.3T 0 stratis ├─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-flex-thinmeta 253:1 0 28G 0 stratis │ └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-thinpool-pool 253:4 0 27.3T 0 stratis ├─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-flex-thindata 253:2 0 27.3T 0 stratis │ └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-thinpool-pool 253:4 0 27.3T 0 stratis └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-flex-mdv 253:3 0 16M 0 stratis sde 8:64 0 9.1T 0 disk └─md127 9:127 0 27.3T 0 raid5 └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-physical-originsub 253:0 0 27.3T 0 stratis ├─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-flex-thinmeta 253:1 0 28G 0 stratis │ └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-thinpool-pool 253:4 0 27.3T 0 stratis ├─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-flex-thindata 253:2 0 27.3T 0 stratis │ └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-thinpool-pool 253:4 0 27.3T 0 stratis └─stratis-1-private-8449f2f9275b4e9db5a98e41aaa332aa-flex-mdv 253:3 0 16M 0 stratis syslog: May 7 16:52:43 storageqe-90 kernel: XFS (dm-3): Mounting V5 Filesystem May 7 16:52:43 storageqe-90 kernel: XFS (dm-3): Ending clean mount May 7 16:52:44 storageqe-90 kernel: XFS (dm-3): Unmounting Filesystem May 7 16:52:46 storageqe-90 kernel: device-mapper: thin: Data device (dm-2) discard unsupported: Disabling discard passdown. May 7 16:52:46 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Attempting to extend thinpool metadata sub-device belonging to pool 8449f2f9275b4e9db5a98e41aaa332aa by 58565048 sectors May 7 16:52:46 storageqe-90 kernel: device-mapper: thin: Metadata device dm-1 is larger than 33292800 sectors: excess space will not be used. May 7 16:52:46 storageqe-90 kernel: device-mapper: thin: Data device (dm-2) discard unsupported: Disabling discard passdown. May 7 16:52:46 storageqe-90 kernel: device-mapper: thin: Metadata device dm-1 is larger than 33292800 sectors: excess space will not be used. May 7 16:52:46 storageqe-90 kernel: device-mapper: thin: 253:4: growing the metadata device from 4096 to 4161600 blocks May 7 16:52:47 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Extended thinpool metadata sub-device belonging to pool with uuid 8449f2f9275b4e9db5a98e41aaa332aa by 58556416 sectors May 7 16:52:47 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Attempting to extend thinpool data sub-device belonging to pool 8449f2f9275b4e9db5a98e41aaa332aa by 58537592832 sectors May 7 16:52:47 storageqe-90 kernel: device-mapper: thin: Metadata device dm-1 is larger than 33292800 sectors: excess space will not be used. May 7 16:52:47 storageqe-90 kernel: device-mapper: thin: Data device (dm-2) discard unsupported: Disabling discard passdown. May 7 16:52:47 storageqe-90 kernel: device-mapper: thin: 253:4: growing the data device from 768 to 28583577 blocks May 7 16:52:48 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Extended thinpool data sub-device belonging to pool with uuid 8449f2f9275b4e9db5a98e41aaa332aa by 58537592832 sectors May 7 16:52:48 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Data tier percent used: 0 May 7 16:52:48 storageqe-90 kernel: device-mapper: thin: Metadata device dm-1 is larger than 33292800 sectors: excess space will not be used. May 7 16:52:48 storageqe-90 kernel: device-mapper: thin: Data device (dm-2) discard unsupported: Disabling discard passdown. May 7 16:52:49 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Attempting to extend thinpool metadata sub-device belonging to pool 8449f2f9275b4e9db5a98e41aaa332aa by 25305016 sectors May 7 16:52:49 storageqe-90 stratisd[75817]: WARN libstratis::engine::strat_engine::thinpool::thinpool: Insufficient free space available in backstore; extended thinpool metadata sub-device belonging to pool with uuid 8449f2f9275b4e9db5a98e41aaa332aa by 0 sectors, request was 25305016 sectors May 7 16:52:49 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Data tier percent used: 0 May 7 16:52:49 storageqe-90 kernel: device-mapper: thin: Metadata device dm-1 is larger than 33292800 sectors: excess space will not be used. May 7 16:52:49 storageqe-90 kernel: device-mapper: thin: Data device (dm-2) discard unsupported: Disabling discard passdown. May 7 16:52:52 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Attempting to extend thinpool metadata sub-device belonging to pool 8449f2f9275b4e9db5a98e41aaa332aa by 25305016 sectors May 7 16:52:52 storageqe-90 stratisd[75817]: WARN libstratis::engine::strat_engine::thinpool::thinpool: Insufficient free space available in backstore; extended thinpool metadata sub-device belonging to pool with uuid 8449f2f9275b4e9db5a98e41aaa332aa by 0 sectors, request was 25305016 sectors May 7 16:52:52 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Data tier percent used: 0 May 7 16:52:52 storageqe-90 kernel: device-mapper: thin: Metadata device dm-1 is larger than 33292800 sectors: excess space will not be used. May 7 16:52:52 storageqe-90 kernel: device-mapper: thin: Data device (dm-2) discard unsupported: Disabling discard passdown. May 7 16:52:53 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Attempting to extend thinpool metadata sub-device belonging to pool 8449f2f9275b4e9db5a98e41aaa332aa by 25305016 sectors May 7 16:52:53 storageqe-90 stratisd[75817]: WARN libstratis::engine::strat_engine::thinpool::thinpool: Insufficient free space available in backstore; extended thinpool metadata sub-device belonging to pool with uuid 8449f2f9275b4e9db5a98e41aaa332aa by 0 sectors, request was 25305016 sectors May 7 16:52:53 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Data tier percent used: 0 May 7 16:52:53 storageqe-90 kernel: device-mapper: thin: Metadata device dm-1 is larger than 33292800 sectors: excess space will not be used. May 7 16:52:53 storageqe-90 kernel: device-mapper: thin: Data device (dm-2) discard unsupported: Disabling discard passdown. May 7 16:52:54 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Attempting to extend thinpool metadata sub-device belonging to pool 8449f2f9275b4e9db5a98e41aaa332aa by 25305016 sectors May 7 16:52:54 storageqe-90 stratisd[75817]: WARN libstratis::engine::strat_engine::thinpool::thinpool: Insufficient free space available in backstore; extended thinpool metadata sub-device belonging to pool with uuid 8449f2f9275b4e9db5a98e41aaa332aa by 0 sectors, request was 25305016 sectors May 7 16:52:54 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Data tier percent used: 0 May 7 16:52:54 storageqe-90 kernel: device-mapper: thin: Metadata device dm-1 is larger than 33292800 sectors: excess space will not be used. May 7 16:52:54 storageqe-90 kernel: device-mapper: thin: Data device (dm-2) discard unsupported: Disabling discard passdown. May 7 16:52:55 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Attempting to extend thinpool metadata sub-device belonging to pool 8449f2f9275b4e9db5a98e41aaa332aa by 25305016 sectors May 7 16:52:55 storageqe-90 stratisd[75817]: WARN libstratis::engine::strat_engine::thinpool::thinpool: Insufficient free space available in backstore; extended thinpool metadata sub-device belonging to pool with uuid 8449f2f9275b4e9db5a98e41aaa332aa by 0 sectors, request was 25305016 sectors May 7 16:52:55 storageqe-90 stratisd[75817]: INFO libstratis::engine::strat_engine::thinpool::thinpool: Data tier percent used: 0 May 7 16:52:55 storageqe-90 kernel: device-mapper: thin: Metadata device dm-1 is larger than 33292800 sectors: excess space will not be used. May 7 16:52:55 storageqe-90 kernel: device-mapper: thin: Data device (dm-2) discard unsupported: Disabling discard passdown. Version-Release number of selected component (if applicable): kernel-4.18.0-80.el8.x86_64 stratisd-1.0.3-1.el8.x86_64 stratis-cli-1.0.2-1.el8.noarch How reproducible: 100% Steps to Reproduce: 1. mdadm --create --level 5 --raid-devices 4 md5 /dev/sd[bcde] 2. stratis pool create test_pool /dev/md127 Actual results: stratis attemps and fail to create too large metadata Expected results: stratis creates reasonably large metadata without failing Additional info: default LVM thin in the same situation: # lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert test_pool vg twi-a-tz-- <27.29t 0.00 10.41 # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 9.1T 0 disk sdb 8:16 0 9.1T 0 disk └─md127 9:127 0 27.3T 0 raid5 ├─vg-test_pool_tmeta 253:0 0 112M 0 lvm │ └─vg-test_pool 253:2 0 27.3T 0 lvm └─vg-test_pool_tdata 253:1 0 27.3T 0 lvm └─vg-test_pool 253:2 0 27.3T 0 lvm sdc 8:32 0 9.1T 0 disk └─md127 9:127 0 27.3T 0 raid5 ├─vg-test_pool_tmeta 253:0 0 112M 0 lvm │ └─vg-test_pool 253:2 0 27.3T 0 lvm └─vg-test_pool_tdata 253:1 0 27.3T 0 lvm └─vg-test_pool 253:2 0 27.3T 0 lvm sdd 8:48 0 9.1T 0 disk └─md127 9:127 0 27.3T 0 raid5 ├─vg-test_pool_tmeta 253:0 0 112M 0 lvm │ └─vg-test_pool 253:2 0 27.3T 0 lvm └─vg-test_pool_tdata 253:1 0 27.3T 0 lvm └─vg-test_pool 253:2 0 27.3T 0 lvm sde 8:64 0 9.1T 0 disk └─md127 9:127 0 27.3T 0 raid5 ├─vg-test_pool_tmeta 253:0 0 112M 0 lvm │ └─vg-test_pool 253:2 0 27.3T 0 lvm └─vg-test_pool_tdata 253:1 0 27.3T 0 lvm └─vg-test_pool 253:2 0 27.3T 0 lvm