aswinshakil commented on code in PR #9656:
URL: https://github.com/apache/ozone/pull/9656#discussion_r3197800995


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/SnapshotDeletingService.java:
##########
@@ -247,39 +248,180 @@ private void submitSnapshotPurgeRequest(List<String> 
purgeSnapshotKeys) {
       }
     }
 
-    private void submitSnapshotMoveDeletedKeys(SnapshotInfo snapInfo,
-                                               List<SnapshotMoveKeyInfos> 
deletedKeys,
-                                               List<HddsProtos.KeyValue> 
renamedList,
-                                               List<SnapshotMoveKeyInfos> 
dirsToMove) {
-
-      SnapshotMoveTableKeysRequest.Builder moveDeletedKeysBuilder = 
SnapshotMoveTableKeysRequest.newBuilder()
+    /**
+     * Submits a single batch of snapshot move requests.
+     *
+     * @param snapInfo The snapshot being processed
+     * @param deletedKeys List of deleted keys to move
+     * @param renamedList List of renamed keys
+     * @param dirsToMove List of deleted directories to move
+     * @return true if submission was successful, false otherwise
+     */
+    private boolean submitSingleSnapshotMoveBatch(SnapshotInfo snapInfo,
+                                                   List<SnapshotMoveKeyInfos> 
deletedKeys,
+                                                   List<HddsProtos.KeyValue> 
renamedList,
+                                                   List<SnapshotMoveKeyInfos> 
dirsToMove) {
+      SnapshotMoveTableKeysRequest.Builder moveDeletedKeys = 
SnapshotMoveTableKeysRequest.newBuilder()
           .setFromSnapshotID(toProtobuf(snapInfo.getSnapshotId()));
 
-      SnapshotMoveTableKeysRequest moveDeletedKeys = moveDeletedKeysBuilder
-          .addAllDeletedKeys(deletedKeys)
-          .addAllRenamedKeys(renamedList)
-          .addAllDeletedDirs(dirsToMove)
-          .build();
-      if (isBufferLimitCrossed(ratisByteLimit, 0, 
moveDeletedKeys.getSerializedSize())) {

Review Comment:
   We have removed the logic for `MIN_ERR_LIMIT_PER_TASK` from all the 
BackgroundService. This logic is more aligned with the batching logic we use 
for `DirectoryDeletingService`. Here`submitSnapshotMoveDeletedKeysWithBatching` 
batches the entire iteration. If the keys goes beyond the Ratis Byte Buffer 
limit then we split the request to satisfy the byte limit and send them instead 
of sending just `MIN_ERR_LIMIT_PER_TASK=1000`



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