Skip to content
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

Copy retention leases when trim unsafe commits #37995

Merged
merged 7 commits into from
Feb 12, 2019

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Jan 29, 2019

When a primary shard is recovered from its store, we trim the last
commit (when it's unsafe). If that primary crashes before the recovery
completes, we will lose the committed retention leases because they are
baked in the last commit. With this change, we copy the retention leases
from the last commit to the safe commit when trimming unsafe commits.

Relates #37165

When a primary shard is recovered from its store, we trim the last
commit (if it's unsafe). If a shard crashes before the recovery
completes, we will lose the committed retention leases because they are
baked in the last commit. With this change, we copy the retention leases
from the last commit to the safe commit when trimming unsafe commits.
@dnhatn dnhatn added >enhancement v7.0.0 :Distributed Indexing/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. v6.7.0 labels Jan 29, 2019
@dnhatn dnhatn requested review from bleskes and jasontedor January 29, 2019 21:52
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@jasontedor jasontedor mentioned this pull request Jan 29, 2019
24 tasks
@bleskes
Copy link
Contributor

bleskes commented Jan 29, 2019

This is a getting a bit out of hand. I'm starting to wonder if we're not better off having a dedicated state file in the index/translog/shard folder that is dedicated for this. @dnhatn this is not meant specifically at this PR as you are just extending the "let's store this in a lucene commit" line of thought. I'm just starting to doubt if it is the right one...

@jasontedor
Copy link
Member

@bleskes Me and @ywelsch had a similar discussion this morning, the complexity is really starting to pile up, that we are basically inventing an entirely new persistence layer with its own semantics.

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I left one request.

@jasontedor
Copy link
Member

Thanks @dnhatn.

@dnhatn
Copy link
Member Author

dnhatn commented Feb 12, 2019

I am pulling this in, and we will revert it when we have a new persistent layer. Thanks for looking @bleskes and @jasontedor.

@dnhatn dnhatn merged commit 33b2be5 into elastic:master Feb 12, 2019
@dnhatn dnhatn deleted the trim-commit-copy-leases branch February 12, 2019 01:36
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Feb 12, 2019
* master:
  Enable removal of retention leases (elastic#38751)
  Make the 'get templates' types deprecation message consistent. (elastic#38533)
  Copy retention leases when trim unsafe commits (elastic#37995)
  Fix the version check for LegacyGeoShapeFieldMapper (elastic#38547)
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Feb 12, 2019
* master:
  Enable removal of retention leases (elastic#38751)
  Make the 'get templates' types deprecation message consistent. (elastic#38533)
  Copy retention leases when trim unsafe commits (elastic#37995)
  Fix the version check for LegacyGeoShapeFieldMapper (elastic#38547)
dnhatn added a commit that referenced this pull request Feb 12, 2019
When a primary shard is recovered from its store, we trim the last
commit (when it's unsafe). If that primary crashes before the recovery
completes, we will lose the committed retention leases because they are
baked in the last commit. With this change, we copy the retention leases
from the last commit to the safe commit when trimming unsafe commits.
dnhatn added a commit that referenced this pull request Feb 13, 2019
When a primary shard is recovered from its store, we trim the last
commit (when it's unsafe). If that primary crashes before the recovery
completes, we will lose the committed retention leases because they are
baked in the last commit. With this change, we copy the retention leases
from the last commit to the safe commit when trimming unsafe commits.

Relates #37165
dnhatn added a commit that referenced this pull request Feb 13, 2019
When a primary shard is recovered from its store, we trim the last
commit (when it's unsafe). If that primary crashes before the recovery
completes, we will lose the committed retention leases because they are
baked in the last commit. With this change, we copy the retention leases
from the last commit to the safe commit when trimming unsafe commits.

Relates #37165
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/Distributed A catch all label for anything in the Distributed Area. Please avoid if you can. >enhancement v6.7.0 v7.0.0-rc1 v7.2.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants