bolthole / zrep

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

Intermediate snapshots are not synced when using ZREP_TAG / -t #168

Closed t-oster closed 3 years ago

t-oster commented 3 years ago

Hi,

I just tested the following:

The remotepool/test contains @custom and @custom2, aswell as zrep and zrep-customtag snapshots as expected. However remotepool/test2 only contains the @zrep-customtag snapshots, but neither @custom nor @zrep snapshots.

Is that expected behavior? I'd expect at least all intermediate snapshots to be synced like it is without the -t parameter.

ppbrown commented 3 years ago

interesting. that is not something i usually concern myself with since that is behaviour of underlying zfs implementation. One has to deal with what one is given :) if you find a zfs flag that triggers behaviour more like you want, please let me know, and i can figure out the best way to allow it in zrep. possibly there may be an extra flag usable at initial (second init) snapshot creation time.

On Tue, May 4, 2021 at 1:26 AM Thomas Oster @.***> wrote:

Hi,

I just tested the following:

  • zrep -i mypool/test myremote remotepool/test
  • zfs snap @.***
  • zrep -S mypool/test
  • zrep -t zrep-customtag -i mypool/test myremote remotepool/test2
  • zfs snap @.***
  • zrep -S mypool/test
  • zrep -t zrep-customtag -S mypool/test

The remotepool/test contains @Custom https://github.com/Custom and @custom2, aswell as zrep and zrep-customtag snapshots as expected. However remotepool/test2 only contains the @zrep-customtag snapshots, but neither @Custom https://github.com/Custom nor @zrep https://github.com/zrep snapshots.

Is that expected behavior? I'd expect at least all intermediate snapshots to be synced like it is without the -t parameter.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bolthole/zrep/issues/168, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANEV6MYOJFWJ6NJIPXORW3TL6VSBANCNFSM44CIANBA .

t-oster commented 3 years ago

well... I guess this is inteded, as I found in the source:

# There are two types of zfs incremental snapshots.
#   The default incremental flag is -I. 
#   UNLESS you set ZREPTAG to something other than zrep, in which case
#   you will have multiple zrep snapshot names probably going to different
#   places, and expiration wont work properly on the remote sides
#   So we will autochange incremental type to -i. .. unless you explicitly 
#   set an override value for INC_FLAG in either case.
#   Probably should have named this INCR_FLAG, but it's in use now

so you are auto-changing -I to -i as soon as I set a tag and that's why the intermediate snapshots are ignored.