Skip to content

HDDS-5052. [SCM HA Security] Handle leader changes between SCMInfo and getSCMSigned Cert in OM/SCM.#2100

Merged
bharatviswa504 merged 4 commits intoapache:masterfrom
bharatviswa504:HDDS-5052
Apr 8, 2021
Merged

HDDS-5052. [SCM HA Security] Handle leader changes between SCMInfo and getSCMSigned Cert in OM/SCM.#2100
bharatviswa504 merged 4 commits intoapache:masterfrom
bharatviswa504:HDDS-5052

Conversation

@bharatviswa504
Copy link
Contributor

@bharatviswa504 bharatviswa504 commented Mar 31, 2021

What changes were proposed in this pull request?

This Jira is to handle leader change between getScmInfo and getScmSignedCert.

Problem:
Leader is SCM1 - Returned SCMID is SCM1ID
ScmInfo returns the leader SCMID which is SCM1ID.

Leader is SCM2 - SCM ID is SCM2ID
getSCMSignedCert, during generate certificate it has a check compare the scmId passed in CSR, is same as current SCM scmID

In this case when the leader change between these 2 calls OM will fail to get a Certificate.

Proposed Solution:
Discuss with Xiaoyu offline, and we decided to eliminate persist scmId and check SCMID during OM startup.

We persist SCM ClusteriD for both HA/non-HA in OzoneManager.

And in SCM we remove the SCMID check and keep the SCM ClusterID check. (ClusterID is unique for a single Ozone cluster)

In SCM previously sub-CA subject looks like CN=scm-sub@host,OU=fetchedSCMID from primary,O=ClusterID
After this change sub-CA subject will be CN=scm-sub@host,OU=local SCMID,O=ClusterID

For OM/DN the subject names are the same as before.

And as SCMID is used in Subject CN name, not touched that, so that the certificate subject will be in the same format before/after the upgrade.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-5052

How was this patch tested?

Existing docker tests.

@bharatviswa504
Copy link
Contributor Author

The last commit is the changes proposed in this PR. It is dependent on HDDS-4915.

@bharatviswa504
Copy link
Contributor Author

Rebased now. It is ready for review.

@bharatviswa504 bharatviswa504 changed the title HDDS-5052. [SCM HA Security] Handle leader changes between SCMInfo and getSCMSigned Cert in OM. HDDS-5052. [SCM HA Security] Handle leader changes between SCMInfo and getSCMSigned Cert in OM/SCM. Apr 1, 2021
Copy link
Contributor

@bshashikant bshashikant left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@bharatviswa504 bharatviswa504 merged commit 6b57765 into apache:master Apr 8, 2021
@bharatviswa504
Copy link
Contributor Author

Thank You @bshashikant for the review.

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