-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[merged segment warmer] support cleanup redundant pending merged segments #18720
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
[merged segment warmer] support cleanup redundant pending merged segments #18720
Conversation
Signed-off-by: guojialiang <[email protected]>
❌ Gradle check result for bc68b76: 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? |
❌ Gradle check result for ef17803: 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? |
Signed-off-by: guojialiang <[email protected]>
ef17803
to
136f448
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #18720 +/- ##
============================================
- Coverage 72.80% 72.78% -0.03%
- Complexity 68564 68592 +28
============================================
Files 5567 5571 +4
Lines 314844 314987 +143
Branches 45675 45694 +19
============================================
+ Hits 229227 229261 +34
- Misses 67028 67185 +157
+ Partials 18589 18541 -48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: guojialiang <[email protected]>
Signed-off-by: guojialiang <[email protected]>
❌ Gradle check result for 806fff2: 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? |
Signed-off-by: guojialiang <[email protected]>
Signed-off-by: guojialiang <[email protected]>
Signed-off-by: guojialiang <[email protected]>
Signed-off-by: guojialiang <[email protected]>
Signed-off-by: guojialiang <[email protected]>
Signed-off-by: guojialiang <[email protected]>
❌ Gradle check result for 7ef8968: 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? |
Signed-off-by: guojialiang <[email protected]>
Hi, @ashking94
If you have time, please help review the code again. Thank you. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the revision. I have some minor comments only now, let me know once you have addressed it.
...r/src/internalClusterTest/java/org/opensearch/indices/replication/MergedSegmentWarmerIT.java
Show resolved
Hide resolved
Do look at this - #18720 (comment) as well. |
Hi, @ashking94
Could you please help review it again? Including the discussion in #18720 (comment). |
Hi @guojialiang92, except the only unresolved comment, I am good with everything. |
Thanks, @ashking94, I have already replied to comment. |
@guojialiang92 Sure, lets create an issue and tackle this in a follow up. Overall, I am good. |
@guojialiang92 I have merged this and i am hoping that none of the added tests are flaky on longer iterations. |
Description
This PR is based on [18255]'s follow-up work. It implements the core process of cleaning up redundant pending merged segments. Meanwhile, this cleanup process can be applied to both local and remote storage scenarios.
Example
Here, an example of generating redundant pending merged segments will be provided.
_1.si
and_2.si
into segment_3.si
._3.si
is pre-copied to the replica shard, which completed at time4._4.si
, and_1.si
,_2.si
,_4.si
were copied to the replica shard via segment replication, which completed at time5._3.si
and_4.si
into segment_5.si
._5.si
is pre-copied to the replica shard, which completed at time6._3.si
, but_3.si
is not searchable._1.si
and_2.si
in the primary shard decreased to0
and were deleted._5.si
on the primary shard becomes searchable. The reference counts of_3.si
and_4.si
in the primary shard decreased to0
and were deleted._5.si
were copied to the replica shard via segment replication, which completed at time7 (This process is fast because it has already performed pre-copy)._5.si
on the replica shard becomes searchable. The reference counts of_1.si
,_2.si
and_4.si
in the replica shard decreased to0
and were deleted._3.si
on the replica is the redundant pending merged segment.Cleanup strategy
When the following conditions are met, we will consider the pending merge segment to be redundant and can be deleted.
Implement
MergeSegmentCheckpoint
inIndexShard#pendingMergeSegmentCheckpoints
.MergeSegmentCheckpoint
fromIndexShard#pendingMergeSegmentCheckpoints
.IndexService.AsyncPublishReferencedSegmentsTask
to periodically publish the segments referenced by the primary shard to replicas.Related Issues
Resolves #[17528], #[18625]
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.