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


##########
be/src/cloud/cloud_delta_writer.cpp:
##########
@@ -99,9 +101,16 @@ Status CloudDeltaWriter::write(const Block* block, const 
TabletAddRowsPayload& r
     CHECK(_is_init || _is_cancelled);
     {
         SCOPED_TIMER(_wait_flush_limit_timer);
-        while (_memtable_writer->flush_running_count() >=
-               config::memtable_flush_running_count_limit) {
+        auto* s3_file_upload_pool = 
ExecEnv::GetInstance()->s3_file_upload_thread_pool();

Review Comment:
   [P1] Preserve high-priority load isolation. This process-global queue check 
is unconditional, so 101 queued uploads from ordinary loads or background cloud 
work now block an otherwise idle high-priority add-block RPC. That conflicts 
with LoadChannelMgr's explicit decision to skip blocking memtable pressure for 
high-priority channels because it can cause RPC timeouts, and differs from the 
removed writer-local flush count, which unrelated writers could not trigger. 
Please bypass this cross-load gate for high-priority writers or make S3 
admission priority-aware.



##########
be/src/cloud/cloud_delta_writer.cpp:
##########
@@ -99,9 +101,16 @@ Status CloudDeltaWriter::write(const Block* block, const 
TabletAddRowsPayload& r
     CHECK(_is_init || _is_cancelled);
     {
         SCOPED_TIMER(_wait_flush_limit_timer);
-        while (_memtable_writer->flush_running_count() >=
-               config::memtable_flush_running_count_limit) {
+        auto* s3_file_upload_pool = 
ExecEnv::GetInstance()->s3_file_upload_thread_pool();
+        bool need_back_press = false;
+        if (s3_file_upload_pool != nullptr) {
+            need_back_press = s3_file_upload_pool->get_queue_size() >
+                              
AdaptiveThreadPoolController::kS3QueueBusyThreshold;
+        }
+        while (need_back_press) {

Review Comment:
   [P1] Make this global-pressure wait cancellable. write() holds _mtx 
throughout this unbounded loop, but cancel_with_status(), close(), and 
flush_memtable_async() all need the same mutex. A cancel or timeout-cleaner can 
therefore block behind this writer while unrelated uploads keep the 
process-global queue above 100; enough blocked add-block calls can also occupy 
the fixed heavy RPC pool that runs the cancel RPC. The loop observes neither 
cancellation nor shutdown. Please avoid waiting under the writer mutex and use 
bounded, cancellation-aware admission, revalidating writer state after 
reacquiring the lock.



##########
be/src/cloud/cloud_delta_writer.cpp:
##########
@@ -99,9 +101,16 @@ Status CloudDeltaWriter::write(const Block* block, const 
TabletAddRowsPayload& r
     CHECK(_is_init || _is_cancelled);
     {
         SCOPED_TIMER(_wait_flush_limit_timer);
-        while (_memtable_writer->flush_running_count() >=
-               config::memtable_flush_running_count_limit) {
+        auto* s3_file_upload_pool = 
ExecEnv::GetInstance()->s3_file_upload_thread_pool();
+        bool need_back_press = false;
+        if (s3_file_upload_pool != nullptr) {
+            need_back_press = s3_file_upload_pool->get_queue_size() >

Review Comment:
   [P1] Account for upload work before it reaches this queue. get_queue_size() 
excludes active uploads and completely misses the unbounded 
NonBlockCloseThreadPool queue. With the default 64 upload workers stalled, 64 
close workers can each submit a final part and wait, leaving only 64 queued 
uploads—below this >100 gate—while every later small-segment close(true) queues 
in the close pool retaining an allocated 5 MiB pending buffer that has not 
reached the monitored pool. Concurrent writers can also pass this sample 
without reserving capacity. Please reserve byte/work capacity before buffer 
allocation or async-close admission, covering pending-close, queued, and active 
uploads with balanced release, or retain a per-writer cap.



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