Replication of snapshots: only latest is replicated

DD4711

Contributor
Joined
Nov 19, 2018
Messages
102
Hello,
I use snapshots on my main storage. There are 10 snapshots available. This main storage is replicated to a backup storage located on a USB HDD. I checked "Recursively Replicate Child Dataset Snapshots" and "Delete Stale Snapshots on Remote System" in the replication options.

So I expect I'll find all my snapshots from main storage also on backup storage. But it isn't the case. I can only find newest snapshot there.

Is this normal or don't I understand something regarding replication?

Thanks for help :)
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
You need to provide a bit more information about your setup.
What do you mean by
There are 10 snapshots available
?
Are you performing periodic snapshots and if so what is the snapshot lifetime and how often does it occur?
How many dataset do you have? If automatic snapshot of the pool contains dataset, the pool itself and all the existing Datasets should have one snapshot taken every time the automatic snapshot takes place.

If you are replicating to another Freenas box over LAN where your backup USB drive is connected, make sure the Freenas backup as the clock set correctly.
 

DD4711

Contributor
Joined
Nov 19, 2018
Messages
102
Hello Apollo,

thanks for your answer.

On main storage I have set a periodic snapshot task. There are currently 10 snapshots made by this task. I can see this in Storage/Snapshots and in the corresponding .zfs folder. The task is configured to make a snapshot once a week, snapshot lifetime 2 months.

I have ~20 datasets. Yes, every dataset has it's own snapshot.

The replication is made to a pool on a USB HDD on the same FreeNAS.

I expect all available snapshots on main storage also on my backup storage. This is set in my replication task config, see above.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
So what you are saying is that you have about 10 snapshots present per dataset, right?
What you are also saying is that on the USB HDD, you can only find the newest snapshots. Does it mean you only see only one snapshot for the dataset and it is the most recent one? or do you see all 8/10 of them per dataset?
How do you check for the presence of snapshots? Are you browsing over SMB to the .zfs folder?
 

DD4711

Contributor
Joined
Nov 19, 2018
Messages
102
10 times snapshots were taken, so I have 10 snapshhots per dataset.

dataset mainstorage/data has a .zfs folder with 10 snapshots, auto-20190114.2223-2m and 9 made before that.
dataset backupstorage/data (where replication goes to) has a .zfs folder with 1 snapshot, only auto-20190114.2223-2m. Yes, I see only one snapshot, which is replicated to this place.

As told I browse to the corresponding .zfs folder. Same is displayed in FreeNAS under Storage/Snapshots.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
It doesn't make sense.
Having once a week snapshot isn't really a good thing unless you rarely write to the dataset often.
For sanity check, you should be able to create another automatic recursive snapshot at a 5 minutes interval and make it last 1 or 2 days.
Then check back the result of the replication.
I am curious whether or not the replication is wiping the dataset on the backup and create it from the last one.
Once the snapshots have been replicated, see if you get the same behavior. If so, try disabling the option about "Delete Stale snapshot on Remote".
 

DD4711

Contributor
Joined
Nov 19, 2018
Messages
102
Hello @Apollo ,

I think it isn't really relevant for the problem how often snapshots are done.

I'll make a sanity check as recommended and will post my results.

As described in user guide and in replication task config a replication replicates all available data and snapshots - and it will delete not anymore available target snaphsot in source (when setting it up like in my case).
 

DD4711

Contributor
Joined
Nov 19, 2018
Messages
102
Hello @Apollo ,

now it works good. I edited my snapshot task and make daily snapshots with 4 weeks retention. Replication is now OK, all made snapshots are also in backup. I have no idea why it works now, maybe just editing the task did the trick?!
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Good.
If you only have a 4 weeks retention, make sure you will be able to replicate within the 4 weeks time frame.
 

iseebirdsfly

Cadet
Joined
Sep 26, 2017
Messages
4
I have no idea why it works now, maybe just editing the task did the trick?!
As Apollo pointed you need to make replication while same snapshot is still available on your main and on your backup. If you miss that period and snapshot gets deleted on main then replication will do full backup (instead of snapshots) and will skip old snapshots.
You can also make multiple snapshot tasks with different retention, for example daily snapshot with 1 week retention, weekly with 4 week retention and monthly with 6 month retention. You only need 1 common snapshot to be able to do incremental backups so this way you would have 6 months.
 

DD4711

Contributor
Joined
Nov 19, 2018
Messages
102
@iseebirdsfly
thanks for that! Multiple snapshot tasks are a good idea!

Regarding my main problem: I had the situation that on my source snapshots were available but haven't been transferred to destination. Snapshots are existent or deleted. If deleted / not anymore available they're for sure not transferred.
 
Top