sumitagrawl commented on code in PR #11505:
URL: https://github.com/apache/ozone/pull/11505#discussion_r4642202871
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java:
##########
@@ -101,6 +102,7 @@ public class SCMRatisServerImpl implements SCMRatisServer {
"Ratis request timeout cannot be less than 1000ms.");
final RaftGroupId groupId = buildRaftGroupId(scm.getClusterId());
+ verifyNoOtherRaftGroup(conf, groupId);
Review Comment:
When multiple group is present, the exception is thrown to constructuor or
createScm() .... and what happens in this case ? do SCM fails to start ?
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMStateMachine.java:
##########
@@ -192,6 +192,10 @@ public void initialize(RaftServer server, RaftGroupId id,
@Override
public CompletableFuture<Message> applyTransaction(
final TransactionContext trx) {
+ if (!isInitialized) {
+ LOG.warn("Skipping applyTransaction {} on the bootstrap state machine",
TermIndex.valueOf(trx.getLogEntry()));
+ return CompletableFuture.completedFuture(Message.EMPTY);
Review Comment:
This will ignore the ratis transaction, we need exit SCM if there is any
concern like this, as this can cause inconsistent state between leader and
followers (as raft log may be ignored in some node and causes difference)
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMRatisServerImpl.java:
##########
@@ -147,6 +150,43 @@ public static void initialize(String clusterId, String
scmId,
}
}
+ /**
+ * Fail if the SCM Ratis storage directory contains any Raft group directory.
+ * A new cluster has none, so any existing one is stale.
+ */
+ public static void verifyNoRaftGroup(ConfigurationSource conf) throws
IOException {
+ verifyNoOtherRaftGroup(conf, null);
Review Comment:
here, groupId is null, and if (childGroupId.equals(groupId)) will be false
causing to throw exception always. There seems some gap in the logic where
caller do not have handling of exception immediately.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]