Composite recovery tests - #5
Open
Bukhtawar wants to merge 1 commit into
Open
Conversation
Bukhtawar
force-pushed
the
composite-recovery-tests
branch
from
May 19, 2026 10:29
43600ba to
d6b7830
Compare
Tests validate data integrity across restart, translog replay, and merge for the composite (Parquet + Lucene) engine. Findings: - testTranslogReplayGenerationAdvances: FAILS — translog replay duplicates rows already committed to Parquet (expected 26, got 52). Parquet has no dedup mechanism equivalent to Lucene's soft-delete seq_no handling. - testMultipleRestartCycles: FAILS — same duplication compounds across restarts (row count doubles each cycle). - testWriterGenerationDoesNotCollideAfterCrashMidIndexing: FAILS — writer generation counter does not advance past committed max after recovery, risking collision with orphaned files from a prior failed attempt. Passing tests: - testLocalRecoveryPreservesBothFormats: both formats survive clean restart - testRecoveryAfterMerge: merged state (both formats) survives restart - testNoOrphanedParquetFilesAfterRecovery: no orphans after clean restart - testWriterGenerationMonotonicallyIncreases: generation advances correctly for new writes after restart Signed-off-by: Bukhtawar Khan <bukhtawa@amazon.com>
Bukhtawar
force-pushed
the
composite-recovery-tests
branch
from
May 19, 2026 10:37
d6b7830 to
7570d86
Compare
mgodwan
reviewed
May 19, 2026
| * Flush commits both formats, remote store uploads both via DataFormatAwareRemoteDirectory. | ||
| * After restart, remote store downloads both and engine opens correctly. | ||
| */ | ||
| public void testRemoteStoreRecoveryPreservesBothFormats() throws Exception { |
Collaborator
There was a problem hiding this comment.
This test is covered via DataFormatAwareRemoteStoreRecoveryIT#testRemoteStoreRecoveryPreservesFormatMetadata
mgodwan
reviewed
May 19, 2026
| * the committed catalog snapshot. Any unreferenced file is an orphan from a | ||
| * prior crashed flush/replay — evidence that cleanup is missing. | ||
| */ | ||
| public void testNoOrphanedParquetFilesAfterRecovery() throws Exception { |
Collaborator
There was a problem hiding this comment.
This overlaps with testReplicaStartupCleansOrphanFiles
mgodwan
reviewed
May 19, 2026
| * exist outside the catalog snapshot, which would indicate a generation collision risk. | ||
| */ | ||
| @OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 1) | ||
| public class CompositeRecoveryCrashResilienceIT extends AbstractCompositeEngineIT { |
Collaborator
There was a problem hiding this comment.
This overlaps with DataFormatAwareReplicaResilienceIT
Could you combine?
mgodwan
reviewed
May 19, 2026
| * Verifies that the writer generation counter is recovered from the catalog | ||
| * snapshot and starts ABOVE any existing file's generation. | ||
| */ | ||
| public void testWriterGenerationMonotonicallyIncreases() throws Exception { |
Collaborator
There was a problem hiding this comment.
This seems to overlap with testPromotionWithInFlightRemoteStoreUpload
mgodwan
reviewed
May 19, 2026
| * Create many small segments via repeated flush. Trigger merge. Restart. | ||
| * Verify data integrity (row count) survives the merge + restart cycle. | ||
| */ | ||
| public void testRecoveryAfterMerge() throws Exception { |
Collaborator
There was a problem hiding this comment.
This has overlap with testQueryResultsIdenticalAfterForceMergeAndRestart (latter is already testing search as well)
mgodwan
reviewed
May 19, 2026
Comment on lines
+76
to
+89
| Set<String> parquetFilesOnDisk = getParquetFilesOnDisk(); | ||
| Set<String> catalogFilesAfterRecovery = getCatalogReferencedParquetFiles(); | ||
|
|
||
| // Every Parquet file on disk must be in the catalog snapshot. | ||
| // Any file on disk but NOT in the catalog is an orphan. | ||
| Set<String> orphans = new HashSet<>(parquetFilesOnDisk); | ||
| orphans.removeAll(catalogFilesAfterRecovery); | ||
|
|
||
| assertTrue( | ||
| "Found orphaned Parquet files not referenced by catalog snapshot after recovery: " + orphans | ||
| + ". These could collide with new writer generations on subsequent translog replays.", | ||
| orphans.isEmpty() | ||
| ); | ||
|
|
Collaborator
There was a problem hiding this comment.
This can be flaky due to background merges.
empty parquet files are created during merges.
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.
Description
Related Issues
Resolves # opensearch-project#21311
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.