-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Conversation
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.
Pinging @elastic/es-distributed |
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... |
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. I left one request.
server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java
Outdated
Show resolved
Hide resolved
Thanks @dnhatn. |
I am pulling this in, and we will revert it when we have a new persistent layer. Thanks for looking @bleskes and @jasontedor. |
* 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)
* 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)
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.
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 (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 (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