Skip to content

Conversation

guojialiang92
Copy link
Contributor

Description

I found that SegmentReplicator#completedReplications only has addition logic but no cleanup logic.
We should clean up SegmentReplicator#completedReplications when SegmentReplicator#cancel is invoked. Otherwise, it may cause a risk of memory leak.

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

@guojialiang92 guojialiang92 requested a review from a team as a code owner July 29, 2025 03:16
@guojialiang92 guojialiang92 changed the title [segment replication] Clean up completedReplications when SegmentReplicator.cancel is invoked [BUG FIX] Segment Replication cleanup completedReplications when SegmentReplicator.cancel is invoked Jul 29, 2025
Copy link
Contributor

❌ Gradle check result for 7a85d3c: 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?

@guojialiang92 guojialiang92 force-pushed the dev/clean-completedReplications-when-segmentReplicator-cancel-invoked branch from 7a85d3c to bc9c780 Compare July 29, 2025 06:26
@guojialiang92 guojialiang92 force-pushed the dev/clean-completedReplications-when-segmentReplicator-cancel-invoked branch from bc9c780 to 4ea54d1 Compare July 29, 2025 07:05
Copy link
Contributor

❌ Gradle check result for 4ea54d1: 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?

@guojialiang92 guojialiang92 force-pushed the dev/clean-completedReplications-when-segmentReplicator-cancel-invoked branch from 4ea54d1 to 51d3048 Compare July 29, 2025 08:07
@guojialiang92 guojialiang92 force-pushed the dev/clean-completedReplications-when-segmentReplicator-cancel-invoked branch from 51d3048 to 47943ad Compare July 29, 2025 10:03
Copy link
Contributor

✅ Gradle check result for 47943ad: SUCCESS

Copy link

codecov bot commented Jul 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.78%. Comparing base (1f761f2) to head (47943ad).
⚠️ Report is 173 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #18856      +/-   ##
============================================
- Coverage     72.79%   72.78%   -0.01%     
+ Complexity    68627    68596      -31     
============================================
  Files          5572     5577       +5     
  Lines        315196   315376     +180     
  Branches      45750    45772      +22     
============================================
+ Hits         229454   229554     +100     
- Misses        67153    67213      +60     
- Partials      18589    18609      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@guojialiang92
Copy link
Contributor Author

guojialiang92 commented Jul 29, 2025

Hi, @mch2 @ashking94.
There's a small optimization for segment replication. If you have time, please help review it. Thanks. :)

@opensearch-trigger-bot
Copy link
Contributor

This PR is stalled because it has been open for 30 days with no activity.

@opensearch-trigger-bot opensearch-trigger-bot bot added stalled Issues that have stalled and removed stalled Issues that have stalled labels Aug 29, 2025
@mch2 mch2 merged commit 2f2a3a7 into opensearch-project:main Sep 16, 2025
37 of 40 checks passed
@mch2
Copy link
Member

mch2 commented Sep 16, 2025

sorry for the delay here, thanks for the cleanup @guojialiang92

jainankitk pushed a commit to jainankitk/OpenSearch that referenced this pull request Sep 22, 2025
jainankitk pushed a commit to jainankitk/OpenSearch that referenced this pull request Sep 22, 2025
jainankitk pushed a commit to jainankitk/OpenSearch that referenced this pull request Sep 22, 2025
asimmahmood1 pushed a commit to jainankitk/OpenSearch that referenced this pull request Sep 23, 2025
pranikum pushed a commit to pranikum/OpenSearch that referenced this pull request Sep 23, 2025
vinaykpud pushed a commit to vinaykpud/OpenSearch that referenced this pull request Sep 26, 2025
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