I'm troubleshooting some disk issues with an embedded system, and about half the time when I reboot the SATA drive is missing. The device uses a ZFS mirror for the root partition and has one SATA drive and one NVME drive. Obviously when I reboot and the SATA drive is present it needs to resilver the mirror to update the drive with the new root contents.
How does ZFS choose which blocks/files to copy? Is it based on timestamps, or is there some kind of internal counter that is used to make sure new data isn't overwritten by old data?