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

[Remote Store] Fix flaky test RemoteStoreIT.testRemoteSegmentStoreRestore #6252

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

sachinpkale
Copy link
Member

@sachinpkale sachinpkale commented Feb 9, 2023

Signed-off-by: Sachin Kale kalsac@amazon.com

Description

  • In RemoteStoreIT.testRemoteSegmentStoreRestore test, if we index X documents and primary goes down without refresh, as we are using only remote segment store, restore operation creates as empty index.
  • Indexing new doc on the restored index is treated as the first doc and response contains seqNo as 0 (for the first doc).
  • The seqNo initialization to 0 instead of -1 was failing the test which is fixed with this change.

Issues Resolved

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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.

public void testRemoteStoreRestoreFromRemoteSegmentStore() throws IOException {
internalCluster().startNodes(3);
public void testRemoteSegmentStoreRestore() throws IOException {
internalCluster().startDataOnlyNodes(3);
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not a fix to flakiness that was observed in #6248.

It is just to harden the test so that primary is not the cluster manager node as well.

*/
public void testStrictWeightedRouting() throws Exception {
public void testStrictWeightedRouting() {
Copy link
Member Author

Choose a reason for hiding this comment

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

These un-documented @throws created issues while running the tests on local. Not related to the fix of the flaky test.

Copy link
Member

Choose a reason for hiding this comment

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

@sachinpkale Which JDK are you using locally? I've seen inconsistencies with some non-LTS versions with regard to javadoc enforcement so I'd recommend using 11 or 17 if that is the cause here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@andrross the javadoc enforcement should not apply over test code, do you see checks enforced somewhere?

Copy link
Member

Choose a reason for hiding this comment

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

@reta Just from this comment: #5995 (comment) I have no idea why JDK 14 seems to want to enforce javadoc rules against tests, but that's what Tianli's comment suggests is happening.

Copy link
Collaborator

@reta reta Feb 9, 2023

Choose a reason for hiding this comment

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

Oh I see, thanks @andrross, I think we agreed to discard JDK-14 issues (and unsupported JDKs in general)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

Gradle Check (Jenkins) Run Completed with:

@sachinpkale
Copy link
Member Author

Failing due to flaky test: #6255

Pushing empty commit to re-trigger the build.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

Gradle Check (Jenkins) Run Completed with:

long maxSeqNo = 0;
long maxSeqNoRefreshedOrFlushed = 0;
long maxSeqNo = -1;
long maxSeqNoRefreshedOrFlushed = -1;
Copy link
Member Author

Choose a reason for hiding this comment

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

This ^ is the fix for flakiness of the test.

Signed-off-by: Sachin Kale <kalsac@amazon.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

Codecov Report

Merging #6252 (0b5b1cb) into main (1f4cdd2) will increase coverage by 0.04%.
The diff coverage is 38.99%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #6252      +/-   ##
============================================
+ Coverage     70.72%   70.76%   +0.04%     
- Complexity    58791    58873      +82     
============================================
  Files          4782     4789       +7     
  Lines        281484   281794     +310     
  Branches      40642    40671      +29     
============================================
+ Hits         199072   199412     +340     
- Misses        65984    66021      +37     
+ Partials      16428    16361      -67     
Impacted Files Coverage Δ
...es/replication/SegmentReplicationStatsRequest.java 0.00% <0.00%> (ø)
...ication/SegmentReplicationStatsRequestBuilder.java 0.00% <0.00%> (ø)
.../org/opensearch/client/support/AbstractClient.java 32.00% <0.00%> (-0.31%) ⬇️
...java/org/opensearch/index/shard/StoreRecovery.java 65.74% <0.00%> (ø)
.../indices/replication/SegmentReplicationSource.java 100.00% <ø> (ø)
...cation/TransportSegmentReplicationStatsAction.java 11.11% <11.11%> (ø)
...s/replication/SegmentReplicationStatsResponse.java 13.33% <13.33%> (ø)
...h/indices/replication/SegmentReplicationState.java 46.96% <24.65%> (-31.98%) ⬇️
...s/replication/SegmentReplicationTargetService.java 50.00% <41.66%> (-0.72%) ⬇️
...ces/replication/PrimaryShardReplicationSource.java 96.29% <50.00%> (-3.71%) ⬇️
... and 512 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@gbbafna gbbafna merged commit 4f5fd9c into opensearch-project:main Feb 9, 2023
@sachinpkale sachinpkale added the backport 2.x Backport to 2.x branch label Feb 9, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 9, 2023
Signed-off-by: Sachin Kale <kalsac@amazon.com>
(cherry picked from commit 4f5fd9c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
gbbafna pushed a commit that referenced this pull request Feb 9, 2023
…6265)

(cherry picked from commit 4f5fd9c)
Signed-off-by: Sachin Kale <kalsac@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants