Is snapshot incremental?

They are incremental file by file. The files in the underlying Lucene indexes are immutable and when they are snapshotted they are not re-saved if they already exist in the snapshot. This is safe because they are only cleaned up when they are not used by any snapshots.

So they aren't truly incremental which is what allows you to delete the old snapshots but they won't redo the same work twice. Mostly.

New files are created in the underlying lucene index to handle new documents, deletes, and updates. If the index doesn't change at all then the old files will still be there and the snapshot won't take up much space. If there are just new documents most of the old files should still be there with some new ones so the snapshot should seem incremental. But sometimes indexing new documents ends up causes merges which replace the old files with new ones. In those times it'll seem much less incremental.

It works this way because its the easiest way to implement something incremental-like and allow removing old snapshots. It makes restores fast as well. In many ways its genius but it makes it complex to explain the sizes of the data.

1 Like