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

[Backport 2.x] [Segment Replication] Refactor file cleanup logic and fix PIT/Scroll with remote store. #9272

Merged
merged 2 commits into from
Aug 11, 2023

Conversation

mch2
Copy link
Member

@mch2 mch2 commented Aug 11, 2023

Manual backport of #9111 includes follow up commit to fix flaky #9245.

…with remote store. (opensearch-project#9111)

* Remove divergent commit logic with segment replication.

This change removes divergent commit paths for segrep node-node and remote store.
All replicas with segrep enabled will perform local commits and ignore any incoming segments_n file.
This changes the recovery sync with remote store to also exclude the segments_n so that only the fetched infos bytes are committed before
an engine is opened.
This change also updates deletion logic with segment replication to automatically delete when a file is decref'd to 0.

Signed-off-by: Marc Handalian <[email protected]>

* Add more NRTReplicationEngineTests.

Signed-off-by: Marc Handalian <[email protected]>

* Ensure old commit files are wiped on remote store sync before we commit a new segmentInfos.

Signed-off-by: Marc Handalian <[email protected]>

* Add more shard level tests.

Signed-off-by: Marc Handalian <[email protected]>

* Add test ensuring commits are cleaned up on replicas.

Signed-off-by: Marc Handalian <[email protected]>

* Self review.

Signed-off-by: Marc Handalian <[email protected]>

* Use refresh level sync before recovery

Signed-off-by: Marc Handalian <[email protected]>

* PR feedback.

Signed-off-by: Marc Handalian <[email protected]>

---------

Signed-off-by: Marc Handalian <[email protected]>
(cherry picked from commit c301544)
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@opensearch-trigger-bot
Copy link
Contributor

Compatibility status:



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

BUILD SUCCESSFUL in 24m 56s

@mch2
Copy link
Member Author

mch2 commented Aug 11, 2023

fixed conflict here - ActionListener path updated on main with #9082

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@opensearch-trigger-bot
Copy link
Contributor

Compatibility status:



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

BUILD SUCCESSFUL in 26m 18s

This test is specific to remote store and should not be run for node-node replication.

Signed-off-by: Marc Handalian <[email protected]>
(cherry picked from commit a33f67e)
Signed-off-by: Marc Handalian <[email protected]>
@opensearch-trigger-bot
Copy link
Contributor

Compatibility status:



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

BUILD SUCCESSFUL in 25m 10s

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Merging #9272 (b115dd1) into 2.x (c568386) will decrease coverage by 0.11%.
Report is 1 commits behind head on 2.x.
The diff coverage is 90.00%.

@@             Coverage Diff              @@
##                2.x    #9272      +/-   ##
============================================
- Coverage     70.85%   70.75%   -0.11%     
+ Complexity    57499    57443      -56     
============================================
  Files          4758     4758              
  Lines        271801   271785      -16     
  Branches      40090    40087       -3     
============================================
- Hits         192590   192296     -294     
- Misses        62700    62950     +250     
- Partials      16511    16539      +28     
Files Changed Coverage Δ
...rc/main/java/org/opensearch/index/store/Store.java 81.12% <ø> (+0.46%) ⬆️
...ch/indices/recovery/PeerRecoveryTargetService.java 57.84% <0.00%> (+4.90%) ⬆️
...in/java/org/opensearch/index/shard/IndexShard.java 69.22% <85.71%> (+0.43%) ⬆️
...rg/opensearch/index/engine/ReplicaFileTracker.java 86.11% <86.11%> (ø)
.../opensearch/index/engine/NRTReplicationEngine.java 78.08% <100.00%> (+0.37%) ⬆️
...earch/index/store/RemoteSegmentStoreDirectory.java 87.70% <100.00%> (ø)
...ices/replication/RemoteStoreReplicationSource.java 90.90% <100.00%> (+0.16%) ⬆️
.../indices/replication/SegmentReplicationTarget.java 89.00% <100.00%> (-0.72%) ⬇️

... and 482 files with indirect coverage changes

@mch2 mch2 merged commit c8471a0 into opensearch-project:2.x Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants