deardeng commented on code in PR #67761:
URL: https://github.com/apache/doris/pull/67761#discussion_r3977245814


##########
cloud/src/meta-service/meta_service_txn.cpp:
##########
@@ -4653,75 +4675,115 @@ void MetaServiceImpl::get_prepare_txn_by_coordinator(
     }
     std::unique_ptr<RangeGetIterator> it;
     int32_t result_count = 0;
-    int64_t total_iteration_cnt = 0;
+    int64_t scanned_count = 0;
     bool has_start_time_filter = request->has_start_time();
 
-    do {
-        err = txn->get(begin_info_key, end_info_key, &it, true);
-        if (err != TxnErrorCode::TXN_OK) {
-            code = cast_as<ErrCategory::READ>(err);
-            ss << "failed to get txn info. err=" << err;
-            msg = ss.str();
+    auto process_txn_info = [&](std::string_view key, std::string_view value) 
-> TxnErrorCode {

Review Comment:
   Both lambdas capture and modify quite a bit of external state by reference. 
In particular, read_page reports errors through both its return value and the 
captured code/msg, making the retry path harder to follow. Could we extract the 
transaction-info processing into a separate function and simplify how page 
reads manage state and propagate errors?



-- 
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