supratimdeka 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_r320313492
##########
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/HddsDispatcher.java
##########
@@ -228,11 +231,14 @@ private ContainerCommandResponseProto dispatchRequest(
audit(action, eventType, params, AuditEventStatus.FAILURE, sce);
return ContainerUtils.logAndReturnError(LOG, sce, msg);
}
- Preconditions.checkArgument(isWriteStage && containerIdSet != null
+ Preconditions.checkArgument(isWriteStage && container2BCSIDMap != null
|| dispatcherContext == null);
- if (containerIdSet != null) {
+ if (container2BCSIDMap != null) {
// adds this container to list of containers created in the pipeline
- containerIdSet.add(containerID);
+ // with initial BCSID recorded as 0.
+ Preconditions
+ .checkArgument(!container2BCSIDMap.containsKey(containerID));
Review comment:
is this assert safe? asking the question because there was no equivalent
assert before.
trying to imagine a situation where this might be a false alarm - is this
possible?
1. container create is successful,
2. container2BCSIDMap.putIfAbsent is successful
3. datanode restarts - container2BCSIDMap is persisted, but the container
itself is not persisted (create container involves a rename operation which may
not be sync'ed inline)
----------------------------------------------------------------
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]