You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by da...@apache.org on 2023/12/19 04:33:02 UTC
(doris) branch master updated: [regression](memtable) add case for memtable flush error handle (#28285)
This is an automated email from the ASF dual-hosted git repository.
dataroaring 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 9c17f317675 [regression](memtable) add case for memtable flush error handle (#28285)
9c17f317675 is described below
commit 9c17f3176750e44940e1a37b4ba8f9696d34cb6e
Author: Ma1oneZhang <73...@users.noreply.github.com>
AuthorDate: Tue Dec 19 12:32:55 2023 +0800
[regression](memtable) add case for memtable flush error handle (#28285)
Co-authored-by: ziyang zhang <zh...@stu.cdut.edu.cn>
---
be/src/olap/memtable_flush_executor.cpp | 4 ++
.../test_memtable_flush_fault.groovy | 63 ++++++++++++++++++++++
2 files changed, 67 insertions(+)
diff --git a/be/src/olap/memtable_flush_executor.cpp b/be/src/olap/memtable_flush_executor.cpp
index bd13ea2cce9..e02048b4c88 100644
--- a/be/src/olap/memtable_flush_executor.cpp
+++ b/be/src/olap/memtable_flush_executor.cpp
@@ -28,6 +28,7 @@
#include "common/signal_handler.h"
#include "olap/memtable.h"
#include "olap/rowset/rowset_writer.h"
+#include "util/debug_points.h"
#include "util/doris_metrics.h"
#include "util/metrics.h"
#include "util/stopwatch.hpp"
@@ -79,6 +80,9 @@ std::ostream& operator<<(std::ostream& os, const FlushStatistic& stat) {
Status FlushToken::submit(std::unique_ptr<MemTable> mem_table) {
{
std::shared_lock rdlk(_flush_status_lock);
+ DBUG_EXECUTE_IF("FlushToken.submit_flush_error", {
+ _flush_status = Status::IOError("dbug_be_memtable_submit_flush_error");
+ });
if (!_flush_status.ok()) {
return _flush_status;
}
diff --git a/regression-test/suites/fault_injection_p0/test_memtable_flush_fault.groovy b/regression-test/suites/fault_injection_p0/test_memtable_flush_fault.groovy
new file mode 100644
index 00000000000..e1a4a1a3a76
--- /dev/null
+++ b/regression-test/suites/fault_injection_p0/test_memtable_flush_fault.groovy
@@ -0,0 +1,63 @@
+// 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_memtable_flush_fault") {
+ GetDebugPoint().clearDebugPointsForAllBEs()
+ def testTable = "test_memtable_flush_fault"
+ sql """ DROP TABLE IF EXISTS ${testTable}"""
+ def testTableDDL = """
+ create table ${testTable}
+ (
+ `id` LARGEINT NOT NULL,
+ `k1` DATE NOT NULL,
+ `k2` VARCHAR(20),
+ `k3` SMALLINT,
+ `k4` TINYINT,
+ `k5` DATETIME REPLACE DEFAULT "1970-01-01 00:00:00",
+ `k6` BIGINT SUM DEFAULT "0",
+ `k7` INT MAX DEFAULT "0",
+ `k8` INT MIN DEFAULT "99999"
+ )
+ AGGREGATE KEY(`id`, `k1`, `k2`, `k3`, `k4`)
+ DISTRIBUTED BY HASH(`id`) BUCKETS 1
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1"
+ );
+ """
+ def insert_sql = """
+ insert into ${testTable} values
+ (10000,"2017-10-01","北京",20,0,"2017-10-01 06:00:00",20,10,10),
+ (10000,"2017-10-01","北京",20,0,"2017-10-01 07:00:00",15,2,2),
+ (10001,"2017-10-01","北京",30,1,"2017-10-01 17:05:45",2,22,22),
+ (10002,"2017-10-02","上海",20,1,"2017-10-02 12:59:12",200,5,5),
+ (10003,"2017-10-02","广州",32,0,"2017-10-02 11:20:00",30,11,11),
+ (10004,"2017-10-01","深圳",35,0,"2017-10-01 10:00:15",100,3,3),
+ (10004,"2017-10-03","深圳",35,0,"2017-10-03 10:20:22",11,6,6);
+ """
+
+ sql testTableDDL
+ sql "sync"
+ try {
+ GetDebugPoint().enableDebugPointForAllBEs("FlushToken.submit_flush_error")
+ sql insert_sql
+ sql "sync"
+ } catch (Exception e){
+ assertTrue(e.getMessage().contains("[IO_ERROR]dbug_be_memtable_submit_flush_error"))
+ } finally {
+ GetDebugPoint().disableDebugPointForAllBEs("FlushToken.submit_flush_error")
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org