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


##########
cloud/src/meta-service/meta_service_partition.cpp:
##########
@@ -739,6 +953,196 @@ void MetaServiceImpl::commit_partition_internal(const 
PartitionRequest* request,
         }
     };
 
+    if (request->object_type() == IndexObjectTypePB::TABLE_STREAM) {
+        MultiVersionStatus multi_version_status;
+        TableStreamReadResult status_result = 
read_table_stream_multi_version_status(
+                txn.get(), instance_id, TableStreamReadIntent::CONFLICT, 
&multi_version_status);
+        if (!status_result.ok()) {
+            code = status_result.code;
+            msg = std::move(status_result.message);
+            return;
+        }
+        const bool is_versioned_write = 
is_table_stream_versioned_write(multi_version_status);
+        const int64_t stream_id = request->index_ids(0);
+
+        std::string recycle_index_val;
+        err = txn->get(recycle_index_key({instance_id, stream_id}), 
&recycle_index_val);
+        const bool create_in_progress = err == TxnErrorCode::TXN_OK;
+        if (err != TxnErrorCode::TXN_OK && err != 
TxnErrorCode::TXN_KEY_NOT_FOUND) {
+            code = cast_as<ErrCategory::READ>(err);
+            msg = fmt::format("failed to read table stream recycle index, 
err={}", err);
+            return;
+        }
+        RecycleIndexPB recycle_index;
+        if (create_in_progress) {
+            if (!recycle_index.ParseFromString(recycle_index_val)) {
+                code = MetaServiceCode::PROTOBUF_PARSE_ERR;
+                msg = "malformed table stream recycle index value";
+                return;
+            }
+            if (!table_stream_recycle_index_matches(recycle_index, *request)) {
+                code = MetaServiceCode::INVALID_ARGUMENT;
+                msg = "table stream partition commit does not match PREPARED 
index";

Review Comment:
   what does it mean to user, when the "match" fail?
   make it more readabile for DBA and users.



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