You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by zh...@apache.org on 2023/04/03 08:11:29 UTC

[doris] 01/03: [bugfix](publish) fix TabletLoadInfo may released by delete txn (#17986)

This is an automated email from the ASF dual-hosted git repository.

zhangchen pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 058fb4e420cf38034d421b55811347a3e739c153
Author: yixiutt <10...@users.noreply.github.com>
AuthorDate: Fri Mar 24 20:14:34 2023 +0800

    [bugfix](publish) fix TabletLoadInfo may released by delete txn (#17986)
---
 be/src/olap/task/engine_publish_version_task.cpp | 10 +++++++---
 be/src/olap/txn_manager.cpp                      | 10 +++++-----
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/be/src/olap/task/engine_publish_version_task.cpp b/be/src/olap/task/engine_publish_version_task.cpp
index 0422912944..f8847c173c 100644
--- a/be/src/olap/task/engine_publish_version_task.cpp
+++ b/be/src/olap/task/engine_publish_version_task.cpp
@@ -183,9 +183,13 @@ Status EnginePublishVersionTask::finish() {
         }
     }
 
-    LOG(INFO) << "finish to publish version on transaction."
-              << "transaction_id=" << transaction_id << ", cost(us): " << watch.get_elapse_time_us()
-              << ", error_tablet_size=" << _error_tablet_ids->size() << ", res=" << res.to_string();
+    if (!res.is<PUBLISH_VERSION_NOT_CONTINUOUS>()) {
+        LOG(INFO) << "finish to publish version on transaction."
+                  << "transaction_id=" << transaction_id
+                  << ", cost(us): " << watch.get_elapse_time_us()
+                  << ", error_tablet_size=" << _error_tablet_ids->size()
+                  << ", res=" << res.to_string();
+    }
     return res;
 }
 
diff --git a/be/src/olap/txn_manager.cpp b/be/src/olap/txn_manager.cpp
index e953ed87e2..474b4c8936 100644
--- a/be/src/olap/txn_manager.cpp
+++ b/be/src/olap/txn_manager.cpp
@@ -298,7 +298,7 @@ Status TxnManager::publish_txn(OlapMeta* meta, TPartitionId partition_id,
     pair<int64_t, int64_t> key(partition_id, transaction_id);
     TabletInfo tablet_info(tablet_id, schema_hash, tablet_uid);
     RowsetSharedPtr rowset_ptr = nullptr;
-    TabletTxnInfo* load_info = nullptr;
+    TabletTxnInfo load_info;
     {
         {
             std::unique_lock<std::mutex> txn_rlock(_get_txn_lock(transaction_id));
@@ -310,8 +310,8 @@ Status TxnManager::publish_txn(OlapMeta* meta, TPartitionId partition_id,
                 if (load_itr != it->second.end()) {
                     // found load for txn,tablet
                     // case 1: user commit rowset, then the load id must be equal
-                    load_info = &load_itr->second;
-                    rowset_ptr = load_info->rowset;
+                    load_info = load_itr->second;
+                    rowset_ptr = load_info.rowset;
                 }
             }
         }
@@ -323,13 +323,13 @@ Status TxnManager::publish_txn(OlapMeta* meta, TPartitionId partition_id,
             rowset_ptr->make_visible(version);
             // update delete_bitmap
             {
-                if (load_info != nullptr && load_info->unique_key_merge_on_write) {
+                if (load_info.unique_key_merge_on_write) {
                     auto tablet =
                             StorageEngine::instance()->tablet_manager()->get_tablet(tablet_id);
                     if (tablet == nullptr) {
                         return Status::OK();
                     }
-                    RETURN_IF_ERROR(tablet->update_delete_bitmap(rowset_ptr, load_info));
+                    RETURN_IF_ERROR(tablet->update_delete_bitmap(rowset_ptr, &load_info));
                     std::shared_lock rlock(tablet->get_header_lock());
                     tablet->save_meta();
                 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org