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

dataroaring 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 38a1491874f [fix](cloud) Correct versioned meta key for txn lazy 
committing (#55436)
38a1491874f is described below

commit 38a1491874f0b79e4f87009a75f4f042570b5274
Author: walter <[email protected]>
AuthorDate: Fri Aug 29 21:32:32 2025 +0800

    [fix](cloud) Correct versioned meta key for txn lazy committing (#55436)
---
 cloud/src/meta-service/txn_lazy_committer.cpp | 9 ++++++---
 cloud/test/txn_lazy_commit_test.cpp           | 7 +++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/cloud/src/meta-service/txn_lazy_committer.cpp 
b/cloud/src/meta-service/txn_lazy_committer.cpp
index fd1a5819ee5..10b035cf0dd 100644
--- a/cloud/src/meta-service/txn_lazy_committer.cpp
+++ b/cloud/src/meta-service/txn_lazy_committer.cpp
@@ -323,15 +323,18 @@ void convert_tmp_rowsets(
         if (is_versioned_write) {
             // If this is a versioned write, we need to put the rowset with 
versionstamp
             RowsetMetaCloudPB copied_rowset_meta(tmp_rowset_pb);
-            if (!versioned::document_put(txn.get(), rowset_key, versionstamp,
+            std::string rowset_load_key = versioned::meta_rowset_load_key(
+                    {instance_id, tmp_rowset_pb.tablet_id(), version});
+            if (!versioned::document_put(txn.get(), rowset_load_key, 
versionstamp,
                                          std::move(copied_rowset_meta))) {
                 code = MetaServiceCode::PROTOBUF_SERIALIZE_ERR;
                 ss << "failed to serialize rowset_meta, txn_id=" << txn_id
-                   << " key=" << hex(rowset_key);
+                   << " key=" << hex(rowset_load_key);
                 msg = ss.str();
                 return;
             }
-            LOG(INFO) << "put versioned rowset_key=" << hex(rowset_key) << " 
txn_id=" << txn_id;
+            LOG(INFO) << "put versioned rowset_key=" << hex(rowset_load_key)
+                      << " txn_id=" << txn_id;
         }
     }
 
diff --git a/cloud/test/txn_lazy_commit_test.cpp 
b/cloud/test/txn_lazy_commit_test.cpp
index 0994a3d9f1e..314ca547861 100644
--- a/cloud/test/txn_lazy_commit_test.cpp
+++ b/cloud/test/txn_lazy_commit_test.cpp
@@ -900,6 +900,13 @@ TEST(TxnLazyCommitVersionedReadTest, CommitTxnEventually) {
             check_tablet_idx_db_id(txn, db_id, tablet_id);
             check_tmp_rowset_not_exist(txn, tablet_id, txn_id);
             check_rowset_meta_exist(txn, tablet_id, 2);
+
+            // Check versioned rowset meta exists.
+            std::string rowset_key = 
versioned::meta_rowset_load_key({mock_instance, tablet_id, 2});
+            doris::RowsetMetaCloudPB rowset_val;
+            Versionstamp versionstamp;
+            ASSERT_EQ(versioned::document_get(txn.get(), rowset_key, 
&rowset_val, &versionstamp),
+                      TxnErrorCode::TXN_OK);
         }
     }
 


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

Reply via email to