[Test] Add CCR integration tests for pruned sequence numbers#144013
Merged
tlrx merged 5 commits intoelastic:mainfrom Mar 12, 2026
Merged
[Test] Add CCR integration tests for pruned sequence numbers#144013tlrx merged 5 commits intoelastic:mainfrom
tlrx merged 5 commits intoelastic:mainfrom
Conversation
…nce numbers The method ESIntegTestCase.getLiveDocs verifies that primary and replica have the same set of documents. This method must be adapted to account for sequence numbers that can be merged away on the shard if the IndexSettings.DISABLE_SEQUENCE_NUMBERS is set. This method was previously adjusted for synthetic id and synthetic sources to rely on the Engine's changes snapshot API to retrieve Lucene documents. At that time, LuceneChangesSnapshot and LuceneSyntheticSourceChangesSnapshot were changed to accommodate for missing id/source. It was already a bit ugly but now with _seq_no also pruned it would require even larger changes in those Lucene*ChangesSnapshot classes only for testing, since _seq_no are loaded at the lower level in Lucene*ChangesSnapshot. So I changed ESIntegTestCase to not use the change snapshot API anymore, I reverted the changes in Lucene*ChangesSnapshot classes and now simply bulk load documents from the reader directly. Relates elastic#136305
This commit adds tests to verify that CCR works correctly with pruned sequence numbers. The test is inspired by SeqNoPruningIT. Note: made by Cursor, adjusted by me. Also requires elastic#143999 to pass. Relates elastic#136305
Collaborator
|
Pinging @elastic/es-distributed (Team:Distributed) |
19 tasks
romseygeek
approved these changes
Mar 11, 2026
| return client.admin().indices().prepareStats(index).get().getShards()[0].getSeqNoStats().getMaxSeqNo(); | ||
| } | ||
|
|
||
| private void assertLeaderShardsRetainedSeqNoDocValuesCount(String indexName, long expectedCount, int expectedShards) { |
Contributor
There was a problem hiding this comment.
Is it worth having this in SequenceNumbersTestUtils too?
fcofdez
reviewed
Mar 11, 2026
Contributor
fcofdez
left a comment
There was a problem hiding this comment.
Looks good! I left a couple of comments
...k/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrSeqNoPruningIT.java
Show resolved
Hide resolved
...k/plugin/ccr/src/internalClusterTest/java/org/elasticsearch/xpack/ccr/CcrSeqNoPruningIT.java
Show resolved
Hide resolved
Member
Author
|
Thanks Alan and Francisco! |
michalborek
pushed a commit
to michalborek/elasticsearch
that referenced
this pull request
Mar 23, 2026
…#144013) This commit adds tests to verify that CCR works correctly with pruned sequence numbers. The test is inspired by SeqNoPruningIT. Relates elastic#136305
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 tests to verify that CCR works correctly with pruned sequence numbers. The test is inspired by SeqNoPruningIT.
Note: made by Cursor, adjusted by me. Also requires #143999 to pass.
Relates #136305