adoroszlai commented on code in PR #7964:
URL: https://github.com/apache/ozone/pull/7964#discussion_r1970485656


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/AbstractContainerReportHandler.java:
##########
@@ -132,6 +132,13 @@ private void updateContainerStats(final DatanodeDetails 
datanodeDetails,
                                     final ContainerInfo containerInfo,
                                     final ContainerReplicaProto replicaProto)
       throws ContainerNotFoundException {
+    if (containerInfo.getState() == HddsProtos.LifeCycleState.CLOSED && 
containerInfo.getSequenceId() <
+        replicaProto.getBlockCommitSequenceId()) {
+      logger.error(
+          "There is a CLOSED container with lower sequence ID than a replica. 
Container: {}, Container's " +
+              "sequence ID: {}, Replica: {}, Replica's sequence ID: {}, 
Datanode: {}.", containerInfo,
+          containerInfo.getSequenceId(), replicaProto, 
replicaProto.getBlockCommitSequenceId(), datanodeDetails);

Review Comment:
   Protobuf message (`replicaProto`) is converted to string using newline as 
separator.  I think that looks odd in the log:
   
   ```
   Replica: containerID: 1
   state: OPEN
   keyCount: 101
   blockCommitSequenceId: 101
   originNodeId: "49dcc98b-f44d-4adc-b973-879044d1ab65"
   isEmpty: true
   ,
   ```
   
   Should we convert single line, something like for audit log?
   
   
https://github.com/apache/ozone/blob/052bd2deef51e79090e3f61ca47ec82eedf85e6f/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMDatanodeProtocolServer.java#L311
   
   
https://github.com/apache/ozone/blob/052bd2deef51e79090e3f61ca47ec82eedf85e6f/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMDatanodeProtocolServer.java#L483-L488



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