zpool replace of a top-level log device seems to trigger a resilver that scans
the whole pool. That's very different from what happens when the device is
removed and re-added.
I think that a full scan should not be needed given that the log device contains
ZIL blocks only from the current unsync-ed TXGs.
I think that the reason for the full scan is this code spa_vdev_attach():
/*
* Set newvd's DTL to [TXG_INITIAL, dtl_max_txg) so that we account
* for any dmu_sync-ed blocks. It will propagate upward when
* spa_vdev_exit() calls vdev_dtl_reassess().
*/
dtl_max_txg = txg + TXG_CONCURRENT_STATES;
vdev_dtl_dirty(newvd, DTL_MISSING, TXG_INITIAL,
dtl_max_txg - TXG_INITIAL);
I wonder if fixing the problem could be as easy as using 'txg' instead of
TXG_INITIAL in the case vdev_islog is true.
As far as I can tell txg is set to spa_last_synced_txg(spa) + 1.
What do you think?
Thank you!
--
Andriy Gapon
------------------------------------------
openzfs: openzfs-developer
Permalink:
https://openzfs.topicbox.com/groups/developer/Te6fad9972652421c-M770900762d3b490e7cd6814a
Delivery options: https://openzfs.topicbox.com/groups/developer/subscription