gavinchou commented on code in PR #54278:
URL: https://github.com/apache/doris/pull/54278#discussion_r2258740384


##########
cloud/src/meta-service/meta_service.cpp:
##########
@@ -3531,69 +3592,79 @@ bool 
MetaServiceImpl::get_mow_tablet_stats_and_meta(MetaServiceCode& code, std::
     };
     auto table_id = request->table_id();
     std::stringstream ss;
+    bool is_versioned_read = is_version_read_enabled(instance_id);
     if (!config::enable_batch_get_mow_tablet_stats_and_meta) {
         for (const auto& tablet_idx : request->tablet_indexes()) {
             // 1. get compaction cnts
             TabletStatsPB tablet_stat;
-            std::string stats_key =
-                    stats_tablet_key({instance_id, tablet_idx.table_id(), 
tablet_idx.index_id(),
-                                      tablet_idx.partition_id(), 
tablet_idx.tablet_id()});
-            std::string stats_val;
-            TxnErrorCode err = txn->get(stats_key, &stats_val);
-            TEST_SYNC_POINT_CALLBACK(
-                    
"get_delete_bitmap_update_lock.get_compaction_cnts_inject_error", &err);
-            if (err == TxnErrorCode::TXN_TOO_OLD) {
-                code = MetaServiceCode::OK;
-                err = txn_kv_->create_txn(&txn);
+            if (!is_versioned_read) {

Review Comment:
   看下能不能 `if (is_versioned_reader)` 来分岔新的逻辑
   这个 if 增加了缩进, 代码块也太大了, 其他地方类似 考虑下 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to