HDDS-5052. [SCM HA Security] Handle leader changes between SCMInfo and getSCMSigned Cert in OM/SCM.#2100
Merged
bharatviswa504 merged 4 commits intoapache:masterfrom Apr 8, 2021
Merged
Conversation
Contributor
Author
|
The last commit is the changes proposed in this PR. It is dependent on HDDS-4915. |
6b963a4 to
38611ce
Compare
Contributor
Author
|
Rebased now. It is ready for review. |
1d213a4 to
de50360
Compare
Contributor
Author
|
Thank You @bshashikant for the review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.