diff --git a/be/src/service/internal_service.cpp b/be/src/service/internal_service.cpp index 29d9e9ad36304d..8ab2b06a805e9d 100644 --- a/be/src/service/internal_service.cpp +++ b/be/src/service/internal_service.cpp @@ -2262,10 +2262,11 @@ void PInternalServiceImpl::group_commit_insert(google::protobuf::RpcController* st = Status::Error(ErrorCode::INTERNAL_ERROR, "_exec_plan_fragment_impl meet unknown error"); } + closure_guard.release(); if (!st.ok()) { - LOG(WARNING) << "exec plan fragment failed, errmsg=" << st; + LOG(WARNING) << "exec plan fragment failed, load_id=" << print_id(load_id) + << ", errmsg=" << st; } else { - closure_guard.release(); for (int i = 0; i < request->data().size(); ++i) { std::unique_ptr row(new PDataRow()); row->CopyFrom(request->data(i)); diff --git a/regression-test/suites/insert_p0/group_commit/test_group_commit_error.groovy b/regression-test/suites/insert_p0/group_commit/test_group_commit_error.groovy new file mode 100644 index 00000000000000..749da71117bc4d --- /dev/null +++ b/regression-test/suites/insert_p0/group_commit/test_group_commit_error.groovy @@ -0,0 +1,55 @@ +// 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_group_commit_error", "nonConcurrent") { + def tableName = "test_group_commit_error" + + sql """ DROP TABLE IF EXISTS ${tableName} """ + sql """ + CREATE TABLE IF NOT EXISTS ${tableName} ( + `k` int , + `v` int , + ) engine=olap + DISTRIBUTED BY HASH(`k`) + BUCKETS 5 + properties("replication_num" = "1", "group_commit_interval_ms"="2000") + """ + + GetDebugPoint().clearDebugPointsForAllBEs() + GetDebugPoint().clearDebugPointsForAllFEs() + try { + GetDebugPoint().enableDebugPointForAllBEs("FragmentMgr.exec_plan_fragment.failed") + sql """ set group_commit = async_mode """ + sql """ insert into ${tableName} values (1, 1) """ + // assertTrue(false) + } catch (Exception e) { + logger.info("failed: " + e.getMessage()) + } finally { + GetDebugPoint().clearDebugPointsForAllBEs() + } + + try { + GetDebugPoint().enableDebugPointForAllBEs("FragmentMgr.exec_plan_fragment.failed") + sql """ set group_commit = async_mode """ + sql """ set enable_nereids_planner = false """ + sql """ insert into ${tableName} values (2, 2) """ + } catch (Exception e) { + logger.info("failed: " + e.getMessage()) + } finally { + GetDebugPoint().clearDebugPointsForAllBEs() + } +}