amaliujia commented on code in PR #12075:
URL: https://github.com/apache/ozone/pull/12075#discussion_r4624280671


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/XceiverServerRatis.java:
##########
@@ -237,7 +245,14 @@ private int determinePort(String key, int defaultValue) {
   }
 
   private ContainerStateMachine getStateMachine(RaftGroupId gid) {
-    return new ContainerStateMachine(datanodeService, gid, dispatcher, 
containerController,
+    ReplicationType type = addingGroups.get(gid);
+    if (type == null) {
+      // The type is unknown when the group is reloaded on restart or added by 
a peer.
+      // TODO HDDS-17845: support restart for CHAINED.
+      LOG.info("{}: ReplicationType is unknown, use {}", gid, 
ReplicationType.RATIS);

Review Comment:
   I know we defer handing of the DN restart, but is this LOG.info becomes too 
noisy now after DN restarts? Because per my understanding, the DN restart will 
lose the replication type from the ContainerSM as that was not persisted.
   
   Then
   1. Maybe lower the level of this log?
   2. Probably we add a persisted metadata for RaftGroup then the replication 
type is consistent with the RaftGroup and managed by Ratis. This can be 
deferred (and likely need the Ratis change).



-- 
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]

Reply via email to