@@ -67,6 +67,8 @@ BRPC_VALIDATE_GFLAG(default_replica_num, brpc::NonNegativeInteger);
6767DEFINE_bool (enable_lite, false , " enable lite" );
6868BRPC_VALIDATE_GFLAG (enable_lite, brpc::PassValidate);
6969
70+ DEFINE_bool (use_same_store_for_a_table, true , " use same store for a table" );
71+
7072butil::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