gavinchou commented on code in PR #56061:
URL: https://github.com/apache/doris/pull/56061#discussion_r2348253775
##########
cloud/src/meta-service/meta_service.cpp:
##########
@@ -731,6 +731,27 @@ void internal_create_tablet(const CreateTabletsRequest*
request, MetaServiceCode
std::string key;
std::string val;
meta_tablet_key(key_info, &key);
+
+ if (txn->get(key, &val) == TxnErrorCode::TXN_OK) {
+ doris::TabletMetaCloudPB exists_tablet_meta;
+ if (!exists_tablet_meta.ParseFromString(val)) {
+ code = MetaServiceCode::PROTOBUF_SERIALIZE_ERR;
+ msg = fmt::format("failed to serialize tablet meta, key={}",
hex(key));
+ return;
+ }
+ if (exists_tablet_meta.tablet_id() == tablet_meta.tablet_id() &&
+ exists_tablet_meta.schema_version() ==
tablet_meta.schema_version()) {
+ // idempotent
+ code = MetaServiceCode::OK;
+ msg = "tablet already exists";
Review Comment:
contain some key info, tablet id. index id partition id
--
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]