bshashikant commented on a change in pull request #923: HDDS-1654. Ensure 
container state on datanode gets synced to disk whennever state change happens.
URL: https://github.com/apache/hadoop/pull/923#discussion_r301879028
 
 

 ##########
 File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/transport/server/ratis/ContainerStateMachine.java
 ##########
 @@ -249,6 +249,9 @@ public long takeSnapshot() throws IOException {
       LOG.info("Taking a snapshot to file {}", snapshotFile);
       try (FileOutputStream fos = new FileOutputStream(snapshotFile)) {
         persistContainerSet(fos);
+        fos.flush();
+        // make sure the snapshot file is synced
 
 Review comment:
   We need to persist the state on disk to ensure we don't read an incorrect 
replica state on restart. We have come across an issue where, unhealthy state 
of a replica was not persisted on disk and on restart , it was detected as an 
open replica which may end up taking more IO on restart causing inconsistencies.

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

Reply via email to