Why does replication not start right away?

Status
Not open for further replies.

Sir.Robin

Guru
Joined
Apr 14, 2012
Messages
554
i have replication enabled and working. replication time is set to 02:00 - 03:00.

Now, if i wanna test something and i edit the timewindow to say 02:00 - 20:00
and current time is in this window, the replication tasks aren't executed automatically until 02:00 next night.

Why? Can i trigger it somehow? Reboot of the freenas doesn't seem to help either.

Is it triggered by the time of snapshot creation?

Edit:
So i finally figured out that the timewindow for replication has some sort of connection with the timewindow for the snapshot creation.

If i allow replication to occoure 00:00 - 23:59 as default, nothing happens.
But, if i change the snapshot creation timewindow too, so that current time is between both replication and snapshot timewindow, SSHD restarts, and replication occurs immediately, even if the snapshot was created hours ago :)
And so forth the replication occurs, as long as both timewindows is valid, immediately at snapshot creation time it seems.

Has anyone some explanation for me here? I know how to make it work, but i want to know why. :)
 

noprobs

Explorer
Joined
Aug 12, 2012
Messages
53
I think you have figured it out but the snapshot script is the key one. As it processes each periodic snapshot task it determines whether the snapshot needs to be replicated (is there a matching enabled replication task). If yes then it queues the snapshot for replication (attribute freenas:state set to NEW). After processing all snapshot tasks the snapshot script calls the replication task. The replication task looks for any snapshots for replication and if within replication window it sends them.

NB: Disabling a replication task stops snaps being queued for replication but (intentionally) does not stop queued snaps from being sent - if you think it should stop both (and others agree) then I will code the change for the maintainers to consider. There are also a couple of anomalies with the approach of autosnap calling autorepl scripts - this may get changed
 

Sir.Robin

Guru
Joined
Apr 14, 2012
Messages
554
Thank you for the explanation :)

As for the question, i'm not sure what i prefer. Haven't thought of it.

Usually i create snaps at night, and replicate at night. But when i need to test replication it certainly helps to know how it works :)
 
Status
Not open for further replies.
Top