-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Batch Snapshot Finalizations #82824
Copy link
Copy link
Open
Labels
:Distributed/Snapshot/RestoreAnything directly related to the `_snapshot/*` APIsAnything directly related to the `_snapshot/*` APIs>enhancementTeam:DistributedMeta label for distributed team.Meta label for distributed team.
Metadata
Metadata
Assignees
Labels
:Distributed/Snapshot/RestoreAnything directly related to the `_snapshot/*` APIsAnything directly related to the `_snapshot/*` APIs>enhancementTeam:DistributedMeta label for distributed team.Meta label for distributed team.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Snapshot finalization happens snapshot-by-snapshot at the moment and involves a sequence of:
This means that finalizing a snapshot (even a single index one) in the real world probably takes more than a second to finalize.
So far this was a non-issue but in the context of #77466 it's becoming one.
For one, setting up a benchmark cluster containing a large number of single index snapshots take significant amounts of time.
More importantly though, it means that ILM policies that move an index to frozen tier cannot efficiently execute moving multiple indices simultaneously and could queue up many minutes of work from finalising single index snapshots which means that SLM backups as well as snapshot delete jobs will be delayed for a non-trivial period of time as well.
In extreme but conceivable cases like moving 1k snapshots to the frozen tier this could mean running finalisations for an hour or more.
To fix this we should batch multiple waiting finalisations into one in
SnapshotsServiceand the repository. This will allow finalising multiple snapshots within the sameRepositoryDatawrite as well as the same two cluster state updates for the repo generation tracking. All the global metadata writes and index metadata writes as well as thesnap-$uuidblob writes can still happen exactly as they do today.