mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-05 20:48:22 +00:00
05998224d8
Before, a repository would maintain an index file (named 'index') per repository, that contained the current snapshots in the repository. This file was not atomically written, so repositories had to depend on listing the blobs in the repository to determine what the current snapshots are, and only rely on the index file if the repository does not support the listBlobs operation. This could cause an incorrect view of the current snapshots in the repository if any prior snapshot delete operations failed to delete snapshot metadata files. This commit introduces the atomic writing of the index file, and because atomic writes are not guaranteed if the file already exists, we write to a generational index file (index-N, where N is the current generation). We also maintain an index-latest file that contains the current generation, for those repositories that cannot list blobs. Closes #19002 Relates #18156