kerneltime commented on code in PR #7490:
URL: https://github.com/apache/ozone/pull/7490#discussion_r1947788273
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/checksum/ContainerChecksumTreeManager.java:
##########
@@ -99,12 +104,18 @@ public void writeContainerDataTree(ContainerData data,
ContainerMerkleTree tree)
checksumInfoBuilder =
ContainerProtos.ContainerChecksumInfo.newBuilder();
}
+ ContainerProtos.ContainerMerkleTree treeProto =
captureLatencyNs(metrics.getCreateMerkleTreeLatencyNS(),
+ tree::toProto);
checksumInfoBuilder
.setContainerID(containerID)
-
.setContainerMerkleTree(captureLatencyNs(metrics.getCreateMerkleTreeLatencyNS(),
tree::toProto));
+ .setContainerMerkleTree(treeProto);
write(data, checksumInfoBuilder.build());
- LOG.debug("Data merkle tree for container {} updated", containerID);
+ // If write succeeds, update the checksum in memory. Otherwise 0 will be
used to indicate the metadata failure.
Review Comment:
As discussed, the in-memory hash should be what is written to disk as it is
an in-memory cache. If updating the Merkle tree is failing, we can have a
metric + log message and/or a status report to SCM or a new Admin API to
Datanode to query the Merkle tree (I think there are going to be multiple debug
scenarios where we would like to query a Datanode what it knows independent of
SCM reports).
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/checksum/ContainerChecksumTreeManager.java:
##########
@@ -99,12 +104,18 @@ public void writeContainerDataTree(ContainerData data,
ContainerMerkleTree tree)
checksumInfoBuilder =
ContainerProtos.ContainerChecksumInfo.newBuilder();
}
+ ContainerProtos.ContainerMerkleTree treeProto =
captureLatencyNs(metrics.getCreateMerkleTreeLatencyNS(),
+ tree::toProto);
checksumInfoBuilder
.setContainerID(containerID)
-
.setContainerMerkleTree(captureLatencyNs(metrics.getCreateMerkleTreeLatencyNS(),
tree::toProto));
+ .setContainerMerkleTree(treeProto);
write(data, checksumInfoBuilder.build());
- LOG.debug("Data merkle tree for container {} updated", containerID);
+ // If write succeeds, update the checksum in memory. Otherwise 0 will be
used to indicate the metadata failure.
Review Comment:
Should there be a way to tell if a checksum failed vs. scanner has not yet
run? Should failure to generate checksum == -1?
--
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]