jt2594838 commented on code in PR #18833:
URL: https://github.com/apache/iotdb/pull/18833#discussion_r4322222968


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/consensus/deletion/persist/PageCacheDeletionBuffer.java:
##########
@@ -372,11 +377,15 @@ private void persistDeletion() throws IOException {
       // For first deletion we use blocking take() method.
       try {
         DeletionResource firstDeletionResource = deletionResources.take();
-        // Serialize deletion. The first serialization cannot fail because a 
deletion cannot exceed
-        // size of serializeBuffer.
-        serializeDeletionToBatchBuffer(firstDeletionResource);
         pendingDeletionsInOneTask.add(firstDeletionResource);
         currentTaskDeletionCount++;
+        // A deletion can exceed the DAL buffer even when it is the first 
entry in a batch.
+        // Include it in failure handling so it cannot be acknowledged without 
being written.
+        if (!serializeDeletionToBatchBuffer(firstDeletionResource)) {
+          throw new IOException(
+              DataNodePipeMessages
+                  
.EXCEPTION_DELETION_RESOURCE_EXCEEDS_THE_DAL_BUFFER_SIZE_E2A17CAC);
+        }

Review Comment:
   Are `pendingDeletionsInOneTask` and `currentTaskDeletionCount` properly 
handled when the exception is raised?



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

Reply via email to