bshashikant commented on a change in pull request #1364: HDDS-1843.
Undetectable corruption after restart of a datanode.
URL: https://github.com/apache/hadoop/pull/1364#discussion_r320887895
##########
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/HddsDispatcher.java
##########
@@ -329,6 +336,21 @@ private ContainerCommandResponseProto dispatchRequest(
}
}
+ private void updateBCSID(Container container,
+ DispatcherContext dispatcherContext, ContainerProtos.Type cmdType) {
+ long bcsID = container.getBlockCommitSequenceId();
+ long containerId = container.getContainerData().getContainerID();
+ Map<Long, Long> container2BCSIDMap;
+ if (dispatcherContext != null && (cmdType == ContainerProtos.Type.PutBlock
+ || cmdType == ContainerProtos.Type.PutSmallFile)) {
+ container2BCSIDMap = dispatcherContext.getContainer2BCSIDMap();
+ Preconditions.checkNotNull(container2BCSIDMap);
+ Preconditions.checkArgument(container2BCSIDMap.containsKey(containerId));
+ // updates the latest BCSID on every putBlock or putSmallFile
+ // transaction over Ratis.
+ container2BCSIDMap.computeIfPresent(containerId, (u, v) -> v = bcsID);
Review comment:
will address in the next patch.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]