[Test] Test that sequence numbers are not pruned with retention lease#143825
Merged
tlrx merged 5 commits intoelastic:mainfrom Mar 10, 2026
Merged
[Test] Test that sequence numbers are not pruned with retention lease#143825tlrx merged 5 commits intoelastic:mainfrom
tlrx merged 5 commits intoelastic:mainfrom
Conversation
fcofdez
reviewed
Mar 9, 2026
Contributor
fcofdez
left a comment
There was a problem hiding this comment.
Looks good! I left a few suggestions.
| ); | ||
|
|
||
| // add a retention lease holding at a sequence number in the middle of the indexed range | ||
| final long retentionLeaseSeqNo = randomLongBetween(1, totalDocs - 1); |
Contributor
There was a problem hiding this comment.
maybe we can fetch the local checkpoint/max seq no of the primary instead?
Member
Author
There was a problem hiding this comment.
I pushed b21739d, I like the idea of selecting a random seq no in the ones available, instead of always picking up the max seq no.
| final var primary = internalCluster().getInstance(IndicesService.class, clusterState.nodes().get(primaryShardNodeId).getName()) | ||
| .getShardOrNull(new ShardId(resolveIndex(indexName), 0)); | ||
|
|
||
| final var addLeaseLatch = new CountDownLatch(1); |
Contributor
There was a problem hiding this comment.
I think that we have a transport action for this, can't we use that?
| } | ||
| } | ||
| } | ||
| assertThat("expected to verify at least one shard", checkedShards, equalTo(1)); |
Contributor
There was a problem hiding this comment.
maybe we can remove the lease, index some data and force merge again to ensure that we eventually remove the seq_nos?
Collaborator
|
Pinging @elastic/es-distributed (Team:Distributed) |
19 tasks
Member
Author
|
Thanks Francisco! |
szybia
added a commit
to szybia/elasticsearch
that referenced
this pull request
Mar 10, 2026
…locations * upstream/main: (126 commits) Update KnnIndexTester to use more settings from datasets (elastic#143869) fix: dynamic template vector array is overridden by automatic dense_vector mapping (elastic#143733) ES|QL: Don't reuse the same alias for _fork column (elastic#143909) Close and initialize clients after each node upgrade in logsdb rolling upgrade tests. (elastic#143823) ESQL: Added GroupedTopNOperator for LIMIT BY, compute only (elastic#143476) Handle views in ResolveIndexAction (elastic#143561) Improve reindex rethrottle API in stateless (elastic#143771) Use a copy of the SearchExecutionContext for each Percolator execution (elastic#142765) Log the stacktrace when we encounter a deprecation warning for `default_metric` (elastic#143929) ESQL: evaluate ReferenceAttributes to potentially FieldAttributes for full-text functions restriction (elastic#143893) Add ClusterStateSerializationStats Serializatation Tests (elastic#142703) Adds Coordination Diagnostics Tests (elastic#142709) Upgrade Elasticsearch to Apache Lucene 10.4 (elastic#141882) ESQL: Add configurable bracket-based multi-value support for CSV reader (elastic#143890) time series es819 binary dv use up to a 1mb block size (elastic#143049) Dynamically enable / disable plugins in correspondence to stateless mode. (elastic#142147) ES|QL: Implement first/last_over_time for tdigest (elastic#143832) Document CHANGE_POINT limitation (elastic#143877) Fix OperationsOnSeqNoDisabledIndicesIT (elastic#143892) [Test] Test that sequence numbers are not pruned with retention lease (elastic#143825) ...
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.
This commit adds a test in SeqNoPruningIT to ensure that sequence numbers are NOT pruned for operations that are still retained by a lease.
Follow up #143690
Edit: the test was made with Cursor, adjusted by me.