Skip to content
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

[2.x] Adding new stop-replication action in ism #1370

Open
wants to merge 6 commits into
base: 2.19
Choose a base branch
from

Conversation

aggarwalShivani
Copy link
Contributor

Description

Backport of #1198 on 2.x branch. Pls see the PR on main branch for complete background.
Mainly, the changes are ->

  • Imported replication utilities from common-utils project
  • Added a new action "stop-replication" for ism policies.
  • Added UTs and one integration test (with installation of ccr plugin in testClusters.integTest )

Related Issues

Resolves #726

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

opensearch-trigger-bot bot and others added 6 commits February 1, 2025 22:03
) (opensearch-project#1357)

Bumps [actions/setup-java](https://github.com/actions/setup-java) from 2 to 4.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...



(cherry picked from commit 49d0913)

Signed-off-by: dependabot[bot] <support@github.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…pensearch-project#1293) (opensearch-project#1353)

Bumps [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) from 1 to 4.
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md)
- [Commits](aws-actions/configure-aws-credentials@v1...v4)

---
updated-dependencies:
- dependency-name: aws-actions/configure-aws-credentials
  dependency-type: direct:production
  update-type: version-update:semver-major
...



(cherry picked from commit 5094cf8)

Signed-off-by: dependabot[bot] <support@github.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…rch-project#1295) (opensearch-project#1352)

Bumps [tibdex/github-app-token](https://github.com/tibdex/github-app-token) from 1.5.0 to 2.1.0.
- [Release notes](https://github.com/tibdex/github-app-token/releases)
- [Commits](tibdex/github-app-token@v1.5...v2.1.0)

---
updated-dependencies:
- dependency-name: tibdex/github-app-token
  dependency-type: direct:production
  update-type: version-update:semver-major
...



(cherry picked from commit 16a8e0f)

Signed-off-by: dependabot[bot] <support@github.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
opensearch-project#1348) (opensearch-project#1362)

Bumps [org.codehaus.plexus:plexus-utils](https://github.com/codehaus-plexus/plexus-utils) from 3.0.24 to 3.6.0.
- [Release notes](https://github.com/codehaus-plexus/plexus-utils/releases)
- [Commits](codehaus-plexus/plexus-utils@plexus-utils-3.0.24...plexus-utils-3.6.0)

---
updated-dependencies:
- dependency-name: org.codehaus.plexus:plexus-utils
  dependency-type: direct:production
  update-type: version-update:semver-minor
...



(cherry picked from commit 8e07130)

Signed-off-by: dependabot[bot] <support@github.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ject#1367)

* Add release notes for v2.19



* Added release notes for v2.19.0



* Added Release Notes for v2.19.0



---------


(cherry picked from commit eb6afa8)

Signed-off-by: Vaibhav Agarwal <vaibhoag@amazon.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>
Signed-off-by: aggarwalShivani <shivani.aggarwal@nokia.com>
@bowenlan-amzn
Copy link
Member

bowenlan-amzn commented Feb 22, 2025

@aggarwalShivani seems current stable branch is 2.19, can you click update branch button once for this PR.
2.x somehow is still on 2.19.0, trigger a PR #1380

Copy link
Member

@bowenlan-amzn bowenlan-amzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am good with these changes. I will try to run these on my local to make sure it works and merge these in.

@@ -313,6 +319,7 @@ def jobSchedulerFile = resolvePluginFile("opensearch-job-scheduler")
def notificationsCoreFile = resolvePluginFile("opensearch-notifications-core")
def notificationsFile = resolvePluginFile("notifications")
def securityPluginFile = resolvePluginFile("opensearch-security")
def ccrFile = resolvePluginFile("opensearch-security")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def ccrFile = resolvePluginFile("opensearch-security")
def ccrFile = resolvePluginFile("opensearch-cross-cluster-replication")

Comment on lines +71 to +73
ccr_build_download = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + opensearch_no_snapshot +
'/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-cross-cluster-replication-' + ccr_no_snapshot + '.zip'
ccr_resource_folder = "src/test/resources/replication"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ccr_build_download = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + opensearch_no_snapshot +
'/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-cross-cluster-replication-' + ccr_no_snapshot + '.zip'
ccr_resource_folder = "src/test/resources/replication"

@@ -35,6 +35,7 @@ buildscript {
job_scheduler_no_snapshot = opensearch_build
notifications_no_snapshot = opensearch_build
security_no_snapshot = opensearch_build
ccr_no_snapshot = opensearch_build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ccr_no_snapshot = opensearch_build

Comment on lines +40 to +45
val replicationPluginInterface: ReplicationPluginInterface = mock()
whenever(replicationPluginInterface.stopReplication(any(), any(), any()))
.thenAnswer { invocation ->
val listener = invocation.getArgument<ActionListener<AcknowledgedResponse>>(2)
listener.onResponse(stopReplicationResponse) // Simulate a successful response
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have time, can you try mock the client instead. Though there's another layer ReplicationPluginInterface in between, in the end, we still make the call using client so I hope it can work.
So we don't need to have that setter for ReplicationPluginInterface in the source code

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems you already tried #1198 (comment)

Let me try once then

waitFor {
val metadataInfo = getExplainManagedIndexMetaData(indexName).info.toString()
assertTrue(
metadataInfo.contains("cause=No replication in progress for index:" + indexName),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a failure? Can we also assert sth like step status is failed

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.

2 participants