github-actions[bot] commented on code in PR #70810:
URL: https://github.com/apache/doris/pull/70810#discussion_r4658349804


##########
common/cpp/obj-storage/client/s3_obj_storage_client.cpp:
##########
@@ -526,6 +526,9 @@ ObjStorageResponse S3ObjStorageClient::delete_objects(const 
ObjStoragePath& opts
                     .http_code = 
static_cast<int>(delete_outcome.GetError().GetResponseCode()),
                     .request_id = delete_outcome.GetError().GetRequestId()};
         }
+        const size_t deleted_in_batch =
+                (end - begin) - delete_outcome.GetResult().GetErrors().size();
+        client_bvar::s3_deleted_objects_total << deleted_in_batch;

Review Comment:
   [P2] Count successful single-object S3 deletes in s3_deleted_objects_total. 
This new update only runs in delete_objects; S3ObjStorageClient::delete_object 
returns OK without incrementing it, and BE file deletion plus cloud recycler 
delete_file use that single-object path (all S3-compatible subclasses inherit 
it). Increment the counter on the successful single-delete return so the metric 
does not undercount normal deletions, while keeping NOT_FOUND and failed 
requests uncounted.



##########
common/cpp/obj-storage/client/azure_obj_storage_client.cpp:
##########
@@ -176,6 +176,9 @@ struct AzureBatchDeleter {
             return resp;
         }
 
+        size_t deleted_count = 0;
+        std::unique_ptr<int, std::function<void(int*)>> defer(
+                (int*)0x01, [&](int*) { client_bvar::s3_deleted_objects_total 
<< deleted_count; });

Review Comment:
   [P2] Consume all Azure batch responses before publishing the deleted count. 
SubmitBatch sends the full batch, but this loop returns on the first 
Deleted=false or non-NotFound exception, so later DeferredResponse values that 
may represent successful deletions are never read and deleted_count remains a 
prefix. Accumulate all Deleted=true results while preserving the first error 
for the return value, then update the metric with the complete successful count.



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