bolthole / zrep

ZREP ZFS based replication and failover script from bolthole.com
Other
251 stars 57 forks source link

don't zrep_errquit in zrep_sync() while loop when using "all" #182

Closed crispyduck00 closed 2 years ago

crispyduck00 commented 2 years ago

When using zrep -S all zrep should not exit completely, when one fs is failing, instead it should try next one.

Playing around with don't sync on split brain, I found that zrep exits as soon as sync for one fs fails for what ever reason. So if using "all", and the first fs in the loop fails, all others are no more tried.

So i would suggest to use in the zrep_sync() while loop instead of "zrep_errquit" a "_errprint" followed by a "shift" and a "continue" to try the next fs in the loop.

And also in every function called by zrep_sync() instead of "zrep_errquit" a "_errprint" followed by a "return 1" so in _snapandsync, _sync, _expire,....

Okay, while I am writing this I see this is much more complicated as I thought.

Maybe it is easier calling zrep -S for each file system instead of using all which would require these changes.

ppbrown commented 2 years ago

I agree on calling them separately :)

people need to know when there is an error in the call. returning on first fail is the most reasonable thing to do in my opinion.

On Wed, Mar 9, 2022 at 6:33 AM crispyduck00 @.***> wrote:

When using zrep -S all zrep should not exit completely, when one fs is failing, instead it should try next one.

Playing around with don't sync on split brain, I found that zrep exits as soon as sync for one fs fails for what ever reason. So if using "all", and the first fs in the loop fails, all others are no more tried.

So i would suggest to use in the zrep_sync() while loop instead of "zrep_errquit" a "_errprint" followed by a "shift" and a "continue" to try the next fs in the loop.

And also in every function called by zrep_sync() instead of "zrep_errquit" a "_errprint" followed by a "return 1" so in _snapandsync, _sync, _expire,....

Okay, while I am writing this I see this is much more complicated as I thought.

Maybe it is easier calling zrep -S for each file system instead of using all which would require these changes.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you are subscribed to this thread.Message ID: @.***>

crispyduck00 commented 2 years ago

Jup! will call them separately.
Doing each fs separately when calling all would be nice, but yeah, "would be nice" so I think never/ever in the ksh version. ;-)