Skip to content

Conversation

@tlrx
Copy link
Member

@tlrx tlrx commented Feb 1, 2019

Backport of #38177 on 6.x.

…xisting indices (elastic#38177)

When restoring shards of existing indices, the RestoreService also
restores the values of primary terms stored in the snapshot index
metadata. The primary terms are not updated and could potentially
conflict with current index primary terms if the restored primary terms
are lower than the existing ones.

This situation is likely to happen with replicated closed indices
(because primary terms are increased when the index is transitioning
from open to closed state, and the snapshotted primary terms are the
one at the time the index was opened) (see elastic#38024) and maybe also
with CCR.

This commit changes the RestoreService so that it updates the primary
terms using the maximum value between the snapshotted values and
the existing values.

Backport elastic/elasticsearch@da6269b

Related to elastic#33888
@tlrx tlrx added :Distributed Indexing/Distributed A catch all label for anything in the Distributed Indexing Area. Please avoid if you can. backport labels Feb 1, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@tlrx tlrx merged commit 92d4287 into elastic:6.x Feb 1, 2019
@tlrx tlrx deleted the restore-service-and-primary-terms-6.x branch February 5, 2019 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport :Distributed Indexing/Distributed A catch all label for anything in the Distributed Indexing Area. Please avoid if you can.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants