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

Adding replication (CCR) plugin interface and classes to common-utils #667

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

aggarwalShivani
Copy link

Description

Background:

  • This change is required for a new feature being added in ism plugin - unfollow-action #726 - integrating ccr and ism plugins.
  • For this feature, ism plugin needs to invoke stop-replication action from ccr. As both ccr and ism need to invoke some common code, the common code can be moved to common-utils, as done previously for other plugins too. For ex. notifications plugin
  • As sharing of libraries also leads to a type-cast and class-loading issue - previously seen with notification plugin - the request object needs to be of a higher-level class from opensearch-core like ActionRequest and later be recreated into required type i.e. StopIndexReplicationRequest.

Proposed Solution:

  1. Common-utils: Move common code of stop-replication from ccr project to common-utils.
  2. CCR: Modify ccr plugin to consume classes from common-utils. Also, create a new TransportAction that transforms the request into required type and invokes TransportStopIndexReplicationAction.
  3. ISM: Add new action in ism
    (FYI - This is an alternative approach for this feature. I had also raised a draft PR with a different approach, but we didnt go ahead with it as it required changes in opensearch-core as well.)

Change description:
Code for StopIndexReplicationRequest and StopIndexReplicationAction are moved to common-utils. Added UTs for both the new classes added.
This PR caters to point 1 of the proposed solution.

Issues Resolved

Related Issues
unfollow-action #726

Check List

  • New functionality includes testing.
    • All tests pass
  • [ ] New functionality has been documented.
    • [ ] New functionality has javadoc added
  • Commits are signed per the DCO using --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.

Signed-off-by: aggarwalShivani <shivani.aggarwal@nokia.com>
aggarwalShivani and others added 2 commits July 8, 2024 16:31
aggarwalShivani and others added 2 commits January 29, 2025 17:39
@aggarwalShivani
Copy link
Author

Hi,
For this change, some CI failures are due to AcknowledgedResponse moving to org.opensearch.action.support.clustermanager. Will repush once the integration issue with common-utils, ccr, ism on main branch is resolved
As discussed with @bowenlan-amzn, raised backport PR on 2.x branch (#789).

@aggarwalShivani
Copy link
Author

Hi, For this change, some CI failures are due to AcknowledgedResponse moving to org.opensearch.action.support.clustermanager. Will repush once the integration issue with common-utils, ccr, ism on main branch is resolved As discussed with @bowenlan-amzn, raised backport PR on 2.x branch (#789).

Hi @bowenlan-amzn

The integration issue of common-utils and ccr is resolved with the merge of this change in ccr.
ISM continues to remain blocked though until this issue is resolved.

Meanwhile, as the changes for the stop-replication feature for both common-utlis and ccr are ready, requesting your review on this.
Backport PR is also ready for review #789

/**
* Transport action plugin interfaces for the cross-cluster-replication plugin.
*/
open class ReplicationPluginInterface {
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
open class ReplicationPluginInterface {
object ReplicationPluginInterface {

Copy link
Member

Choose a reason for hiding this comment

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

Feels like the methods here should just be static methods.

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.

3 participants