This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.0 by this push:
new d285daf9b66 branch-4.0: [fix](cloud) Txn lazy committer update the txn
commit op log min_versionstamp #59448 (#59711)
d285daf9b66 is described below
commit d285daf9b660848495f6b549a50d86fbac678f36
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Jan 13 10:22:26 2026 +0800
branch-4.0: [fix](cloud) Txn lazy committer update the txn commit op log
min_versionstamp #59448 (#59711)
Cherry-picked from #59448
Co-authored-by: walter <[email protected]>
---
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 9edf21a8a1a..2556630e964 100644
--- a/cloud/src/meta-service/txn_lazy_committer.cpp
+++ b/cloud/src/meta-service/txn_lazy_committer.cpp
@@ -232,6 +232,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();
@@ -433,6 +456,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]