SWJTU-ZhangLei commented on code in PR #38243:
URL: https://github.com/apache/doris/pull/38243#discussion_r1708566284


##########
cloud/src/meta-service/meta_service.cpp:
##########
@@ -387,10 +410,28 @@ void 
MetaServiceImpl::batch_get_version(::google::protobuf::RpcController* contr
                         msg = "malformed version value";
                         break;
                     }
+                    if (version_pb.has_txn_id()) {
+                        txn.reset();
+                        std::shared_ptr<TxnLazyCommitTask> task =
+                                txn_lazy_committer_->submit(instance_id, 
version_pb.txn_id());
+                        std::tie(code, msg) = task->wait();
+                        if (code != MetaServiceCode::OK) {
+                            LOG(WARNING) << "wait txn lazy commit failed, 
txn_id="
+                                         << version_pb.txn_id();
+                            break;
+                        }
+                        goto TRY_AGAIN;
+                    }
                     response->add_versions(version_pb.version());
                     
response->add_version_update_time_ms(version_pb.update_time_ms());
                 }
             }
+            if (code != MetaServiceCode::OK) {
+                break;
+            }
+        }
+        if (code != MetaServiceCode::OK) {
+            break;

Review Comment:
   > Delete the useless code
   
   done



##########
cloud/src/meta-service/meta_service.cpp:
##########
@@ -387,10 +410,28 @@ void 
MetaServiceImpl::batch_get_version(::google::protobuf::RpcController* contr
                         msg = "malformed version value";
                         break;
                     }
+                    if (version_pb.has_txn_id()) {
+                        txn.reset();
+                        std::shared_ptr<TxnLazyCommitTask> task =
+                                txn_lazy_committer_->submit(instance_id, 
version_pb.txn_id());
+                        std::tie(code, msg) = task->wait();
+                        if (code != MetaServiceCode::OK) {
+                            LOG(WARNING) << "wait txn lazy commit failed, 
txn_id="
+                                         << version_pb.txn_id();
+                            break;
+                        }
+                        goto TRY_AGAIN;

Review Comment:
   > We don't need to retry again, just like the `get_version`, returning the 
version directly is enough.
   
   done



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to