Commit a578608
authored
Delete persisted cold cache index if created in the future (elastic#120465)
The Lucene index used to store cold cache files information (to persist the
cold cache across node restarts) is upgraded at node startup, before the
cluster is formed.
This upgrade can become an issue if the node cannot join the cluster: an
attempt to downgrade the node back to the previous version will likely fail
due to this Lucene index being already upgraded. Ideally we would prefer
to upgrade the Lucene index after the node joined the cluster, but it requires
more work as this Lucene index can be queried concurrently during shard
allocation (see TransportSearchableSnapshotCacheStoresAction).
Instead of doing a more involved fix, this change deletes the persistent cache
index from disk if it detects that the Lucene index has been upgraded. It assumes
that we are already in a best effort downgrading procedure, so losing persistent
cache is acceptable in order to allow downgrading the node.1 parent c760d73 commit a578608
File tree
1 file changed
+10
-0
lines changed- x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/full
1 file changed
+10
-0
lines changedLines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
440 | 450 | | |
441 | 451 | | |
442 | 452 | | |
| |||
0 commit comments