bharatviswa504 commented on a change in pull request #2034:
URL: https://github.com/apache/ozone/pull/2034#discussion_r595697759
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMCertStore.java
##########
@@ -56,14 +60,14 @@
/**
* A Certificate Store class that persists certificates issued by SCM CA.
*/
-public class SCMCertStore implements CertificateStore {
+public final class SCMCertStore implements CertificateStore {
private static final Logger LOG =
LoggerFactory.getLogger(SCMCertStore.class);
private SCMMetadataStore scmMetadataStore;
private final Lock lock;
private AtomicLong crlSequenceId;
- public SCMCertStore(SCMMetadataStore dbStore, long sequenceId) {
+ private SCMCertStore(SCMMetadataStore dbStore, long sequenceId) {
Review comment:
This was an intentional choice not to make CertStore DB updates use
transactionalBuffer. The reason is, there is no in-memory map(Like how
containerstateManager has), to get immediate reads work (Read operation after a
write). (Or we should use table cache and add to table cache, and then
listCerts need to be modified for it). As the request for certs in a cluster is
a number of nodes in the cluster, so made this choice of directly persisting to
DB.
When I am about to type it is idempotent, I see there is a problem, as for
replay transaction because of below check looks
if ((getCertificateByID(serialID, VALID_CERTS) != null) ||
(getCertificateByID(serialID, CertType.REVOKED_CERTS) != null)) {
throw new SCMSecurityException("Conflicting certificate ID");
}
If we move this check to DefaultCAServer, then storeValidCertificate will be
an idempotent operation, and we will not have a replay issue. Let me know if
this makes sense, I will open a Jira to fix this.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]