Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
deardeng committed Jun 27, 2024
1 parent 7d4ce60 commit 53e59cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cloud/src/meta-service/meta_service_partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ void MetaServiceImpl::check_create_table(std::string instance_id, const CheckKVR

if (keys.empty()) {
*code = MetaServiceCode::INVALID_ARGUMENT;
*msg = "empty partition_ids";
*msg = "empty keys";
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2885,6 +2885,10 @@ public static int metaServiceRpcRetryTimes() {
"streamload route policy in cloud mode, availale options are public-private and empty string"})
public static String streamload_redirect_policy = "";

@ConfField(description = {"存算分离模式下建表是否检查残留recycler key, 默认true",
"create table in cloud mode, check recycler key remained, default true"})
public static boolean check_create_table_recycle_key_remained = true;

//==========================================================================
// end of cloud config
//==========================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ public void afterCreatePartitions(long dbId, long tableId, List<Long> partitionI

public void checkCreatePartitions(long dbId, long tableId, List<Long> partitionIds, List<Long> indexIds)
throws DdlException {
if (!Config.check_create_table_recycle_key_remained) {
return;
}
if (partitionIds == null) {
checkMaterializedIndex(dbId, tableId, indexIds);
} else {
Expand Down Expand Up @@ -555,14 +558,15 @@ 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.addAllIndexIds(partitionIds);
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;
Expand Down Expand Up @@ -599,6 +603,7 @@ public void checkMaterializedIndex(long dbId, long tableId, List<Long> indexIds)
Cloud.CheckKVRequest.Builder checkKvRequestBuilder = Cloud.CheckKVRequest.newBuilder();
checkKvRequestBuilder.setCloudUniqueId(Config.cloud_unique_id);
checkKvRequestBuilder.setCheckKeys(checkKeyInfosBuilder.build());
checkKvRequestBuilder.setOp(Cloud.CheckKVRequest.Operation.CREATE_INDEX_AFTER_FE_COMMIT);
final Cloud.CheckKVRequest checkKVRequest = checkKvRequestBuilder.build();

Cloud.CheckKVResponse response = null;
Expand Down

0 comments on commit 53e59cc

Please sign in to comment.