You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "szetszwo (via GitHub)" <gi...@apache.org> on 2023/05/23 17:26:40 UTC

[GitHub] [ozone] szetszwo commented on a diff in pull request #4761: HDDS-8259. [hsync] OMKeyRequest: Detect allocated but uncommitted blocks

szetszwo commented on code in PR #4761:
URL: https://github.com/apache/ozone/pull/4761#discussion_r1202746596


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java:
##########
@@ -217,8 +217,12 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       omKeyInfo.setModificationTime(commitKeyArgs.getModificationTime());
       // Update the block length for each block, return the allocated but
       // uncommitted blocks
-      List<OmKeyLocationInfo> uncommitted = omKeyInfo.updateLocationInfoList(
-          locationInfoList, false);
+      List<OmKeyLocationInfo> uncommitted;
+      if (isHSync) {
+        uncommitted = new ArrayList<>();

Review Comment:
   Use `Collections.emptyList()` since it only needs a readonly list.



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java:
##########
@@ -160,6 +160,28 @@ public void testOfsHSync() throws Exception {
     }
   }
 
+  @Test
+  public void testUncommittedBlocks() throws Exception {

Review Comment:
   How could this test verify the fix?



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org