You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/04/04 12:04:38 UTC

[doris] branch master updated: [fix](chore) fix compile failed in JdbcExecutor and revert #18306 since be crash randomly (#18371)

This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new e29fc3b46b [fix](chore) fix compile failed in JdbcExecutor and revert #18306 since be crash randomly (#18371)
e29fc3b46b is described below

commit e29fc3b46b5bb746c5343bd33475a36d7c4e9483
Author: morrySnow <10...@users.noreply.github.com>
AuthorDate: Tue Apr 4 20:04:28 2023 +0800

    [fix](chore) fix compile failed in JdbcExecutor and revert #18306 since be crash randomly (#18371)
    
    fix 2 problems:
    1. PR #18187 use the api resizeColumn in JNINativeMethod has been removed by #17960
    2. revert PR #18306 to fix pipeline core when load
---
 be/src/pipeline/exec/scan_operator.cpp                           | 3 +++
 be/src/vec/exec/scan/pip_scanner_context.h                       | 9 ---------
 be/src/vec/exec/scan/scanner_context.cpp                         | 9 +++++++++
 be/src/vec/exec/scan/scanner_context.h                           | 2 ++
 fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java | 4 ++--
 5 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/be/src/pipeline/exec/scan_operator.cpp b/be/src/pipeline/exec/scan_operator.cpp
index 1720e5da67..60864c6dd9 100644
--- a/be/src/pipeline/exec/scan_operator.cpp
+++ b/be/src/pipeline/exec/scan_operator.cpp
@@ -38,6 +38,9 @@ bool ScanOperator::can_read() {
             // _scanner_ctx->no_schedule(): should schedule _scanner_ctx
             return true;
         } else {
+            if (_node->_scanner_ctx->has_enough_space_in_blocks_queue()) {
+                _node->_scanner_ctx->reschedule_scanner_ctx();
+            }
             return _node->ready_to_read(); // there are some blocks to process
         }
     }
diff --git a/be/src/vec/exec/scan/pip_scanner_context.h b/be/src/vec/exec/scan/pip_scanner_context.h
index b2ac463e53..cacc61df1d 100644
--- a/be/src/vec/exec/scan/pip_scanner_context.h
+++ b/be/src/vec/exec/scan/pip_scanner_context.h
@@ -57,15 +57,6 @@ public:
             }
         }
         _current_used_bytes -= (*block)->allocated_bytes();
-        {
-            if (has_enough_space_in_blocks_queue()) {
-                std::unique_lock<std::mutex> l(_transfer_lock);
-                auto submit_st = _scanner_scheduler->submit(this);
-                if (submit_st.ok()) {
-                    _num_scheduling_ctx++;
-                }
-            }
-        }
         return Status::OK();
     }
 
diff --git a/be/src/vec/exec/scan/scanner_context.cpp b/be/src/vec/exec/scan/scanner_context.cpp
index 74e619c5fe..0b3cbcd3d7 100644
--- a/be/src/vec/exec/scan/scanner_context.cpp
+++ b/be/src/vec/exec/scan/scanner_context.cpp
@@ -288,6 +288,15 @@ std::string ScannerContext::debug_string() {
             _max_thread_num, _block_per_scanner, _cur_bytes_in_queue, _max_bytes_in_queue);
 }
 
+void ScannerContext::reschedule_scanner_ctx() {
+    std::lock_guard l(_transfer_lock);
+    auto submit_st = _scanner_scheduler->submit(this);
+    //todo(wb) rethinking is it better to mark current scan_context failed when submit failed many times?
+    if (submit_st.ok()) {
+        _num_scheduling_ctx++;
+    }
+}
+
 void ScannerContext::push_back_scanner_and_reschedule(VScanner* scanner) {
     {
         std::unique_lock l(_scanners_lock);
diff --git a/be/src/vec/exec/scan/scanner_context.h b/be/src/vec/exec/scan/scanner_context.h
index 1e6732961a..1d937c5fb8 100644
--- a/be/src/vec/exec/scan/scanner_context.h
+++ b/be/src/vec/exec/scan/scanner_context.h
@@ -128,6 +128,8 @@ public:
         return _cur_bytes_in_queue < _max_bytes_in_queue / 2;
     }
 
+    void reschedule_scanner_ctx();
+
     // the unique id of this context
     std::string ctx_id;
     int32_t queue_idx = -1;
diff --git a/fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java b/fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java
index 5ac0844f5c..e20e41520d 100644
--- a/fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java
+++ b/fe/java-udf/src/main/java/org/apache/doris/udf/JdbcExecutor.java
@@ -1289,7 +1289,7 @@ public class JdbcExecutor {
             }
         }
         byte[] bytes = new byte[offsets[numRows - 1]];
-        long bytesAddr = JNINativeMethod.resizeColumn(charsAddr, offsets[numRows - 1]);
+        long bytesAddr = JNINativeMethod.resizeStringColumn(charsAddr, offsets[numRows - 1]);
         int dst = 0;
         for (int i = 0; i < numRows; i++) {
             for (int j = 0; j < byteRes[i].length; j++) {
@@ -1336,7 +1336,7 @@ public class JdbcExecutor {
             }
         }
         byte[] bytes = new byte[offsets[numRows - 1]];
-        long bytesAddr = JNINativeMethod.resizeColumn(charsAddr, offsets[numRows - 1]);
+        long bytesAddr = JNINativeMethod.resizeStringColumn(charsAddr, offsets[numRows - 1]);
         int dst = 0;
         for (int i = 0; i < numRows; i++) {
             for (int j = 0; j < byteRes[i].length; j++) {


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