Clear Stale Persistent Tasks in Stop/Pause API#1629
Open
mohit10011999 wants to merge 10 commits intoopensearch-project:mainfrom
Open
Clear Stale Persistent Tasks in Stop/Pause API#1629mohit10011999 wants to merge 10 commits intoopensearch-project:mainfrom
mohit10011999 wants to merge 10 commits intoopensearch-project:mainfrom
Conversation
ankitkala
reviewed
Jan 27, 2026
Member
ankitkala
left a comment
There was a problem hiding this comment.
Two major feedback:
- The PR has lot of additional code changes which doesn't seems to be related to the actual change. Can you remove all the unnecessary changes so its easier to review
- Stale replication tasks are problem when you're trying to create the task again(start or resume). I think we should be able to simplify by just handling this during task creation here (need to verify though, with any stacktrace from last few occurence of the issue)
src/main/kotlin/org/opensearch/replication/action/index/TransportReplicateIndexAction.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/replication/action/index/TransportReplicateIndexAction.kt
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/replication/action/stop/TransportStopIndexReplicationAction.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/org/opensearch/replication/action/pause/TransportPauseIndexReplicationAction.kt
Outdated
Show resolved
Hide resolved
f4aa9ba to
43629d5
Compare
db9f5df to
5aa641f
Compare
758eca1 to
e8b534f
Compare
auto-merge was automatically disabled
March 23, 2026 13:56
Head branch was pushed to by a user without write access
de6493e to
7e641a6
Compare
c1259c2 to
9b4cec2
Compare
Signed-off-by: Mohit Kumar <mohitamg@amazon.com>
This reverts commit 0e4b126. Signed-off-by: Mohit Kumar <mohitamg@amazon.com>
Signed-off-by: Mohit Kumar <mohitamg@amazon.com>
00dbad5 to
c274e16
Compare
Signed-off-by: Mohit Kumar <mohitamg@amazon.com>
…ld clear all stale replication metadata Signed-off-by: Mohit Kumar <mohitamg@amazon.com>
Signed-off-by: Mohit Kumar <mohitamg@amazon.com>
Signed-off-by: Mohit Kumar <mohitamg@amazon.com>
2765dcb to
8842c03
Compare
…tion is already running, test start replication succeeds after stop cleans up, test idempotent stop replication can be called multiple times and test stop replication cleans up and allows restart Signed-off-by: Mohit Kumar <mohitamg@amazon.com>
8842c03 to
4f3d5ea
Compare
soosinha
reviewed
Mar 30, 2026
| ?: return emptyList() | ||
|
|
||
| return allTasks.tasks().filter { task -> | ||
| isReplicationTaskForIndex(task, indexName) && !task.isAssigned |
Member
There was a problem hiding this comment.
One of the issues currently is not assigned tasks are not getting cleared. We need to clear the assigned tasks as well.
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
When CCR is stopped or paused, all the index and shard replication tasks should be stopped. But if the stop/ pause is not completely successful, some of the replication tasks might stay running. This can cause conflict when we restart/resume the replication.
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoff.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.