Skip to content

[Backport 2.19] Clear Stale Persistent Tasks in Stop/Pause API#1677

Open
opensearch-trigger-bot[bot] wants to merge 1 commit into
2.19from
backport/backport-1629-to-2.19
Open

[Backport 2.19] Clear Stale Persistent Tasks in Stop/Pause API#1677
opensearch-trigger-bot[bot] wants to merge 1 commit into
2.19from
backport/backport-1629-to-2.19

Conversation

@opensearch-trigger-bot
Copy link
Copy Markdown
Contributor

Backport 7d5be63 from #1629

* Stab at Fixing integ tests

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Revert "Stab at Fixing integ tests"

This reverts commit 0e4b126.

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Stab at Fixing integ tests

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Fixing CVE-2026-25645 and CVE-2026-24400

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Adding validation in resume replication and stop replication api should clear all stale replication metadata

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Fixing StopReplicationIT

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Fixing SecurityCustomRolesIT and SingleClusterSanityIT

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Adding integ tests for test start replication is blocked when replication 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>

* Eliminating race condition between waitForClusterStateUpdate and removeReplicationTasksFromClusterState function

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Modifying test delete follower index when leader index is unavailable

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Removing try catch from stop api whereever not needed

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Adding ITs in Stop and StartReplicationITs

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Fix stale persistent task cleanup in stop/start/resume APIs to prevent orphaned tasks from blocking replication restart

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Remove duplicacy for validation in TransportReplicateIndexClusterManagerNodeAction.kt

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Addressing comments

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Using StaleTaskUtils.removeStaleTasksForIndex instead of removeStaleReplicationTasksFromClusterState in STOP api

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Fixing deletion of follower index when leader index is deleted

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Fixing deletion of follower index when leader index is deleted

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Fixing follower index automated deletion when leader index is deleted + Clear all unassigned tasks
Clear assigned tasks only if the task is not present in task manager or the assigned node is invalid

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Adding UTs for StaleTaskUtils.kt file

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Removing duplicate ITs from StartReplicationIT

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Removing duplicate ITs from StartReplicationIT

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Throw IllegalStateException for active running tasks during stale task cleanup instead of post-validation

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Throw IllegalStateException for active running tasks during stale task cleanup instead of post-validation

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Add removeAllTasksForIndex for Start API to clean up all tasks and revert removeStaleTasksForIndex to skip active tasks so Stop API no longer throws on running tasks

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Remove redundant validateNoActiveMetadata in Start API and duplicate stale task cleanup logging in Resume API

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

* Use removeAllTasksForIndex in Resume API to ensure clean slate before creating new tasks

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>

---------

Signed-off-by: Mohit Kumar <mohitamg@amazon.com>
Co-authored-by: Mohit Kumar <mohitamg@amazon.com>
(cherry picked from commit 7d5be63)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant