Skip to content

Commit a03d8e3

Browse files
LiuRuoyu01ketor
authored andcommitted
[feat][coordinator]Add flag use same store for a table
1 parent 5e44b21 commit a03d8e3

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/coordinator/coordinator_control_meta.cc

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ BRPC_VALIDATE_GFLAG(default_replica_num, brpc::NonNegativeInteger);
6767
DEFINE_bool(enable_lite, false, "enable lite");
6868
BRPC_VALIDATE_GFLAG(enable_lite, brpc::PassValidate);
6969

70+
DEFINE_bool(use_same_store_for_a_table, true, "use same store for a table");
71+
7072
butil::Status CoordinatorControl::GenerateTableIdAndPartIds(int64_t schema_id, int64_t part_count,
7173
pb::meta::EntityType entity_type,
7274
pb::coordinator_internal::MetaIncrement& meta_increment,
@@ -1393,12 +1395,15 @@ butil::Status CoordinatorControl::CreateIndex(int64_t schema_id, const pb::meta:
13931395
}
13941396

13951397
std::vector<int64_t> store_ids;
1396-
auto ret4 = GetCreateRegionStoreIds(region_type, region_raw_engine_type, "", replica,
1397-
table_definition.index_parameter(), store_ids);
1398-
if (!ret4.ok()) {
1399-
DINGO_LOG(ERROR) << "GetCreateRegionStoreIds error:" << ret4.error_str()
1400-
<< ", table_definition:" << table_definition.ShortDebugString();
1401-
return ret4;
1398+
1399+
if (FLAGS_use_same_store_for_a_table) {
1400+
auto ret4 = GetCreateRegionStoreIds(region_type, region_raw_engine_type, "", replica,
1401+
table_definition.index_parameter(), store_ids);
1402+
if (!ret4.ok()) {
1403+
DINGO_LOG(ERROR) << "GetCreateRegionStoreIds error:" << ret4.error_str()
1404+
<< ", table_definition:" << table_definition.ShortDebugString();
1405+
return ret4;
1406+
}
14021407
}
14031408

14041409
for (int i = 0; i < new_part_ranges.size(); i++) {

0 commit comments

Comments
 (0)