lokeshj1703 commented on a change in pull request #1072: HDDS-1766.
ContainerStateMachine is unable to increment lastAppliedTermIndex. Contributed
by Mukul Kumar Singh.
URL: https://github.com/apache/hadoop/pull/1072#discussion_r302098470
##########
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java
##########
@@ -554,12 +556,12 @@ private ByteString getCachedStateMachineData(Long
logIndex, long term,
}
} catch (Exception e) {
metrics.incNumReadStateMachineFails();
- LOG.error("unable to read stateMachineData:" + e);
+ LOG.error("{} unable to read stateMachineData:", gid, e);
return completeExceptionally(e);
}
}
- private void updateLastApplied() {
+ private synchronized void updateLastApplied() {
Review comment:
@mukul1987 Thanks for working on this! The patch looks good to me.
I think we can avoid using synchronized by using a concurrent sorted map.
Each applyTransaction removes its corresponding entry from the map and we
update lastApplied based on the first entry in the map?
----------------------------------------------------------------
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]