How does Truenas track snapshot age/deletion?

ddrucker

Dabbler
Joined
Feb 24, 2020
Messages
19
In Periodic Snapshot Tasks, you set a Snapshot Lifetime. Where is that lifetime actually stored?

Suppose I have weekly snapshots kept for 3 months and also hourly snapshots kept for a week. Both share the naming schema auto-%Y-%m-%d_%H-%M.

How does the system know which snapshots to remove when? It clearly knows and does it correctly; I'm just wondering about the mechanism.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
There was a thread around somewhere where it's discussed.

Going from memory, there are 2 answers:

1. For replication tasks, the management of snapshots according to the replication task settings is done by zettarepl (the tool used to actually do the replication).

2. For periodic snapshot tasks, the task itself (possibly together with the middleware) is doing the job... as far as we can tell.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Considering that snapshots have a property that keeps track of their creation date. I'd imagine it's just a simple date arithmetic from the creation date to the current date.
I think it's more complex than that as there are naming triggers... in fact I think in the other thread we came to the conclusion that it's not using the creation date (at least not in all cases).
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
I think it's more complex than that as there are naming triggers... in fact I think in the other thread we came to the conclusion that it's not using the creation date (at least not in all cases).
Ah that's interesting. Does the database come into play also?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
This is the thread I'm talking about (I think)


The last post by @winnielinnie covers it pretty well.
 
Top