Skip to contentSkip to conversation

Growing RAID10 with active XFS filesystem

DISCUSSION [email protected] 7 participants 8 messages Jan 6, 2018 – Jan 10, 2018 MD RAID

lore
Share & tools
lore
#0 lore raw

Dear MD-experts:

I was under the impression that growing a RAID10 device could be done with an active filesystem running on the device.

I did this a couple of times when I added additional 2TB disks to our production RAID10 running an ext3 Filesystem. That was a very time consuming process and we had to use the filesystem during the reshape.

When I increased the size of the RAID10 from 16 to 20 2TB-disks I could not use ext3 anymore due to the 16TB maimum size limitation of ext3 and I replaced the ext3 filesystem by xfs.

Now today I increased the RAID10 again from 20 to 21 disks with the following commands:

mdadm /dev/md5 --add /dev/sdo
mdadm --grow /dev/md5 --raid-devices=21

My plans were to add another disk after that and then grow the XFS-filesystem. I do not add multiple disks at once since its hard to predict which disk will end up in what disk-set

Here's mdadm -D /dev/md5 output:
/dev/md5:

        Version : 1.2

Creation Time : Sun Feb 10 16:58:10 2013
Raid Level : raid10
Array Size : 19533829120 (18628.91 GiB 20002.64 GB)
Used Dev Size : 1953382912 (1862.89 GiB 2000.26 GB)
Raid Devices : 21
Total Devices : 21
Persistence : Superblock is persistent

Update Time : Sat Jan 6 15:08:37 2018
State : clean, reshaping
Active Devices : 21
Working Devices : 21
Failed Devices : 0
Spare Devices : 0

Layout : near=2
Chunk Size : 512K

Reshape Status : 1% complete
Delta Devices : 1, (20->21)

Name : backup:5 (local to host backup) UUID : 9030ff07:6a292a3c:26589a26:8c92a488
Events : 86002

Number Major Minor RaidDevice State
0 8 16 0 active sync /dev/sdb
1 65 48 1 active sync /dev/sdt
2 8 64 2 active sync /dev/sde
3 65 96 3 active sync /dev/sdw
4 8 112 4 active sync /dev/sdh
5 65 144 5 active sync /dev/sdz
6 8 160 6 active sync /dev/sdk
7 65 192 7 active sync /dev/sdac
8 8 208 8 active sync /dev/sdn
9 65 240 9 active sync /dev/sdaf
10 65 0 10 active sync /dev/sdq
11 66 32 11 active sync /dev/sdai
12 8 32 12 active sync /dev/sdc
13 65 64 13 active sync /dev/sdu
14 8 80 14 active sync /dev/sdf
15 65 112 15 active sync /dev/sdx
16 8 128 16 active sync /dev/sdi
17 65 160 17 active sync /dev/sdaa
18 8 176 18 active sync /dev/sdl
19 65 208 19 active sync /dev/sdad
20 8 224 20 active sync /dev/sdo

As you can see the array-size is still 20TB.

Just one second after starting the reshape operation XFS failed with the following messages:

# dmesg
...
RAID10 conf printout:
 --- wd:21 rd:21
 disk 0, wo:0, o:1, dev:sdb
 disk 1, wo:0, o:1, dev:sdt
 disk 2, wo:0, o:1, dev:sde
 disk 3, wo:0, o:1, dev:sdw
 disk 4, wo:0, o:1, dev:sdh
 disk 5, wo:0, o:1, dev:sdz
 disk 6, wo:0, o:1, dev:sdk
 disk 7, wo:0, o:1, dev:sdac
 disk 8, wo:0, o:1, dev:sdn
 disk 9, wo:0, o:1, dev:sdaf
 disk 10, wo:0, o:1, dev:sdq
 disk 11, wo:0, o:1, dev:sdai
 disk 12, wo:0, o:1, dev:sdc
 disk 13, wo:0, o:1, dev:sdu
 disk 14, wo:0, o:1, dev:sdf
 disk 15, wo:0, o:1, dev:sdx
 disk 16, wo:0, o:1, dev:sdi
 disk 17, wo:0, o:1, dev:sdaa
 disk 18, wo:0, o:1, dev:sdl
 disk 19, wo:0, o:1, dev:sdad
 disk 20, wo:1, o:1, dev:sdo
md: reshape of RAID array md5
md: minimum _guaranteed_  speed: 1000 KB/sec/disk.
md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reshape.
md: using 128k window, over a total of 19533829120k.
XFS (md5): metadata I/O error: block 0x12c08f360 ("xfs_trans_read_buf_map") error 5 numblks 16
XFS (md5): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5.
XFS (md5): metadata I/O error: block 0x12c08f360 ("xfs_trans_read_buf_map") error 5 numblks 16
XFS (md5): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5.
XFS (md5): metadata I/O error: block 0xebb62c00 ("xfs_trans_read_buf_map") error 5 numblks 16
XFS (md5): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5.
...
... lots of the above messages deleted
...
XFS (md5): xfs_do_force_shutdown(0x1) called from line 138 of file fs/xfs/xfs_bmap_util.c.  Return address = 0xffffffff8113908f
XFS (md5): metadata I/O error: block 0x48c710b00 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): Log I/O Error Detected.  Shutting down filesystem
XFS (md5): Please umount the filesystem and rectify the problem(s)
XFS (md5): metadata I/O error: block 0x48c710b40 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): metadata I/O error: block 0x48c710b80 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): metadata I/O error: block 0x48c710bc0 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): metadata I/O error: block 0x48c710c00 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): metadata I/O error: block 0x48c710c40 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): metadata I/O error: block 0x48c710c80 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): metadata I/O error: block 0x48c710cc0 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): I/O Error Detected. Shutting down filesystem

I did an "umount /dev/md5" and now I'm wondering what my options are:

Should I wait until the reshape has finisched? I assume yes since stopping that operation will most likely make things worse. Unfortunately reshaping a 20TB RAID10 to 21TB will last about
10 hours but it's saturday and I have approx. 40 hours to fix the problem until monday morning.

Should I reduce array-size back to 20 disks?

My plans are to run xfs_check first, maybe followed by xfs_repair and see what happens.

Any other suggestions?

Do you have an explanation why reshaping a RAID10 with a running ext3 filesystem does work while a running XFS-filesystems fails during a reshape?

How did the XFS-filesystem notice that a reshape was running? I was sure that during the reshape operation every single block of the RAID10 device could be read or written no matter wether it belongs to the part of the RAID that was already reshaped or not. Obviously that's working in theory only - or with ext3-filesystems only.

Or was i totally wrong with my assumption?

Much thanks in advance for any assistance.

Peter Koch

#1 lore raw

mdraid> I was under the impression that growing a RAID10 device could mdraid> be done with an active filesystem running on the device.

It should be just fine. But in this case, you might also want to talk with the XFS experts.

mdraid> I did this a couple of times when I added additional 2TB disks mdraid> to our production RAID10 running an ext3 Filesystem. That was mdraid> a very time consuming process and we had to use the filesystem mdraid> during the reshape.

What kernel and distro are you running here? What are the mdadm tools versions? You need to give more details please.

mdraid> When I increased the size of the RAID10 from 16 to 20 mdraid> 2TB-disks I could not use ext3 anymore due to the 16TB maimum mdraid> size limitation of ext3 and I replaced the ext3 filesystem by mdraid> xfs.

That must have been fun... not.

mdraid> Now today I increased the RAID10 again from 20 to 21 disks with the mdraid> following commands:

mdraid> mdadm /dev/md5 --add /dev/sdo
mdraid> mdadm --grow /dev/md5 --raid-devices=21

mdraid> My plans were to add another disk after that and then grow mdraid> the XFS-filesystem. I do not add multiple disks at once since mdraid> its hard to predict which disk will end up in what disk-set

mdraid> Here's mdadm -D /dev/md5 output:
mdraid> /dev/md5:
mdraid> Version : 1.2
mdraid> Creation Time : Sun Feb 10 16:58:10 2013
mdraid> Raid Level : raid10
mdraid> Array Size : 19533829120 (18628.91 GiB 20002.64 GB)
mdraid> Used Dev Size : 1953382912 (1862.89 GiB 2000.26 GB)
mdraid> Raid Devices : 21
mdraid> Total Devices : 21
mdraid> Persistence : Superblock is persistent

mdraid> Update Time : Sat Jan 6 15:08:37 2018
mdraid> State : clean, reshaping
mdraid> Active Devices : 21
mdraid> Working Devices : 21
mdraid> Failed Devices : 0
mdraid> Spare Devices : 0

mdraid> Layout : near=2
mdraid> Chunk Size : 512K

mdraid> Reshape Status : 1% complete
mdraid> Delta Devices : 1, (20->21)

mdraid> Name : backup:5 (local to host backup)
mdraid> UUID : 9030ff07:6a292a3c:26589a26:8c92a488
mdraid> Events : 86002

mdraid> Number Major Minor RaidDevice State

mdraid>         0       8       16        0      active sync   /dev/sdb
mdraid>         1      65       48        1      active sync   /dev/sdt
mdraid>         2       8       64        2      active sync   /dev/sde
mdraid>         3      65       96        3      active sync   /dev/sdw
mdraid>         4       8      112        4      active sync   /dev/sdh
mdraid>         5      65      144        5      active sync   /dev/sdz
mdraid>         6       8      160        6      active sync   /dev/sdk
mdraid>         7      65      192        7      active sync   /dev/sdac
mdraid>         8       8      208        8      active sync   /dev/sdn
mdraid>         9      65      240        9      active sync   /dev/sdaf
mdraid>        10      65        0       10      active sync   /dev/sdq
mdraid>        11      66       32       11      active sync   /dev/sdai
mdraid>        12       8       32       12      active sync   /dev/sdc
mdraid>        13      65       64       13      active sync   /dev/sdu
mdraid>        14       8       80       14      active sync   /dev/sdf
mdraid>        15      65      112       15      active sync   /dev/sdx
mdraid>        16       8      128       16      active sync   /dev/sdi
mdraid>        17      65      160       17      active sync   /dev/sdaa
mdraid>        18       8      176       18      active sync   /dev/sdl
mdraid>        19      65      208       19      active sync   /dev/sdad
mdraid>        20       8      224       20      active sync   /dev/sdo

This all looks fine... but I'm thinking what you *should* have done instead is build a bunch of 2tb pairs, and them use LVM to span across them with a volume, then build your XFS filesystem ontop of that. This way you would have /dev/md1,2,3,4,5,6,7,8,9,10 all inside a VG, then you would use LVM to stripe across the pairs.

But that's water under the bridge now.

mdraid> As you can see the array-size is still 20TB.

mdraid> Just one second after starting the reshape operation mdraid> XFS failed with the following messages:

I *think* the mdadm --grow did something, or XFS noticed the change in array size and grew on it's own. Can you provide the output of 'xfs_info /dev/md5' for us?

mdraid> # dmesg
mdraid> ...
mdraid> RAID10 conf printout:

mdraid>   --- wd:21 rd:21
mdraid>   disk 0, wo:0, o:1, dev:sdb
mdraid>   disk 1, wo:0, o:1, dev:sdt
mdraid>   disk 2, wo:0, o:1, dev:sde
mdraid>   disk 3, wo:0, o:1, dev:sdw
mdraid>   disk 4, wo:0, o:1, dev:sdh
mdraid>   disk 5, wo:0, o:1, dev:sdz
mdraid>   disk 6, wo:0, o:1, dev:sdk
mdraid>   disk 7, wo:0, o:1, dev:sdac
mdraid>   disk 8, wo:0, o:1, dev:sdn
mdraid>   disk 9, wo:0, o:1, dev:sdaf
mdraid>   disk 10, wo:0, o:1, dev:sdq
mdraid>   disk 11, wo:0, o:1, dev:sdai
mdraid>   disk 12, wo:0, o:1, dev:sdc
mdraid>   disk 13, wo:0, o:1, dev:sdu
mdraid>   disk 14, wo:0, o:1, dev:sdf
mdraid>   disk 15, wo:0, o:1, dev:sdx
mdraid>   disk 16, wo:0, o:1, dev:sdi
mdraid>   disk 17, wo:0, o:1, dev:sdaa
mdraid>   disk 18, wo:0, o:1, dev:sdl
mdraid>   disk 19, wo:0, o:1, dev:sdad
mdraid>   disk 20, wo:1, o:1, dev:sdo

mdraid> md: reshape of RAID array md5
mdraid> md: minimum _guaranteed_ speed: 1000 KB/sec/disk.
mdraid> md: using maximum available idle IO bandwidth (but not more than 200000 mdraid> KB/sec) for reshape.
mdraid> md: using 128k window, over a total of 19533829120k. mdraid> XFS (md5): metadata I/O error: block 0x12c08f360
mdraid> ("xfs_trans_read_buf_map") error 5 numblks 16
mdraid> XFS (md5): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. mdraid> XFS (md5): metadata I/O error: block 0x12c08f360
mdraid> ("xfs_trans_read_buf_map") error 5 numblks 16
mdraid> XFS (md5): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. mdraid> XFS (md5): metadata I/O error: block 0xebb62c00
mdraid> ("xfs_trans_read_buf_map") error 5 numblks 16
mdraid> XFS (md5): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5. mdraid> ...
mdraid> ... lots of the above messages deleted
mdraid> ...
mdraid> XFS (md5): xfs_do_force_shutdown(0x1) called from line 138 of file mdraid> fs/xfs/xfs_bmap_util.c. Return address = 0xffffffff8113908f mdraid> XFS (md5): metadata I/O error: block 0x48c710b00 ("xlog_iodone") error 5 mdraid> numblks 64
mdraid> XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file mdraid> fs/xfs/xfs_log.c. Return address = 0xffffffff8117cdf4 mdraid> XFS (md5): Log I/O Error Detected. Shutting down filesystem mdraid> XFS (md5): Please umount the filesystem and rectify the problem(s) mdraid> XFS (md5): metadata I/O error: block 0x48c710b40 ("xlog_iodone") error 5 mdraid> numblks 64
mdraid> XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file mdraid> fs/xfs/xfs_log.c. Return address = 0xffffffff8117cdf4 mdraid> XFS (md5): metadata I/O error: block 0x48c710b80 ("xlog_iodone") error 5 mdraid> numblks 64
mdraid> XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file mdraid> fs/xfs/xfs_log.c. Return address = 0xffffffff8117cdf4 mdraid> XFS (md5): metadata I/O error: block 0x48c710bc0 ("xlog_iodone") error 5 mdraid> numblks 64
mdraid> XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file mdraid> fs/xfs/xfs_log.c. Return address = 0xffffffff8117cdf4 mdraid> XFS (md5): metadata I/O error: block 0x48c710c00 ("xlog_iodone") error 5 mdraid> numblks 64
mdraid> XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file mdraid> fs/xfs/xfs_log.c. Return address = 0xffffffff8117cdf4 mdraid> XFS (md5): metadata I/O error: block 0x48c710c40 ("xlog_iodone") error 5 mdraid> numblks 64
mdraid> XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file mdraid> fs/xfs/xfs_log.c. Return address = 0xffffffff8117cdf4 mdraid> XFS (md5): metadata I/O error: block 0x48c710c80 ("xlog_iodone") error 5 mdraid> numblks 64
mdraid> XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file mdraid> fs/xfs/xfs_log.c. Return address = 0xffffffff8117cdf4 mdraid> XFS (md5): metadata I/O error: block 0x48c710cc0 ("xlog_iodone") error 5 mdraid> numblks 64
mdraid> XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file mdraid> fs/xfs/xfs_log.c. Return address = 0xffffffff8117cdf4 mdraid> XFS (md5): I/O Error Detected. Shutting down filesystem

mdraid> I did an "umount /dev/md5" and now I'm wondering what my options are:

What does 'xfs_fsck -n /dev/md5' say?

mdraid> Should I wait until the reshape has finisched? I assume yes mdraid> since stopping that operation will most likely make things mdraid> worse. Unfortunately reshaping a 20TB RAID10 to 21TB will mdraid> last about 10 hours but it's saturday and I have approx. 40 mdraid> hours to fix the problem until monday morning.

Are you still having the problem?

mdraid> Should I reduce array-size back to 20 disks?

I don't think so.

mdraid> My plans are to run xfs_check first, maybe followed by mdraid> xfs_repair and see what happens.

Talk to the XFS folks first, before you do anything!

mdraid> Any other suggestions?

mdraid> Do you have an explanation why reshaping a RAID10 with a running mdraid> ext3 filesystem does work while a running XFS-filesystems fails during mdraid> a reshape?

mdraid> How did the XFS-filesystem notice that a reshape was running? I was mdraid> sure that during the reshape operation every single block of the RAID10 mdraid> device could be read or written no matter wether it belongs to the part mdraid> of the RAID that was already reshaped or not. Obviously that's working mdraid> in theory only - or with ext3-filesystems only.

mdraid> Or was i totally wrong with my assumption?

mdraid> Much thanks in advance for any assistance.

mdraid> Peter Koch

mdraid> --
mdraid> To unsubscribe from this list: send the line "unsubscribe linux-raid" in mdraid> the body of a message to [email protected]
mdraid> More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to [email protected]
Quoted 9 lines · On Sat, Jan 06, 2018 at 04:44:12PM +0100, [email protected] wrote:

Now today I increased the RAID10 again from 20 to 21 disks with the following commands:

mdadm /dev/md5 --add /dev/sdo
mdadm --grow /dev/md5 --raid-devices=21

Just one second after starting the reshape operation XFS failed with the following messages:

Quoted 7 lines

md: reshape of RAID array md5
md: minimum _guaranteed_ speed: 1000 KB/sec/disk.
md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reshape.
md: using 128k window, over a total of 19533829120k.
XFS (md5): metadata I/O error: block 0x12c08f360 ("xfs_trans_read_buf_map") error 5 numblks 16

Ouch. No idea what happened there.

Use overlays to try to recover. Don't write anymore.

https://raid.wiki.kernel.org/index.php/Recovering_a_failed_software_RAID#Making_the_harddisks_read-only_using_an_overlay_file

I tried to reproduce your problem, created a 20 drive RAID, and a while loop to grow to 21 drives, then shrink back to 20.

    truncate -s 100M {001..021}
    losetup ...
    mdadm --create /dev/md42 --level=10 --raid-devices=20 /dev/loop{1..20}
    mdadm --grow /dev/md42 --add /dev/loop21

    while :
    do
        mdadm --wait /dev/md42
        mdadm --grow /dev/md42 --raid-devices=21
        mdadm --wait /dev/md42
        mdadm --grow /dev/md42 --array-size 1013760
        mdadm --wait /dev/md42
        mdadm --grow /dev/md42 --raid-devices=20
    done

Then I put XFS on top and another while loop to extract a Linux tarball.

    while :
    do
        tar xf linux-4.13.4.tar.xz
        sync
        rm -rf linux-4.13.4
        sync
    done

Both running in parallel ad infinitum.

I couldn't get the XFS to corrupt.

mdadm itself eventually died though.

Told me two drives failed though none did and would refuse to continue the grow operation. Unless I'm missing something, the degraded counter seems to have gone out of whack. There was nothing in dmesg.

# cat /sys/block/md42/md/degraded 
2
# cat /proc/mdstat 
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] 
md42 : active raid10 loop20[19] loop19[18] loop18[17] loop17[16] loop16[15] loop15[14] loop14[13] loop13[12] loop12[11] loop11[10] loop10[9] loop9[8] loop8[7] loop7[6] loop6[5] loop5[4] loop4[3] loop3[2] loop2[1] loop1[0]
      1013760 blocks super 1.2 512K chunks 2 near-copies [20/18] [UUUUUUUUUUUUUUUUUUUU]

Stopping and re-assembling and degraded went back to 0.

# cat /proc/mdstat 
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] 
md42 : active raid10 loop1[0] loop20[19] loop19[18] loop18[17] loop17[16] loop16[15] loop15[14] loop14[13] loop13[12] loop12[11] loop11[10] loop10[9] loop9[8] loop8[7] loop7[6] loop6[5] loop5[4] loop4[3] loop3[2] loop2[1]
      1013760 blocks super 1.2 512K chunks 2 near-copies [20/20] [UUUUUUUUUUUUUUUUUUUU]

But this should be unrelated to your issue.
No idea what happened to you.
Sorry.

Regards
Andreas Klauer

#3 lore raw
In reply to [email protected]
Quoted 4 lines · On 01/06/2018 11:44 PM, [email protected] wrote:

Dear MD-experts:

I was under the impression that growing a RAID10 device could be done with an active filesystem running on the device.

It depends on whether the specific filesystem provides related tool or not, eg, resize2fs can serve ext fs:

https://raid.wiki.kernel.org/index.php/Growing#Extending_the_filesystem

And you can use xfs_growfs for your purpose.

Quoted 71 lines

I did this a couple of times when I added additional 2TB disks to our production RAID10 running an ext3 Filesystem. That was a very time consuming process and we had to use the filesystem during the reshape.

When I increased the size of the RAID10 from 16 to 20 2TB-disks I could not use ext3 anymore due to the 16TB maimum size limitation of ext3 and I replaced the ext3 filesystem by xfs.

Now today I increased the RAID10 again from 20 to 21 disks with the following commands:

mdadm /dev/md5 --add /dev/sdo
mdadm --grow /dev/md5 --raid-devices=21

My plans were to add another disk after that and then grow the XFS-filesystem. I do not add multiple disks at once since its hard to predict which disk will end up in what disk-set

Here's mdadm -D /dev/md5 output:
/dev/md5:
        Version : 1.2
  Creation Time : Sun Feb 10 16:58:10 2013
     Raid Level : raid10
     Array Size : 19533829120 (18628.91 GiB 20002.64 GB) Used Dev Size : 1953382912 (1862.89 GiB 2000.26 GB) Raid Devices : 21
  Total Devices : 21
    Persistence : Superblock is persistent

    Update Time : Sat Jan  6 15:08:37 2018
          State : clean, reshaping
 Active Devices : 21
Working Devices : 21
 Failed Devices : 0
  Spare Devices : 0

         Layout : near=2
     Chunk Size : 512K

 Reshape Status : 1% complete
  Delta Devices : 1, (20->21)

           Name : backup:5  (local to host backup) UUID : 9030ff07:6a292a3c:26589a26:8c92a488 Events : 86002

    Number   Major   Minor   RaidDevice State
       0       8       16        0      active sync   /dev/sdb 1      65       48        1      active sync   /dev/sdt 2       8       64        2      active sync   /dev/sde 3      65       96        3      active sync   /dev/sdw 4       8      112        4      active sync   /dev/sdh 5      65      144        5      active sync   /dev/sdz 6       8      160        6      active sync   /dev/sdk 7      65      192        7      active sync   /dev/sdac 8       8      208        8      active sync   /dev/sdn 9      65      240        9      active sync   /dev/sdaf 10      65        0       10      active sync   /dev/sdq 11      66       32       11      active sync   /dev/sdai 12       8       32       12      active sync   /dev/sdc 13      65       64       13      active sync   /dev/sdu 14       8       80       14      active sync   /dev/sdf 15      65      112       15      active sync   /dev/sdx 16       8      128       16      active sync   /dev/sdi 17      65      160       17      active sync   /dev/sdaa 18       8      176       18      active sync   /dev/sdl 19      65      208       19      active sync   /dev/sdad 20       8      224       20      active sync   /dev/sdo

Quoted 1 line

As you can see the array-size is still 20TB.

Because the reshaping is not finished yet.

Quoted 54 lines

Just one second after starting the reshape operation XFS failed with the following messages:

# dmesg
...
RAID10 conf printout:
 --- wd:21 rd:21
 disk 0, wo:0, o:1, dev:sdb
 disk 1, wo:0, o:1, dev:sdt
 disk 2, wo:0, o:1, dev:sde
 disk 3, wo:0, o:1, dev:sdw
 disk 4, wo:0, o:1, dev:sdh
 disk 5, wo:0, o:1, dev:sdz
 disk 6, wo:0, o:1, dev:sdk
 disk 7, wo:0, o:1, dev:sdac
 disk 8, wo:0, o:1, dev:sdn
 disk 9, wo:0, o:1, dev:sdaf
 disk 10, wo:0, o:1, dev:sdq
 disk 11, wo:0, o:1, dev:sdai
 disk 12, wo:0, o:1, dev:sdc
 disk 13, wo:0, o:1, dev:sdu
 disk 14, wo:0, o:1, dev:sdf
 disk 15, wo:0, o:1, dev:sdx
 disk 16, wo:0, o:1, dev:sdi
 disk 17, wo:0, o:1, dev:sdaa
 disk 18, wo:0, o:1, dev:sdl
 disk 19, wo:0, o:1, dev:sdad
 disk 20, wo:1, o:1, dev:sdo
md: reshape of RAID array md5
md: minimum _guaranteed_  speed: 1000 KB/sec/disk.
md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reshape.
md: using 128k window, over a total of 19533829120k.
XFS (md5): metadata I/O error: block 0x12c08f360 ("xfs_trans_read_buf_map") error 5 numblks 16
XFS (md5): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5.
XFS (md5): metadata I/O error: block 0x12c08f360 ("xfs_trans_read_buf_map") error 5 numblks 16
XFS (md5): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5.
XFS (md5): metadata I/O error: block 0xebb62c00 ("xfs_trans_read_buf_map") error 5 numblks 16
XFS (md5): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5.
...
... lots of the above messages deleted
...
XFS (md5): xfs_do_force_shutdown(0x1) called from line 138 of file fs/xfs/xfs_bmap_util.c.  Return address = 0xffffffff8113908f
XFS (md5): metadata I/O error: block 0x48c710b00 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): Log I/O Error Detected.  Shutting down filesystem
XFS (md5): Please umount the filesystem and rectify the problem(s)
XFS (md5): metadata I/O error: block 0x48c710b40 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): metadata I/O error: block 0x48c710b80 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): metadata I/O error: block 0x48c710bc0 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): metadata I/O error: block 0x48c710c00 ("xlog_iodone") error 5 numblks 64
Quoted 8 lines
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): metadata I/O error: block 0x48c710c40 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): metadata I/O error: block 0x48c710c80 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): metadata I/O error: block 0x48c710cc0 ("xlog_iodone") error 5 numblks 64
XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
XFS (md5): I/O Error Detected. Shutting down filesystem

I guess the IOs from xfs were competing with the md internal IO, not good.

Quoted 1 line

I did an "umount /dev/md5" and now I'm wondering what my options are:

Though xfs file systems can be grown while mounted, it is better to umount it first if md reshaping is in progress.

Quoted 15 lines

Should I wait until the reshape has finisched? I assume yes since stopping that operation will most likely make things worse. Unfortunately reshaping a 20TB RAID10 to 21TB will last about
10 hours but it's saturday and I have approx. 40 hours to fix the problem until monday morning.

Should I reduce array-size back to 20 disks?

My plans are to run xfs_check first, maybe followed by xfs_repair and see what happens.

Any other suggestions?

Do you have an explanation why reshaping a RAID10 with a running ext3 filesystem does work while a running XFS-filesystems fails during a reshape?

Quoted 5 lines

How did the XFS-filesystem notice that a reshape was running? I was sure that during the reshape operation every single block of the RAID10 device could be read or written no matter wether it belongs to the part of the RAID that was already reshaped or not. Obviously that's working in theory only - or with ext3-filesystems only.

If the IO from fs could conflict with reshape IO, then it could be trouble, so again, it is more safer to umount fs first before reshaping, my 0.02$.

Thanks,
Guoqing

#4 lore raw
Quoted 11 lines · Guoqing Jiang
Quoted 4 lines · On 01/06/2018 11:44 PM, [email protected] wrote:

Dear MD-experts:

I was under the impression that growing a RAID10 device could be done with an active filesystem running on the device.

It depends on whether the specific filesystem provides related tool or not, eg,
resize2fs can serve ext fs:

Sorry Guoqing, but I think you've *completely* missed the point :-(

Quoted 4 lines

https://raid.wiki.kernel.org/index.php/Growing#Extending_the_filesystem

And you can use xfs_growfs for your purpose.

You extend the filesystem *after* you've grown the array. The act of growing the array has caused the filesystem to crash. That should NOT happen - the act of growing the array should be *invisible* to the filesystem.

In other words, one or more of the following three are true :-
1) The OP has been caught by some random act of God
2) There's a serious flaw in "mdadm --grow"
3) There's a serious flaw in xfs

Cheers,
Wol

#5 lore raw

Am 08.01.2018 um 16:16 schrieb Wols Lists:

Quoted 10 lines · Guoqing Jiang
Quoted 3 lines

https://raid.wiki.kernel.org/index.php/Growing#Extending_the_filesystem

And you can use xfs_growfs for your purpose.

You extend the filesystem *after* you've grown the array. The act of growing the array has caused the filesystem to crash. That should NOT happen - the act of growing the array should be *invisible* to the filesystem.

Quoted 4 lines

In other words, one or more of the following three are true :-
1) The OP has been caught by some random act of God
2) There's a serious flaw in "mdadm --grow"
3) There's a serious flaw in xfs

3) should not be possible because as long 2) is running the filesystem should not know that anything is changing at all - even "should" is the wrong word: MUST NOT

#6 lore raw
In reply to Wols Lists

Dear Wol,

Quoted 5 lines · In message <[email protected]> you wrote:

You extend the filesystem *after* you've grown the array. The act of growing the array has caused the filesystem to crash. That should NOT happen - the act of growing the array should be *invisible* to the filesystem.

Not if this causes any hard I/O errors...

Quoted 4 lines

In other words, one or more of the following three are true :-
1) The OP has been caught by some random act of God
2) There's a serious flaw in "mdadm --grow"
3) There's a serious flaw in xfs

The original log contained this:

| XFS (md5): metadata I/O error: block 0x12c08f360
| ("xfs_trans_read_buf_map") error 5 numblks 16
| XFS (md5): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5.
| XFS (md5): metadata I/O error: block 0x12c08f360
| ("xfs_trans_read_buf_map") error 5 numblks 16
| XFS (md5): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5.
| XFS (md5): metadata I/O error: block 0xebb62c00
| ("xfs_trans_read_buf_map") error 5 numblks 16
| XFS (md5): xfs_imap_to_bp: xfs_trans_read_buf() returned error 5.
| ...
| ... lots of the above messages deleted
| ...
| XFS (md5): xfs_do_force_shutdown(0x1) called from line 138 of file
| fs/xfs/xfs_bmap_util.c.  Return address = 0xffffffff8113908f
| XFS (md5): metadata I/O error: block 0x48c710b00 ("xlog_iodone") error 5
| numblks 64
| XFS (md5): xfs_do_force_shutdown(0x2) called from line 1170 of file
| fs/xfs/xfs_log.c.  Return address = 0xffffffff8117cdf4
| XFS (md5): Log I/O Error Detected.  Shutting down filesystem

To me this looks as if during the growing of the array some hard I/O errors happenend. That may have been triggered by the growing of the array. but only as fas as it caused additional disk load / reading of otherwise idle areas.

I cannot see any indications for 2) or 3) here, so yes, it was 1), if you consider spurious I/O aerrors as such.

Or am I missing soething else?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected]
Experience is that marvelous thing that enable  you  to  recognize  a
mistake when you make it again.                   - Franklin P. Jones
#7 lore raw
In reply to Wols Lists
Quoted 11 lines · Wols Lists
Quoted 9 lines · Guoqing Jiang
Quoted 4 lines · On 01/06/2018 11:44 PM, [email protected] wrote:

Dear MD-experts:

I was under the impression that growing a RAID10 device could be done with an active filesystem running on the device.

It depends on whether the specific filesystem provides related tool or not, eg,
resize2fs can serve ext fs:

Sorry Guoqing, but I think you've *completely* missed the point :-(

Yes, I just want to point is it is more safer to umount fs first, then do the reshape. There is another deadlock issue which mentioned by BingJing, it happened during reshape stage while some I/O come from vfs layer, though it is not the same issue,

Quoted 8 lines
Quoted 3 lines

https://raid.wiki.kernel.org/index.php/Growing#Extending_the_filesystem

And you can use xfs_growfs for your purpose.

You extend the filesystem *after* you've grown the array. The act of growing the array has caused the filesystem to crash. That should NOT happen - the act of growing the array should be *invisible* to the filesystem.

Quoted 4 lines

In other words, one or more of the following three are true :-
1) The OP has been caught by some random act of God
2) There's a serious flaw in "mdadm --grow"
3) There's a serious flaw in xfs

IMHO, there could be potential issue inside raid10/5, so I choose 2. Anyway, I will try to simulate the scenario and see what will happen ...

Thanks,
Guoqing