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

w41ter 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 b797bb3377f [fix](cloud) Txn lazy committer update the txn commit op 
log min_versionstamp (#59448)
b797bb3377f is described below

commit b797bb3377faf5b376b38a39319063bcc68b90b7
Author: walter <[email protected]>
AuthorDate: Thu Jan 8 15:57:18 2026 +0800

    [fix](cloud) Txn lazy committer update the txn commit op log 
min_versionstamp (#59448)
---
 cloud/src/meta-service/txn_lazy_committer.cpp | 35 +++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/cloud/src/meta-service/txn_lazy_committer.cpp 
b/cloud/src/meta-service/txn_lazy_committer.cpp
index b7801c2706d..9b6dafdd67a 100644
--- a/cloud/src/meta-service/txn_lazy_committer.cpp
+++ b/cloud/src/meta-service/txn_lazy_committer.cpp
@@ -231,6 +231,29 @@ void convert_tmp_rowsets(
     // tablet_id -> stats
     std::unordered_map<int64_t, TabletStats> tablet_stats;
 
+    OperationLogPB op_log;
+    if (is_versioned_write) {
+        std::string log_key = 
encode_versioned_key(versioned::log_key({instance_id}), versionstamp);
+        ValueBuf log_value;
+        err = blob_get(txn.get(), log_key, &log_value);
+        if (err != TxnErrorCode::TXN_OK) {
+            code = err == TxnErrorCode::TXN_KEY_NOT_FOUND ? 
MetaServiceCode::TXN_ID_NOT_FOUND
+                                                          : 
cast_as<ErrCategory::READ>(err);
+            ss << "failed to get operation log, txn_id=" << txn_id << " key=" 
<< hex(log_key)
+               << " err=" << err;
+            msg = ss.str();
+            LOG(WARNING) << msg;
+            return;
+        }
+        if (!log_value.to_pb(&op_log)) {
+            code = MetaServiceCode::PROTOBUF_PARSE_ERR;
+            ss << "failed to parse operation log pb, txn_id=" << txn_id << " 
key=" << hex(log_key);
+            msg = ss.str();
+            LOG(WARNING) << msg;
+            return;
+        }
+    }
+
     int64_t rowsets_visible_ts_ms =
             
duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
 
@@ -432,6 +455,18 @@ void convert_tmp_rowsets(
         }
         LOG(INFO) << "batch get " << existing_versioned_stats.size()
                   << " versioned tablet stats, txn_id=" << txn_id;
+
+        int64_t min_timestamp = meta_reader.min_read_versionstamp().version();
+        int64_t old_min_timestamp = op_log.min_timestamp();
+        if (min_timestamp < op_log.min_timestamp()) {
+            op_log.set_min_timestamp(min_timestamp);
+
+            std::string log_key_prefix = versioned::log_key({instance_id});
+            versioned::blob_put(txn.get(), log_key_prefix, versionstamp, 
op_log);
+            LOG(INFO) << "update operation log min_timestamp from " << 
old_min_timestamp << " to "
+                      << min_timestamp << " txn_id=" << txn_id
+                      << " log_versionstamp=" << versionstamp.to_string();
+        }
     }
 
     for (auto& [tablet_id, stats] : tablet_stats) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to