This is an automated email from the ASF dual-hosted git repository. gavinchou 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 e9b8db6334f [fix](bug) Fix `Config.max_query_retry_time=1` analysis planner is null (#47287) e9b8db6334f is described below commit e9b8db6334f6c1723e81842ebb452e3ea2e1a5a2 Author: deardeng <deng...@selectdb.com> AuthorDate: Tue Jan 28 23:02:01 2025 +0800 [fix](bug) Fix `Config.max_query_retry_time=1` analysis planner is null (#47287) Fix when set Config.max_query_retry_time=1, sql `show variables where variable_name = 'insert_timeout'` report error Cannot invoke "org.apache.doris.planner.Planner.handleQueryInFe(org.apache.doris.analysis.StatementBase)" because "this.planner" is null --- .../java/org/apache/doris/qe/StmtExecutor.java | 5 ++-- .../suites/control_p0/test_set_max_retry.groovy | 29 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java index 04b4539febe..3c93aa2aa54 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java @@ -899,7 +899,8 @@ public class StmtExecutor { private void handleQueryWithRetry(TUniqueId queryId) throws Exception { // queue query here int retryTime = Config.max_query_retry_time; - for (int i = 0; i <= retryTime; i++) { + retryTime = retryTime <= 0 ? 1 : retryTime + 1; + for (int i = 0; i < retryTime; i++) { try { // reset query id for each retry if (i > 0) { @@ -1412,7 +1413,7 @@ public class StmtExecutor { int analyzeTimes = 2; if (Config.isCloudMode()) { // be core and be restarted, need retry more times - analyzeTimes = Config.max_query_retry_time / 2; + analyzeTimes = Math.max(Config.max_query_retry_time / 2, 2); } for (int i = 1; i <= analyzeTimes; i++) { MetaLockUtils.readLockTables(tables); diff --git a/regression-test/suites/control_p0/test_set_max_retry.groovy b/regression-test/suites/control_p0/test_set_max_retry.groovy new file mode 100644 index 00000000000..8569499c920 --- /dev/null +++ b/regression-test/suites/control_p0/test_set_max_retry.groovy @@ -0,0 +1,29 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +suite('test_set_max_retry', 'nonConcurrent') { + setFeConfigTemporary([max_query_retry_time:1]) { + sql """set enable_sql_cache=true""" + def ret = sql_return_maparray """show variables where variable_name = 'insert_timeout';""" + assertEquals("insert_timeout" ,ret[0].Variable_name) + assertTrue(ret[0].Value as int > 0); + sql """set enable_sql_cache=false""" + ret = sql_return_maparray """show variables where variable_name = 'insert_timeout';""" + assertEquals("insert_timeout" ,ret[0].Variable_name) + assertTrue(ret[0].Value as int > 0); + } +} --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org