Skip peer-recovery retention in soft deletes policy for serverless#144223
Merged
tlrx merged 10 commits intoelastic:mainfrom Apr 10, 2026
Merged
Skip peer-recovery retention in soft deletes policy for serverless#144223tlrx merged 10 commits intoelastic:mainfrom
tlrx merged 10 commits intoelastic:mainfrom
Conversation
Serverless does not use peer recovery, so there is no need to retain soft-deleted documents down to the local checkpoint of the safe commit. This change adds a `retainForPeerRecovery` flag to `SoftDeletesPolicy` and a protected hook in InternalEngine so that classes that inherit InternalEngine can disable this constraint, allowing the min retained sequence number to advance faster.
Member
Author
|
@fcofdez here is a contained change, were you thinking of something along those lines? |
19 tasks
fcofdez
reviewed
Mar 17, 2026
Contributor
fcofdez
left a comment
There was a problem hiding this comment.
Looks good, I think that we should use the global checkpoint instead, but this looks like a good path forward.
| final long minSeqNoToRetain = Math.min(minSeqNoForQueryingChanges, 1 + localCheckpointOfSafeCommit); | ||
| final long minSeqNoToRetain = retainForPeerRecovery | ||
| ? Math.min(minSeqNoForQueryingChanges, 1 + localCheckpointOfSafeCommit) | ||
| : minSeqNoForQueryingChanges; |
Contributor
There was a problem hiding this comment.
I think that in this branch we should return the global checkpoint instead? otherwise the retention leases which are synced every 30 seconds (org.elasticsearch.index.IndexService#RETENTION_LEASE_SYNC_INTERVAL_SETTING) would be too far behind and it won't be aggressive enough.
…13-do-not-retain-ops-for-serverless
Collaborator
|
Pinging @elastic/es-distributed (Team:Distributed) |
…13-do-not-retain-ops-for-serverless
a8ded74 to
529b041
Compare
…13-do-not-retain-ops-for-serverless
5c956fd to
4e0b4f8
Compare
…13-do-not-retain-ops-for-serverless
…13-do-not-retain-ops-for-serverless
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Serverless does not use peer recovery, so there is no need to retain soft-deleted documents down to the local checkpoint of the safe commit.
This change adds a
retainForPeerRecoveryflag toSoftDeletesPolicyand a protected hook in InternalEngine so that classes that inherit InternalEngine can disable this constraint, allowing the min retained sequence number to advance faster.Relates #136305