-
Notifications
You must be signed in to change notification settings - Fork 24.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update global checkpoint when increasing primary term on replica #25422
Update global checkpoint when increasing primary term on replica #25422
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a question and one comment.
@@ -2072,6 +2084,13 @@ public void onResponse(final Releasable releasable) { | |||
primaryTerm); | |||
onPermitAcquired.onFailure(new IllegalStateException(message)); | |||
} else { | |||
try { | |||
updateGlobalCheckpointOnReplica(globalCheckpoint); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth skipping this update if the update on term increase was successful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found it easier to just do the "double"-update than introducing a boolean. Do you have a preference?
@@ -354,7 +354,7 @@ public String toString() { | |||
private void ensureRefCount() { | |||
if (refCount() <= 0) { | |||
throw new ElasticsearchException("RecoveryStatus is used but it's refcount is 0. Probably a mismatch between incRef/decRef " + | |||
"calls"); | |||
"calls"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes in this file look cosmetic, can they be reverted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks @jasontedor |
* master: Do not swallow exception when relocating Docs: Fix typo for request cache (elastic#25444) Remove implicit 32-bit support [DOCS] reworded to prevent code span rendering glitch (elastic#25442) Disallow multiple concurrent recovery attempts for same target shard (elastic#25428) Update global checkpoint when increasing primary term on replica (elastic#25422) Add backwards compatibility indices for 5.4.3 Add version 5.4.3 after release Update MSI installer images (elastic#25414) Add missing newline at end of SetsTests.java Rename handoff primary context transport handler correct expected thrown exception in mappingMetaData to ElasticsearchParseException (elastic#25410) test: Make many percolator integration tests real integration tests [DOCS] Update docs to use shared attribute file (elastic#25403) Add Javadocs and tests for set difference methods Tests: Add parsing test for AggregationsTests (elastic#25396) test: get upgrade status for all indices Mute SignificantTermsAggregatorTests#testSignificance()
…cal-checkpoint * enhance/single-updateshardstate-method: Some cleanup Do not swallow exception when relocating Docs: Fix typo for request cache (elastic#25444) Remove implicit 32-bit support [DOCS] reworded to prevent code span rendering glitch (elastic#25442) Disallow multiple concurrent recovery attempts for same target shard (elastic#25428) Update global checkpoint when increasing primary term on replica (elastic#25422) Add backwards compatibility indices for 5.4.3 Add version 5.4.3 after release Update MSI installer images (elastic#25414) Add missing newline at end of SetsTests.java fix test Rename handoff primary context transport handler Provide single IndexShard method to update state on incoming cluster state
When a replica shard increases its primary term under the mandate of a new primary, it should also update its global checkpoint; this gives us the guarantee that its global checkpoint is at least as high as the new primary and gives a starting point for the primary/replica resync.
Relates to #25355, #10708