mkuchenbecker commented on code in PR #5145:
URL: https://github.com/apache/hadoop/pull/5145#discussion_r1028382408


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/driver/impl/StateStoreFileBaseImpl.java:
##########
@@ -366,7 +375,7 @@ public <T extends BaseRecord> boolean putAll(
         }
       }
       // Commit
-      if (!rename(recordPathTemp, recordPath)) {
+      if (success && !rename(recordPathTemp, recordPath)) {

Review Comment:
   This logic doesn't seem right.`success` is scoped to the function and this 
rename is within the for loop. As soon as any write fails we will never commit 
any changes; if that'd the case we should likely just `break`. 
   
   So either we want to not commit any changes after the first failure, in 
which case we should break or we need a different variable. 



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

Reply via email to