-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZED needs to know the size of a device #2562
Comments
Good point. At the moment we assume any of the hot spares can be used to replace any other. I think we have two reasonable options here.
The first option feels like a more generic fix. But I think there's a decent argument to be made that there's no reason to include hot spares which can't be used in the posted spares list. That would keep the scripts simple which I think is a good thing. |
I'm not againt that philosohy (there's a reason those two were replaced :). But... They still work and have a lot more to offer... Feels ... 'saad' just to throw them away :D. But regardless, knowing how big the failed disk is, still seem prudent - double checking that the spare is big enough before doing the replace (instead of 'willy-nilly' attempt the replace and then possibly have a failure...)? So the code is mostly there anyway... |
You can add the 1.5TB drives as spares, but they can't be used to replace a 3TB drive failure. They'd only work for your other 1.5TB drives in the pool. I was suggesting restricting the spares list to drives which could be used as a replacement for the failed device. |
@behlendorf Remove tag "Bug" and instead add "Feature"? |
Done, that's reasonable. |
Where would the vdev size be? I've tried |
There's seems to be an even better candidate in |
Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
@FransUrbo You want |
|
Might as well. You should only need |
|
Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
Turns out it's not me. It's also (not) in
So the code is probably working, I just don't seem to have the possibility to test it further. |
… vdev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
… vdev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
… vdev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
… vdev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
… vdev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
… vdev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
… vdev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
…ev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
…ev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
…ev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
…ev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
…ev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
…ev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
…ev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
…ev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
…ev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
…ev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
…ev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
…ev_path is set. Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
Signed-off-by: Turbo Fredriksson <turbo@bayour.com> Closes: openzfs#2562
Sorry to revive such an old issue, but i have and old pool that could suffer from this:
A lot has changed in ZED (with 976246f This seems to work just fine. From a test box (DISK[N] are 10GB virtio disks, DISKSMALL[N] 5GB disks):
ZED tries to replace the failing disk with every spare:
While it's true this can be optimized to only attempt "valid" spares i think we have another, more important, issue to address: i took the previous example and changed virtio-DISK2 phys block size from 512b to 4K, also bumping its size to 11GB: Snippet from
The pool remains without redundancy, because we attempted to replace "virtio-DISK0" (512b, 10GB) with "virtio-DISK2" (4K, 11GB) without specifying a custom ashift value:
Replacing the disk manually works if we override ashift value from the command line:
Tested on 62df1bc. |
* Teach ZED to handle spares usingi the configured ashift: if the zpool 'ashift' property is set then ZED should use its value when kicking in a hotspare; with this change 512e disks can be used as spares for VDEVs that were created with ashift=9, even if ZFS natively detects them as 4K block devices. * Introduce an additional auto_spare test case which verifies that in the face of multiple device failures an appropiate number of spares are kicked in. * Fix zed_stop() in "libtest.shlib" which did not correctly wait the target pid. * Fix ZED crashing on startup caused by a race condition in libzfs when used in multi-threaded context. * Convert ZED over to using the tpool library which is already present in the Illumos FMA code. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes openzfs#2562 Closes openzfs#6858
* Teach ZED to handle spares usingi the configured ashift: if the zpool 'ashift' property is set then ZED should use its value when kicking in a hotspare; with this change 512e disks can be used as spares for VDEVs that were created with ashift=9, even if ZFS natively detects them as 4K block devices. * Introduce an additional auto_spare test case which verifies that in the face of multiple device failures an appropiate number of spares are kicked in. * Fix zed_stop() in "libtest.shlib" which did not correctly wait the target pid. * Fix ZED crashing on startup caused by a race condition in libzfs when used in multi-threaded context. * Convert ZED over to using the tpool library which is already present in the Illumos FMA code. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes openzfs#2562 Closes openzfs#6858
* Teach ZED to handle spares usingi the configured ashift: if the zpool 'ashift' property is set then ZED should use its value when kicking in a hotspare; with this change 512e disks can be used as spares for VDEVs that were created with ashift=9, even if ZFS natively detects them as 4K block devices. * Introduce an additional auto_spare test case which verifies that in the face of multiple device failures an appropiate number of spares are kicked in. * Fix zed_stop() in "libtest.shlib" which did not correctly wait the target pid. * Fix ZED crashing on startup caused by a race condition in libzfs when used in multi-threaded context. * Convert ZED over to using the tpool library which is already present in the Illumos FMA code. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> Closes openzfs#2562 Closes openzfs#6858
I have a pool with disks of two sizes - 1.5TB and 3TB disks. The 1.5TB disks will eventually be replaced, but for now two VDEVs with 3x3TB and 3 VDEVs with 3x1.5TB. I have two spare 1.5TB disks, so I added them as spares.
Unfortunately, at the moment, ZED is unable to figure out which disk to use when replacing a failed device, it does a round robin attempt.
Playing with this on a test environment, I came up with:
And then in the
for spare ...
loop:The
orig_size
will never (?) contain a value though, because the device have been removed.So ZED needs to receive a
ZEVENT_VDEV_SIZE
which we could compare with, and if ...., well that's as far as I've got.The text was updated successfully, but these errors were encountered: