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


##########
be/src/runtime/group_commit_mgr.cpp:
##########
@@ -257,19 +263,20 @@ Status GroupCommitTable::_create_group_commit_load(
                                              params.desc_tbl.slotDescriptors, 
be_exe_version));
         _cv.notify_all();
     }
-    st = _exec_plan_fragment(_db_id, _table_id, label, txn_id, is_pipeline, 
params,
-                             pipeline_params);
+    st = _exec_plan_fragment(_db_id, _table_id, label, txn_id, is_pipeline, 
params, pipeline_params,
+                             write_wal);
     if (!st.ok()) {
         static_cast<void>(_finish_group_commit_load(_db_id, _table_id, label, 
txn_id, instance_id,
-                                                    st, true, nullptr));
+                                                    st, true, nullptr, 
write_wal));
     }
     return st;
 }
 
 Status GroupCommitTable::_finish_group_commit_load(int64_t db_id, int64_t 
table_id,

Review Comment:
   warning: function '_finish_group_commit_load' has cognitive complexity of 74 
(threshold 50) [readability-function-cognitive-complexity]
   ```cpp
   Status GroupCommitTable::_finish_group_commit_load(int64_t db_id, int64_t 
table_id,
                            ^
   ```
   <details>
   <summary>Additional context</summary>
   
   **be/src/runtime/group_commit_mgr.cpp:281:** +1, including nesting penalty 
of 0, nesting level increased to 1
   ```cpp
       if (status.ok()) {
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:288:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
           if (state) {
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:295:** nesting level increased to 2
   ```cpp
                   [&request, &result](FrontendServiceConnection& client) {
                   ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:300:** +1, nesting level increased to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:311:** nesting level increased to 2
   ```cpp
                   [&request, &result](FrontendServiceConnection& client) {
                   ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:321:** +1, including nesting penalty 
of 0, nesting level increased to 1
   ```cpp
           if (it != _load_block_queues.end()) {
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:324:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
               RETURN_IF_ERROR(load_block_queue->close_wal());
               ^
   ```
   **be/src/common/status.h:532:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:324:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
               RETURN_IF_ERROR(load_block_queue->close_wal());
               ^
   ```
   **be/src/common/status.h:534:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:325:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
               if (prepare_failed || !status.ok()) {
               ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:325:** +1
   ```cpp
               if (prepare_failed || !status.ok()) {
                                  ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:336:** +1, including nesting penalty 
of 0, nesting level increased to 1
   ```cpp
       if (!st.ok()) {
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:342:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
           if (!prepare_failed) {
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:344:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
               RETURN_IF_ERROR(_exec_env->wal_mgr()->get_wal_path(txn_id, 
wal_path));
               ^
   ```
   **be/src/common/status.h:532:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:344:** +4, including nesting penalty 
of 3, nesting level increased to 4
   ```cpp
               RETURN_IF_ERROR(_exec_env->wal_mgr()->get_wal_path(txn_id, 
wal_path));
               ^
   ```
   **be/src/common/status.h:534:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:345:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
               RETURN_IF_ERROR(_exec_env->wal_mgr()->add_recover_wal(
               ^
   ```
   **be/src/common/status.h:532:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:345:** +4, including nesting penalty 
of 3, nesting level increased to 4
   ```cpp
               RETURN_IF_ERROR(_exec_env->wal_mgr()->add_recover_wal(
               ^
   ```
   **be/src/common/status.h:534:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:350:** +1, nesting level increased to 2
   ```cpp
           } else {
             ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:351:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
               RETURN_IF_ERROR(_exec_env->wal_mgr()->delete_wal(txn_id));
               ^
   ```
   **be/src/common/status.h:532:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:351:** +4, including nesting penalty 
of 3, nesting level increased to 4
   ```cpp
               RETURN_IF_ERROR(_exec_env->wal_mgr()->delete_wal(txn_id));
               ^
   ```
   **be/src/common/status.h:534:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:352:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
               
RETURN_IF_ERROR(_exec_env->wal_mgr()->erase_wal_status_queue(table_id, txn_id));
               ^
   ```
   **be/src/common/status.h:532:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:352:** +4, including nesting penalty 
of 3, nesting level increased to 4
   ```cpp
               
RETURN_IF_ERROR(_exec_env->wal_mgr()->erase_wal_status_queue(table_id, txn_id));
               ^
   ```
   **be/src/common/status.h:534:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:357:** +1, including nesting penalty 
of 0, nesting level increased to 1
   ```cpp
       if (!prepare_failed && !result_status.ok() &&
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:357:** +1
   ```cpp
       if (!prepare_failed && !result_status.ok() &&
                                                  ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:360:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_exec_env->wal_mgr()->get_wal_path(txn_id, 
wal_path));
           ^
   ```
   **be/src/common/status.h:532:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:360:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_exec_env->wal_mgr()->get_wal_path(txn_id, 
wal_path));
           ^
   ```
   **be/src/common/status.h:534:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:361:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
           
RETURN_IF_ERROR(_exec_env->wal_mgr()->add_recover_wal(std::to_string(db_id),
           ^
   ```
   **be/src/common/status.h:532:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:361:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
           
RETURN_IF_ERROR(_exec_env->wal_mgr()->add_recover_wal(std::to_string(db_id),
           ^
   ```
   **be/src/common/status.h:534:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:366:** +1, nesting level increased to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:367:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
           RETURN_IF_ERROR(_exec_env->wal_mgr()->delete_wal(txn_id));
           ^
   ```
   **be/src/common/status.h:532:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:367:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
           RETURN_IF_ERROR(_exec_env->wal_mgr()->delete_wal(txn_id));
           ^
   ```
   **be/src/common/status.h:534:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:368:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
           if (write_wal) {
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:373:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
           
RETURN_IF_ERROR(_exec_env->wal_mgr()->erase_wal_status_queue(table_id, txn_id));
           ^
   ```
   **be/src/common/status.h:532:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
       do {                                \
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:373:** +3, including nesting penalty 
of 2, nesting level increased to 3
   ```cpp
           
RETURN_IF_ERROR(_exec_env->wal_mgr()->erase_wal_status_queue(table_id, txn_id));
           ^
   ```
   **be/src/common/status.h:534:** expanded from macro 'RETURN_IF_ERROR'
   ```cpp
           if (UNLIKELY(!_status_.ok())) { \
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:378:** +1, including nesting penalty 
of 0, nesting level increased to 1
   ```cpp
       if (prepare_failed) {
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:380:** +1, nesting level increased to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:384:** +1, including nesting penalty 
of 0, nesting level increased to 1
   ```cpp
       if (state && !(state->get_error_log_file_path().empty())) {
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:384:** +1
   ```cpp
       if (state && !(state->get_error_log_file_path().empty())) {
                 ^
   ```
   
   </details>
   



##########
be/src/runtime/group_commit_mgr.cpp:
##########
@@ -472,4 +502,10 @@
     }
     return Status::OK();
 }
+
+bool LoadBlockQueue::is_wal_disk_space_enough() {

Review Comment:
   warning: method 'is_wal_disk_space_enough' can be made static 
[readability-convert-member-functions-to-static]
   
   be/src/runtime/group_commit_mgr.h:74:
   ```diff
   -     bool is_wal_disk_space_enough();
   +     static bool is_wal_disk_space_enough();
   ```
   



-- 
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: commits-unsubscr...@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to