ZFS Periodic Snapshots, Replication, and freenas:state

Status
Not open for further replies.

GregP

Dabbler
Joined
Mar 16, 2013
Messages
15
I am confused and need some help with understanding expiration of automatic recursive child snapshots in the context of replication.

Assume I have two identical freenas servers called freenas1 and freenas2. I have a ZFS volume on freenas1 with three child datasets, lets say: VRaidZwd has VRaidZwd/dsCIFS and VRaidZwd/dsAFP and VRaidZwd/dsAFP/TM2. (These datasets are served using samba and AFP onto the network.) I use the GUI to setup freenas1 daily Periodic Snapshots of VRaidZwd with a 7 day expiration date. I then set-up a replication task of VRaidZwd to freenas2 and set the "Recursively replicate and remove stale snapshot on remote side" checkbox.

On freenas1, if I DONT set the Recursive checkbox on the Periodic Snapshot task, the child datasets don't seem to replicate to freenas2 in a way that I can find them or mount.

If I DO set the Recursive checkbox on the Periodic Snapshot task on freenas1, I can find, mount, and serve read-only copies of the child datasets. But, on freenas1 -> the child dataset snapshots never get expire for deletion because their freenas:state never changes from 'NEW'. (I thought it was supposted to change to 'LATEST' and then '-' after successful replication.) Also, on freenas2 the replicated snapshots never expire or get deleted.

I read ticket #1455 and looked at fracai's python script as a possible solution. I thought this was a bug in the replication process but ticket #2094 seems to suggest that somehow snapshotting without recursion and replicating just the root volume VRaidZwd should somehow replicate the child datasets too. Beats me how to do it though.

SERVER ONE ---- with Recursive Automatic Snapshot of VRaidZwd set -> NEW state doesn't change on child datasets after replication
[root@freenas] ~# zfs list -Ht snapshot -o name,freenas:state
VRaidZwd@auto-20130319.0900-7d -
VRaidZwd@auto-20130320.0900-7d LATEST
VRaidZwd/dsAFP@auto-20130319.0900-7d NEW
VRaidZwd/dsAFP@auto-20130320.0900-7d NEW
VRaidZwd/dsAFP/TM2@auto-20130319.0900-7d NEW
VRaidZwd/dsAFP/TM2@auto-20130320.0900-7d NEW
VRaidZwd/dsCIFS@auto-20130319.0900-7d NEW
VRaidZwd/dsCIFS@auto-20130320.0900-7d NEW

SERVER TWO ----- replication of child datasets happens successfully
[root@freenas2] ~# zfs list -Ht snapshot -o name,freenas:state
VRaidZWd3Tb@auto-20130319.0900-7d -
VRaidZWd3Tb@auto-20130320.0900-7d -
VRaidZWd3Tb/dsAFP@auto-20130319.0900-7d -
VRaidZWd3Tb/dsAFP@auto-20130320.0900-7d -
VRaidZWd3Tb/dsAFP/TM2@auto-20130319.0900-7d -
VRaidZWd3Tb/dsAFP/TM2@auto-20130320.0900-7d -
VRaidZWd3Tb/dsCIFS@auto-20130319.0900-7d -
VRaidZWd3Tb/dsCIFS@auto-20130320.0900-7d -

[root@freenas2 ~]# ls /mnt/VRaidZWd3Tb
.ssh dsCIFS dsAFP


If I just snapshot VRaidZwd without checking the Recursive checkbox on the Periodic Snapshot task, I can't find any child dataset data on server2 after replication.
Server ONE
VRaidZwd@auto-20130319.0900-7d -
VRaidZwd@auto-20130320.0900-7d LATEST
ServerTWO
VRaidZWd3Tb@auto-20130319.0900-7d -
VRaidZWd3Tb@auto-20130320.0900-7d -

ServerTWO
ls /mnt/VRaidZWd3Tb
.ssh



 
Status
Not open for further replies.
Top