Is snapshot restore incremental?

As we know, the snapshot process is incremental, so we can take snapshots frequently and It will be very fast after the first time。
My question is how restore work, When I restore snapshots in other clusters, is it incremental? and can I restore frequently?
thanks

Each snapshot is a full snapshot. The incremental aspect in it is that segments that have already been snapshotted are not copied again, so only new segments are copied after the first snapshot.

When you restore an index from a snapshot it is a complete index, not an increment.

So I want to incrementally synchronize indexes to other clusters every day,snapshot won't speed up this speed after the first time

They will. It's using an incremental method to build full backups at each run.

1 Like

Creating snapshots will speed up but you will need to restore complete indices.

You mean the second time I restore an index to another cluster will be faster than the first time?
What should I do?
first time,

POST /_snapshot/my_repository/snapshot_1/_restore
{
  "indices": "index1"
}

second time:

POST index1/_close

then:

POST /_snapshot/my_repository/snapshot_2/_restore
{
  "indices": "index1"
}

Suppose the gap between index1 in snapshot_1 and index1 in snapshot_2 is small,The second restore will be much faster than the first ?

Restoring will not be faster as the full index will need to be restored.

So if I want to incrementally synchronize data between clusters every data , use an incremental fields filter data(such as timestamp) to reindex to another cluster, is a better choice, right?

The best and easiest option is Cross Cluster Replication. But it's under a commercial license.

I don't remember how restore is working behind the scene. I thought that it would "just" restore the missing files and remove the non-needed. :person_shrugging:t4:

Yeah that's right, it will re-use any files on disk that match the ones in the snapshot rather than downloading them all again.

1 Like

The second time will be much faster than the first time?as restore is incremental?

@DavidTurner @Christian_Dahlqvist @dadoonet
So do we have a conclusion? A or B
A. restore is incremental,restore only recover the new segments;
B. restore is not incremental,restore need to recover the entire index every time。

I did not know it was possible/safe to restore an index from a snapshot over an existing index. If David says that is possible I would trust him.

I did a test and came to a conclusion:
restore is incremental
And i got the following through the recovery API:The reused part is reused
image
but, i have a new question now:What does file means here,I confirm that this is not the number of segments,beacuse this shard has only 9 segments but not 45

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.