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

[Segment Replication] Fix SearchableSnapshotIT tests failing with segment replication enabled indices #7036

Conversation

Rishikesh1159
Copy link
Member

Description

When we are restoring snapshot with storage type as REMOTE_SNAPSHOT we should use ReadOnlyEngine. But currectly we are wiring up a NRTReplicationEngineFactor instead of ReadOnlyEngine.

This PR moves up the isRemoteSnapshot() check on index setting before we check if isSegRepEnabled(). This way be wire ReadOnlyEngine when using remote snapshot.

Issues Resolved

Resolves #7034

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.

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

Codecov Report

Merging #7036 (7543d94) into main (53b128f) will increase coverage by 0.04%.
The diff coverage is 0.00%.

📣 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    #7036      +/-   ##
============================================
+ Coverage     70.78%   70.82%   +0.04%     
- Complexity    59269    59314      +45     
============================================
  Files          4823     4823              
  Lines        283985   283985              
  Branches      40953    40954       +1     
============================================
+ Hits         201026   201142     +116     
+ Misses        66403    66321      -82     
+ Partials      16556    16522      -34     
Impacted Files Coverage Δ
...ter/snapshots/get/TransportGetSnapshotsAction.java 41.58% <0.00%> (ø)
...in/java/org/opensearch/indices/IndicesService.java 63.95% <0.00%> (+0.14%) ⬆️

... and 515 files with indirect coverage changes

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

Comment on lines -933 to +938
if (idxSettings.isSegRepEnabled()) {
return new NRTReplicationEngineFactory();
}
if (idxSettings.isRemoteSnapshot()) {
return config -> new ReadOnlyEngine(config, new SeqNoStats(0, 0, 0), new TranslogStats(), true, Function.identity(), false);
}
if (idxSettings.isSegRepEnabled()) {
return new NRTReplicationEngineFactory();
}
Copy link
Member

Choose a reason for hiding this comment

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

LGTM! Thank you @Rishikesh1159 for fixing this

@andrross
Copy link
Member

andrross commented Apr 6, 2023

Is there a plan to run all tests regularly with segment replication enabled? Or should we add a case to SearchableSnapshotIT the explicitly enables it in order to have a test that catches a failure like this?

@Rishikesh1159
Copy link
Member Author

Is there a plan to run all tests regularly with segment replication enabled? Or should we add a case to SearchableSnapshotIT the explicitly enables it in order to have a test that catches a failure like this?

Not soon but in near future, we are planning to run all integ tests regularly with segment replication, like adding randomization in OpensearchIntegTest class that would make test classes to either use segrep or docrep randomly. But we still don't have a solid plan on how we should do it.

Yeah we can also add a case for SearchableSnapshotIT the explicitly enables, but rather than duplicating it on every other test class it would be better if we can figure a way out to do it with in OpensearchIntegTest

@andrross andrross merged commit fe8253e into opensearch-project:main Apr 6, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 6, 2023
…gs. (#7036)

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>
(cherry picked from commit fe8253e)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Rishikesh1159 pushed a commit that referenced this pull request Apr 6, 2023
…gs. (#7036) (#7041)

(cherry picked from commit fe8253e)

Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.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.

[Segment Replication] SearchableSnapshotIT class tests are failing with Segment Replication enabled Indices
4 participants