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


##########
be/src/runtime/group_commit_mgr.cpp:
##########
@@ -245,31 +245,32 @@ Status GroupCommitTable::_create_group_commit_load(
     {
         load_block_queue = std::make_shared<LoadBlockQueue>(
                 instance_id, label, txn_id, schema_version, 
_all_block_queues_bytes,
-                result.wait_internal_group_commit_finish, 
result.group_commit_interval_ms);
+                result.wait_internal_group_commit_finish, 
result.group_commit_interval_ms, wal_dir);
         std::unique_lock l(_lock);
         _load_block_queues.emplace(instance_id, load_block_queue);
         _need_plan_fragment = false;
         _exec_env->wal_mgr()->add_wal_status_queue(_table_id, txn_id,
                                                    
WalManager::WAL_STATUS::PREPARE);
         //create wal
-        RETURN_IF_ERROR(
-                load_block_queue->create_wal(_db_id, _table_id, txn_id, label, 
_exec_env->wal_mgr(),
-                                             params.desc_tbl.slotDescriptors, 
be_exe_version));
+        RETURN_IF_ERROR(load_block_queue->create_wal(
+                _db_id, _table_id, txn_id, label, _exec_env->wal_mgr(),
+                params.desc_tbl.slotDescriptors, be_exe_version, wal_dir));
         _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,
+                             !wal_dir.empty());
     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, 
!wal_dir.empty()));
     }
     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 59 
(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:275:** +1, including nesting penalty 
of 0, nesting level increased to 1
   ```cpp
       if (status.ok()) {
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:282:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
           if (state) {
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:289:** nesting level increased to 2
   ```cpp
                   [&request, &result](FrontendServiceConnection& client) {
                   ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:294:** +1, nesting level increased to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:305:** nesting level increased to 2
   ```cpp
                   [&request, &result](FrontendServiceConnection& client) {
                   ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:315:** +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:318:** +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:318:** +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:319:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
               if (prepare_failed || !status.ok()) {
               ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:319:** +1
   ```cpp
               if (prepare_failed || !status.ok()) {
                                  ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:330:** +1, including nesting penalty 
of 0, nesting level increased to 1
   ```cpp
       if (!st.ok()) {
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:336:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
           if (!prepare_failed) {
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:338:** +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:338:** +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:339:** +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:339:** +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:348:** +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:348:** +1
   ```cpp
       if (!prepare_failed && !result_status.ok()) {
                           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:350:** +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:350:** +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:351:** +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:351:** +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:356:** +1, nesting level increased to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:357:** +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:357:** +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:358:** +2, including nesting penalty 
of 1, nesting level increased to 2
   ```cpp
           if (write_wal) {
           ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:363:** +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:363:** +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:368:** +1, including nesting penalty 
of 0, nesting level increased to 1
   ```cpp
       if (prepare_failed) {
       ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:370:** +1, nesting level increased to 1
   ```cpp
       } else {
         ^
   ```
   **be/src/runtime/group_commit_mgr.cpp:374:** +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:374:** +1
   ```cpp
       if (state && !(state->get_error_log_file_path().empty())) {
                 ^
   ```
   
   </details>
   



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