From 3cac6806b424f38c001a6fcb1e39f4c0fea85145 Mon Sep 17 00:00:00 2001 From: Yongqiang YANG <98214048+dataroaring@users.noreply.github.com> Date: Tue, 19 Sep 2023 15:10:38 +0800 Subject: [PATCH] [fix](txn) persist txn record of single replica load and ccr ingestion (#24543) Otherwise txn would be dropped when a be reboots. --- be/src/service/backend_service.cpp | 2 +- be/src/service/internal_service.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/be/src/service/backend_service.cpp b/be/src/service/backend_service.cpp index 776559a1b5e000..b537b018b19e1f 100644 --- a/be/src/service/backend_service.cpp +++ b/be/src/service/backend_service.cpp @@ -693,7 +693,7 @@ void BackendService::ingest_binlog(TIngestBinlogResult& result, Status commit_txn_status = StorageEngine::instance()->txn_manager()->commit_txn( local_tablet->data_dir()->get_meta(), rowset_meta->partition_id(), rowset_meta->txn_id(), rowset_meta->tablet_id(), local_tablet->tablet_uid(), - rowset_meta->load_id(), rowset, true); + rowset_meta->load_id(), rowset, false); if (!commit_txn_status && !commit_txn_status.is()) { auto err_msg = fmt::format( "failed to commit txn for remote tablet. rowset_id: {}, remote_tablet_id={}, " diff --git a/be/src/service/internal_service.cpp b/be/src/service/internal_service.cpp index 523875170f9d34..525e9ea0248470 100644 --- a/be/src/service/internal_service.cpp +++ b/be/src/service/internal_service.cpp @@ -1444,7 +1444,7 @@ void PInternalServiceImpl::request_slave_tablet_pull_rowset( Status commit_txn_status = StorageEngine::instance()->txn_manager()->commit_txn( tablet->data_dir()->get_meta(), rowset_meta->partition_id(), rowset_meta->txn_id(), rowset_meta->tablet_id(), tablet->tablet_uid(), rowset_meta->load_id(), rowset, - true); + false); if (!commit_txn_status && !commit_txn_status.is()) { LOG(WARNING) << "failed to add committed rowset for slave replica. rowset_id=" << rowset_meta->rowset_id() << ", tablet_id=" << rowset_meta->tablet_id()