deardeng commented on code in PR #36786: URL: https://github.com/apache/doris/pull/36786#discussion_r1670425293
########## fe/fe-core/src/main/java/org/apache/doris/cloud/datasource/CloudInternalCatalog.java: ########## @@ -549,6 +562,80 @@ public void commitMaterializedIndex(long dbId, long tableId, List<Long> indexIds } } + private void checkPartition(long dbId, long tableId, List<Long> partitionIds) + throws DdlException { + Cloud.CheckKeyInfos.Builder checkKeyInfosBuilder = Cloud.CheckKeyInfos.newBuilder(); + checkKeyInfosBuilder.addAllPartitionIds(partitionIds); + // for ms log + checkKeyInfosBuilder.addDbIds(dbId); + checkKeyInfosBuilder.addTableIds(tableId); + + Cloud.CheckKVRequest.Builder checkKvRequestBuilder = Cloud.CheckKVRequest.newBuilder(); + checkKvRequestBuilder.setCloudUniqueId(Config.cloud_unique_id); + checkKvRequestBuilder.setCheckKeys(checkKeyInfosBuilder.build()); + checkKvRequestBuilder.setOp(Cloud.CheckKVRequest.Operation.CREATE_PARTITION_AFTER_FE_COMMIT); + final Cloud.CheckKVRequest checkKVRequest = checkKvRequestBuilder.build(); + + Cloud.CheckKVResponse response = null; + int tryTimes = 0; + while (tryTimes++ < Config.metaServiceRpcRetryTimes()) { + try { + response = MetaServiceProxy.getInstance().checkKv(checkKVRequest); + if (response.getStatus().getCode() != Cloud.MetaServiceCode.KV_TXN_CONFLICT) { + break; + } + } catch (RpcException e) { + LOG.warn("tryTimes:{}, checkPartition RpcException", tryTimes, e); Review Comment: createtable catch exception,will drop failed table -- 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