Re: [developer] What vdev is picked as leading in mirror resilver proces?

2021-12-20 Thread openzfs via openzfs-developer
Thanks Richard for explaining this. I have done a couple of tests some time ago 
(you can find these in this pastebin: https://8n1.org/20024/2eb4). Results from 
these tests were that even for vdevs that have newer data (and other data for 
that matter) than other vdevs, it does not guarantee that vdev will be picked 
as the source. And in a  2-way mirror there is only one vdev with the latest 
data / checksums. So, still not sure why this happens.
--
openzfs: openzfs-developer
Permalink: 
https://openzfs.topicbox.com/groups/developer/T7209b2fe172e98f1-M9103dec105590d3e260c8f6b
Delivery options: https://openzfs.topicbox.com/groups/developer/subscription


Re: [developer] What vdev is picked as leading in mirror resilver proces?

2021-12-20 Thread Richard Elling
First, resilvering is done at the dataset and snapshot layer (DSL) and not
the vdev layer.
Each txg commit has a monotonically increasing counter. So the dataset
knows what data
is written when. The resilver begins temporally at the oldest common time
(as determined by the
txg commit in the vdev's label) and progresses to the present. This is
commonly called "time
based resilvering" and is a good optimization for providing increased
reliability.

The source of the data (eg which vdev in a 3-way mirror) is determined by
the normal spreading
logic with the requirement that the blocks being resilvered have correct
checksums. So, unlike some
brain-dead RAID implementations (eg md-raid), there is no ambiguity about
where the correct
data lives.
 -- richard


On Mon, Dec 20, 2021 at 3:23 AM openzfs via openzfs-developer <
developer@lists.open-zfs.org> wrote:

> I have a question regarding ZFS mirror resilvering. Consider a mirror with
> two vdevs: disk A and B. Disk B is hot-removed. Data is written to mirror
> (only written to disk A). The host is powered off. Disk B is cold-attached
> to the host and booted again. Zpool is imported. What vdev of the mirror is
> leading in the resilver process? i.e. what data will prevail? Is this
> deterministic? ZFS version: zfs-0.8.3 (Ubuntu 20.04).
> *openzfs * / openzfs-developer / see
> discussions  + participants
>  + delivery options
>  Permalink
> 
>

--
openzfs: openzfs-developer
Permalink: 
https://openzfs.topicbox.com/groups/developer/T7209b2fe172e98f1-M9287fdd0fc18a6b32792194e
Delivery options: https://openzfs.topicbox.com/groups/developer/subscription


[developer] What vdev is picked as leading in mirror resilver proces?

2021-12-20 Thread openzfs via openzfs-developer
I have a 
question regarding ZFS mirror resilvering. Consider a mirror with two vdevs: 
disk A
 and B. Disk B is hot-removed. Data is written to mirror (only written 
to disk A). The host is powered off. Disk B is cold-attached to the host
 and booted again. Zpool is imported. What vdev of the mirror is 
leading in the resilver process? i.e. what data will prevail? Is this 
deterministic? ZFS version: zfs-0.8.3 (Ubuntu 20.04).
--
openzfs: openzfs-developer
Permalink: 
https://openzfs.topicbox.com/groups/developer/T7209b2fe172e98f1-Me3fa6b1f1c4793e3c7e1de4f
Delivery options: https://openzfs.topicbox.com/groups/developer/subscription