@@ -78,7 +78,7 @@ bool TTablesManager::InitFromDB(NIceDb::TNiceDb& db) {
78
78
if (!Schema::GetSpecialValueOpt (db, Schema::EValueIds::MaxInternalPathId, maxPathId)) {
79
79
return false ;
80
80
}
81
- if (maxPathId) {
81
+ if (GenerateInternalPathId && maxPathId) {
82
82
MaxInternalPathId =TInternalPathId::FromRawValue (*maxPathId);
83
83
AFL_VERIFY (MaxInternalPathId >= GetInitialMaxInternalPathId (TabletId));
84
84
}
@@ -246,8 +246,7 @@ bool TTablesManager::HasTable(const TInternalPathId pathId, const bool withDelet
246
246
}
247
247
248
248
TInternalPathId TTablesManager::CreateInternalPathId (const TSchemeShardLocalPathId schemeShardLocalPathId) {
249
- if (NYDBTest::TControllers::GetColumnShardController ()->IsForcedGenerateInternalPathId () ||
250
- AppData ()->ColumnShardConfig .GetGenerateInternalPathId ()) {
249
+ if (GenerateInternalPathId) {
251
250
const auto result = TInternalPathId::FromRawValue (MaxInternalPathId.GetRawValue () + 1 );
252
251
MaxInternalPathId = result;
253
252
return result;
@@ -306,7 +305,9 @@ void TTablesManager::RegisterTable(TTableInfo&& table, NIceDb::TNiceDb& db) {
306
305
AFL_VERIFY (Tables.emplace (pathId, std::move (table)).second )(" path_id" , pathId)(" size" , Tables.size ());
307
306
AFL_VERIFY (SchemeShardLocalToInternal.emplace (table.GetPathId ().SchemeShardLocalPathId , table.GetPathId ().InternalPathId ).second );
308
307
Schema::SaveTableSchemeShardLocalPathId (db, table.GetPathId ().InternalPathId , table.GetPathId ().SchemeShardLocalPathId );
309
- Schema::SaveSpecialValue (db, Schema::EValueIds::MaxInternalPathId, MaxInternalPathId.GetRawValue ());
308
+ if (GenerateInternalPathId) {
309
+ Schema::SaveSpecialValue (db, Schema::EValueIds::MaxInternalPathId, MaxInternalPathId.GetRawValue ());
310
+ }
310
311
if (PrimaryIndex) {
311
312
PrimaryIndex->RegisterTable (pathId);
312
313
}
@@ -405,6 +406,10 @@ TTablesManager::TTablesManager(const std::shared_ptr<NOlap::IStoragesManager>& s
405
406
, SchemaObjectsCache(schemaCache)
406
407
, PortionsStats(portionsStats)
407
408
, TabletId(tabletId)
409
+ , GenerateInternalPathId(
410
+ AppData ()->ColumnShardConfig.GetGenerateInternalPathId() ||
411
+ NYDBTest::TControllers::GetColumnShardController()->IsForcedGenerateInternalPathId()
412
+ )
408
413
, MaxInternalPathId(GetInitialMaxInternalPathId(TabletId)) {
409
414
}
410
415
0 commit comments