This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new 9ba62f3e534 branch-3.0: [fix](wal) replay wal abort txn failed when
execute failed #55881 (#55923)
9ba62f3e534 is described below
commit 9ba62f3e534d85c77718f6dcb2d569d6497b3254
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Sep 12 09:16:48 2025 +0800
branch-3.0: [fix](wal) replay wal abort txn failed when execute failed
#55881 (#55923)
Cherry-picked from #55881
Co-authored-by: meiyi <[email protected]>
---
be/src/olap/wal/wal_table.cpp | 4 ++++
.../group_commit/test_group_commit_replay_wal.groovy | 16 ++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/be/src/olap/wal/wal_table.cpp b/be/src/olap/wal/wal_table.cpp
index aed180c86a3..a7bb2eba5d6 100644
--- a/be/src/olap/wal/wal_table.cpp
+++ b/be/src/olap/wal/wal_table.cpp
@@ -243,6 +243,8 @@ Status WalTable::_handle_stream_load(int64_t wal_id, const
std::string& wal,
RETURN_IF_ERROR(_construct_sql_str(wal, label, sql_str));
std::shared_ptr<StreamLoadContext> ctx =
std::make_shared<StreamLoadContext>(_exec_env);
ctx->sql_str = sql_str;
+ ctx->db_id = _db_id;
+ ctx->table_id = _table_id;
ctx->wal_id = wal_id;
ctx->label = label;
ctx->need_commit_self = false;
@@ -253,6 +255,8 @@ Status WalTable::_handle_stream_load(int64_t wal_id, const
std::string& wal,
ctx->load_src_type = TLoadSourceType::RAW;
ctx->max_filter_ratio = 1;
auto st = _http_stream_action->process_put(nullptr, ctx);
+ DBUG_EXECUTE_IF("WalTable::_handle_stream_load.fail",
+ { st =
Status::InternalError("WalTable::_handle_stream_load.fail"); });
if (st.ok()) {
// wait stream load finish
RETURN_IF_ERROR(ctx->future.get());
diff --git
a/regression-test/suites/insert_p0/group_commit/test_group_commit_replay_wal.groovy
b/regression-test/suites/insert_p0/group_commit/test_group_commit_replay_wal.groovy
index 0fbc3ec0a8d..856515b3350 100644
---
a/regression-test/suites/insert_p0/group_commit/test_group_commit_replay_wal.groovy
+++
b/regression-test/suites/insert_p0/group_commit/test_group_commit_replay_wal.groovy
@@ -100,7 +100,23 @@ suite("test_group_commit_replay_wal", "nonConcurrent") {
sleep(100)
}
+ // replay wal fail
+
GetDebugPoint().enableDebugPointForAllBEs("WalTable::_handle_stream_load.fail")
GetDebugPoint().clearDebugPointsForAllFEs()
+ getRowCount(4)
+
+ int expectedRowCount = 8
+ for (int i = 0; i < 30; i++) {
+ def result = sql "select count(*) from ${tableName}"
+ logger.info("table: ${tableName}, rowCount: ${result}, i: ${i}")
+ if (result[0][0] == expectedRowCount) {
+ break
+ }
+ sleep(1000)
+ if (i >= 4) {
+
GetDebugPoint().disableDebugPointForAllBEs("WalTable::_handle_stream_load.fail")
+ }
+ }
getRowCount(8)
// check wal count is 0
} catch (Exception e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]