Skip to content
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

Fix Flaky - testForceMergeWithSoftDeletesRetentionAndRecoverySource #5364 #11494

Conversation

sarthakaggarwal97
Copy link
Contributor

@sarthakaggarwal97 sarthakaggarwal97 commented Dec 6, 2023

Description

The document that is deleted is the one that would be indexed again while we check for the useRecoverySource flag to populate the liveDocsWithSource set

The tests are also passing with the failed seeds

C75D09DC5A0C3458
Screenshot 2023-12-07 at 01 04 05

1766E6A3B733A7AA
Screenshot 2023-12-07 at 01 04 13

10K Iterations Passed
Screenshot 2023-12-07 at 01 46 51

Related Issues

Resolves #5364

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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.

@github-actions github-actions bot added bug Something isn't working flaky-test Random test failure that succeeds on second run Indexing Indexing, Bulk Indexing and anything related to indexing labels Dec 6, 2023
@sarthakaggarwal97 sarthakaggarwal97 changed the title Fix Flaky #5364 Fix Flaky - testForceMergeWithSoftDeletesRetentionAndRecoverySource #5364 Dec 6, 2023
Copy link
Contributor

github-actions bot commented Dec 6, 2023

Compatibility status:

Checks if related components are compatible with change 83938fb

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/performance-analyzer.git]

Signed-off-by: Sarthak Aggarwal <[email protected]>
Signed-off-by: Sarthak Aggarwal <[email protected]>
Copy link
Contributor

github-actions bot commented Dec 6, 2023

❌ Gradle check result for f68b0f1: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Dec 6, 2023

✅ Gradle check result for f3f1c76: SUCCESS

Copy link

codecov bot commented Dec 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.41%. Comparing base (f7f3500) to head (83938fb).
Report is 411 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11494      +/-   ##
============================================
+ Coverage     71.37%   71.41%   +0.04%     
- Complexity    59113    59143      +30     
============================================
  Files          4893     4903      +10     
  Lines        277831   277983     +152     
  Branches      40367    40382      +15     
============================================
+ Hits         198288   198518     +230     
+ Misses        63042    62969      -73     
+ Partials      16501    16496       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Dec 6, 2023

❕ Gradle check result for 83938fb: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.remotestore.RemoteIndexPrimaryRelocationIT.testPrimaryRelocationWhileIndexing

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added the stalled Issues that have stalled label Jan 25, 2024
@sarthakaggarwal97 sarthakaggarwal97 removed the stalled Issues that have stalled label Jan 26, 2024
@sarthakaggarwal97 sarthakaggarwal97 marked this pull request as ready for review January 26, 2024 20:48
@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added the stalled Issues that have stalled label Feb 27, 2024
@opensearch-trigger-bot opensearch-trigger-bot bot removed the stalled Issues that have stalled label Mar 6, 2024
@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added stalled Issues that have stalled and removed stalled Issues that have stalled labels Apr 7, 2024
@@ -1822,8 +1822,8 @@ public void testForceMergeWithSoftDeletesRetentionAndRecoverySource() throws Exc
)
) {
int numDocs = scaledRandomIntBetween(10, 100);
boolean useRecoverySource = randomBoolean() || omitSourceAllTheTime;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the useRecoverySource flag out of the for loop makes every document has same flag, the randomness is lost, I think we need to keep the randomness in order to cover different cases.

ParsedDocument doc = testParsedDocument(Integer.toString(i), null, testDocument(), B_1, null, useRecoverySource);
if (randomBoolean()) {
boolean isDeleted = randomBoolean();
if (isDeleted) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that if isDeleted is true, for each document, we delete it firstly, and then add them back? If so the randomness is also lost.

@@ -1848,9 +1848,8 @@ public void testForceMergeWithSoftDeletesRetentionAndRecoverySource() throws Exc
liveDocsWithSource.remove(doc.id());
}
}
if (randomBoolean()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the if condition?

@@ -1896,7 +1895,6 @@ public void testForceMergeWithSoftDeletesRetentionAndRecoverySource() throws Exc
numSegments = searcher.getDirectoryReader().leaves().size();
}
if (numSegments == 1) {
boolean useRecoverySource = randomBoolean() || omitSourceAllTheTime;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If numSegments = 1, we add a new document here, so the flag should be generated randomly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flaky-test Random test failure that succeeds on second run Indexing Indexing, Bulk Indexing and anything related to indexing skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] InternalEngineTests.testForceMergeWithSoftDeletesRetentionAndRecoverySource failure
2 participants