Fix unclosed store references with SearchOnlyReplicaIT#16106
Merged
mch2 merged 1 commit intoopensearch-project:mainfrom Oct 22, 2024
Merged
Fix unclosed store references with SearchOnlyReplicaIT#16106mch2 merged 1 commit intoopensearch-project:mainfrom
mch2 merged 1 commit intoopensearch-project:mainfrom
Conversation
… is unknown. This PR fixes a bug with node-node pull based replication where if the replica does not know the DiscoveryNode of its primary we would fail after constructing a SegmentReplicationTarget that holds a store reference. Only after replication is started would a failure occur because the source node is null, and the target would not get cleaned up. Push based replication already handled this case by catching any error and closing the target. This update ensures the validation is done before constructing our PrimaryShardReplicationSource, before any target object is created in both cases push and pull. Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
Contributor
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16106 +/- ##
============================================
- Coverage 72.04% 71.96% -0.09%
+ Complexity 64441 64434 -7
============================================
Files 5281 5281
Lines 301088 301094 +6
Branches 43500 43503 +3
============================================
- Hits 216918 216673 -245
- Misses 66438 66638 +200
- Partials 17732 17783 +51 ☔ View full report in Codecov by Sentry. |
Member
Author
|
codecov complains bc of the asserts i've written aren't hit in unit tests, I think we can safely ignore this. |
jainankitk
approved these changes
Oct 22, 2024
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Oct 22, 2024
… is unknown. (#16106) This PR fixes a bug with node-node pull based replication where if the replica does not know the DiscoveryNode of its primary we would fail after constructing a SegmentReplicationTarget that holds a store reference. Only after replication is started would a failure occur because the source node is null, and the target would not get cleaned up. Push based replication already handled this case by catching any error and closing the target. This update ensures the validation is done before constructing our PrimaryShardReplicationSource, before any target object is created in both cases push and pull. Signed-off-by: Marc Handalian <marc.handalian@gmail.com> (cherry picked from commit 267c68e) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dbwiddis
pushed a commit
that referenced
this pull request
Oct 22, 2024
… is unknown. (#16106) (#16435) This PR fixes a bug with node-node pull based replication where if the replica does not know the DiscoveryNode of its primary we would fail after constructing a SegmentReplicationTarget that holds a store reference. Only after replication is started would a failure occur because the source node is null, and the target would not get cleaned up. Push based replication already handled this case by catching any error and closing the target. This update ensures the validation is done before constructing our PrimaryShardReplicationSource, before any target object is created in both cases push and pull. (cherry picked from commit 267c68e) Signed-off-by: Marc Handalian <marc.handalian@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>
akolarkunnu
pushed a commit
to akolarkunnu/OpenSearch
that referenced
this pull request
Jan 21, 2025
… is unknown. (opensearch-project#16106) This PR fixes a bug with node-node pull based replication where if the replica does not know the DiscoveryNode of its primary we would fail after constructing a SegmentReplicationTarget that holds a store reference. Only after replication is started would a failure occur because the source node is null, and the target would not get cleaned up. Push based replication already handled this case by catching any error and closing the target. This update ensures the validation is done before constructing our PrimaryShardReplicationSource, before any target object is created in both cases push and pull. Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
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
This PR fixes a bug with node-node pull based replication where store refs are left open. If the replica does not know the DiscoveryNode of its primary we would fail late only after replication is started and a ref is not cleaned up. Push based replication already handled this case by catching any error and closing the SegmentReplicationTarget, which holds the ref. This update ensures the validation is done before constructing our PrimaryShardReplicationSource, before any target object is created in both cases push and pull.
Related Issues
Resolves #15812
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.