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

Add RPC calls for peering storageCluster #2671

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

Conversation

rewantsoni
Copy link
Member

@rewantsoni rewantsoni commented Jun 20, 2024

Add the RPC calls for peer remote odf cluster, these include

  1. PeerStorageCluster

Part of RHSTOR-4886

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 20, 2024
Copy link
Contributor

openshift-ci bot commented Jun 20, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@rewantsoni rewantsoni marked this pull request as ready for review June 24, 2024 08:18
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 24, 2024
@rchikatw
Copy link
Contributor

rchikatw commented Jul 8, 2024

PR LGTM

message OffboardMirroringPeerResponse{}

// AcknowledgeMirrorPeerOnboardingRequest holds the information required to acknowledge the onboarding
message AcknowledgeMirrorPeerOnboardingRequest{
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe AcknowledgeOnboardingMirrorPeerRequest would be inline w/ other requests? wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking of changing it from MirroringPeer (as this name coincides with MirrorPeer CR from MCO) to whatever we decide to name the CR we decide in #2677

Copy link
Member Author

Choose a reason for hiding this comment

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

updated the name for the RPC calls

// OnboardMirroringPeerRequest holds the required information to validate and onboard Storage Provider cluster
message OnboardMirroringPeerRequest{
// onboardingTicket authenticates the secondary provider cluster
string onboardingTicket = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

is this going to be the same ticket that we use today?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this will be the same ticket but with a role for mirroring, changes for which are in #2669

@rewantsoni
Copy link
Member Author

/retest-required

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 12, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 13, 2024
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 18, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 19, 2024
@rewantsoni
Copy link
Member Author

/retest-required

Comment on lines 248 to 261
func (cc *OCSProviderClient) AcknowledgeOnboardingStorageClusterPeer(ctx context.Context, storageClusterPeerUID string) (*pb.AcknowledgeOnboardingStorageClusterPeerResponse, error) {
if cc.Client == nil || cc.clientConn == nil {
return nil, fmt.Errorf("provider client is closed")
}

req := &pb.AcknowledgeOnboardingStorageClusterPeerRequest{
StorageClusterPeerUID: storageClusterPeerUID,
}

apiCtx, cancel := context.WithTimeout(ctx, cc.timeout)
defer cancel()

return cc.Client.AcknowledgeOnboardingStorageClusterPeer(apiCtx, req)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this? Why can't we use the same ack function that we have for client requests?

return cc.Client.AcknowledgeOnboardingStorageClusterPeer(apiCtx, req)
}

func (cc *OCSProviderClient) GetMirroringInfo(ctx context.Context, storageClusterPeerUID string, blockPoolNames []string) (*pb.MirroringInfoResponse, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be GetPeerInfo, onboarding peer does not have, conceptually, anything to do with mirroring. We might use it in the future to pass other type of information between 2 or more clusters.


req := &pb.MirroringInfoRequest{
StorageClusterPeerUID: storageClusterPeerUID,
BlockPoolNames: blockPoolNames,
Copy link
Contributor

Choose a reason for hiding this comment

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

This need to be nested under a BlockPoolMirroring optional section

Comment on lines 253 to 255
req := &pb.AcknowledgeOnboardingStorageClusterPeerRequest{
StorageClusterPeerUID: storageClusterPeerUID,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is block pool mirroring intent provided via a separate call? if so I was not able to find it

return &pb.AcknowledgeOnboardingStorageClusterPeerResponse{}, nil
}

func (s *OCSProviderServer) GetMirroringInfo(_ context.Context, _ *pb.MirroringInfoRequest) (*pb.MirroringInfoResponse, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same logic as last comment

Suggested change
func (s *OCSProviderServer) GetMirroringInfo(_ context.Context, _ *pb.MirroringInfoRequest) (*pb.MirroringInfoResponse, error) {
func (s *OCSProviderServer) GetPeerInfo(_ context.Context, _ *pb.MirroringInfoRequest) (*pb.MirroringInfoResponse, error) {

Comment on lines 927 to 929
func (s *OCSProviderServer) AcknowledgeOnboardingStorageClusterPeer(_ context.Context, _ *pb.AcknowledgeOnboardingStorageClusterPeerRequest) (*pb.AcknowledgeOnboardingStorageClusterPeerResponse, error) {
return &pb.AcknowledgeOnboardingStorageClusterPeerResponse{}, nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

As explained in a previous comment, I don't see any value in having a separate ack process dedicated for cluster peering

Copy link
Contributor

openshift-ci bot commented Oct 8, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rewantsoni
Once this PR has been reviewed and has the lgtm label, please ask for approval from nb-ohad. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rewantsoni rewantsoni changed the title Add RPC calls for onboarding/offboarding secondary provider Add RPC calls for peering storageCluster Oct 8, 2024
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 9, 2024
ran make gen-protobuf to generate the code

Signed-off-by: Rewant Soni <[email protected]>
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 9, 2024
@rewantsoni
Copy link
Member Author

/retest-required

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.

5 participants