diff --git a/ydb/core/tx/schemeshard/schemeshard__init.cpp b/ydb/core/tx/schemeshard/schemeshard__init.cpp index 0b77b71a9656..ae8fe7428d33 100644 --- a/ydb/core/tx/schemeshard/schemeshard__init.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__init.cpp @@ -1825,7 +1825,7 @@ struct TSchemeShard::TTxInit : public TTransactionBase { Y_ABORT_UNLESS(parseOk); if (tableInfo->IsAsyncReplica()) { - Self->PathsById.at(pathId)->SetAsyncReplica(); + Self->PathsById.at(pathId)->SetAsyncReplica(true); } } diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_alter_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_alter_table.cpp index ea7d79c2b0a0..b23a74d31ba1 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_alter_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_alter_table.cpp @@ -365,6 +365,10 @@ class TPropose: public TSubOperationState { TTableInfo::TPtr table = context.SS->Tables.at(pathId); table->FinishAlter(); + if (!table->IsAsyncReplica()) { + path->SetAsyncReplica(false); + } + auto ttlIt = context.SS->TTLEnabledTables.find(pathId); if (table->IsTTLEnabled() && ttlIt == context.SS->TTLEnabledTables.end()) { context.SS->TTLEnabledTables[pathId] = table; diff --git a/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp b/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp index 029e72fe4c3f..545ef3642c6e 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp @@ -641,7 +641,7 @@ class TCreateTable: public TSubOperation { Y_ABORT_UNLESS(tableInfo->GetPartitions().back().EndOfRange.empty(), "End of last range must be +INF"); if (tableInfo->IsAsyncReplica()) { - newTable->SetAsyncReplica(); + newTable->SetAsyncReplica(true); } context.SS->Tables[newTable->PathId] = tableInfo; diff --git a/ydb/core/tx/schemeshard/schemeshard_path_element.cpp b/ydb/core/tx/schemeshard/schemeshard_path_element.cpp index 05a0a9068ebc..c8901de18568 100644 --- a/ydb/core/tx/schemeshard/schemeshard_path_element.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_path_element.cpp @@ -411,8 +411,8 @@ bool TPathElement::CheckFileStoreSpaceChange(TFileStoreSpace newSpace, TFileStor CheckSpaceChanged(FileStoreSpaceHDD, newSpace.HDD, oldSpace.HDD, errStr, "filestore", " (hdd)")); } -void TPathElement::SetAsyncReplica() { - IsAsyncReplica = true; +void TPathElement::SetAsyncReplica(bool value) { + IsAsyncReplica = value; } bool TPathElement::HasRuntimeAttrs() const { diff --git a/ydb/core/tx/schemeshard/schemeshard_path_element.h b/ydb/core/tx/schemeshard/schemeshard_path_element.h index e9caae4888cd..1cdce90e1a4d 100644 --- a/ydb/core/tx/schemeshard/schemeshard_path_element.h +++ b/ydb/core/tx/schemeshard/schemeshard_path_element.h @@ -160,7 +160,7 @@ struct TPathElement : TSimpleRefCount { void ChangeFileStoreSpaceBegin(TFileStoreSpace newSpace, TFileStoreSpace oldSpace); void ChangeFileStoreSpaceCommit(TFileStoreSpace newSpace, TFileStoreSpace oldSpace); bool CheckFileStoreSpaceChange(TFileStoreSpace newSpace, TFileStoreSpace oldSpace, TString& errStr); - void SetAsyncReplica(); + void SetAsyncReplica(bool value); bool HasRuntimeAttrs() const; void SerializeRuntimeAttrs(google::protobuf::RepeatedPtrField* userAttrs) const; }; diff --git a/ydb/core/tx/schemeshard/ut_replication/ut_replication.cpp b/ydb/core/tx/schemeshard/ut_replication/ut_replication.cpp index a9efb04c0fda..4b596e677ca1 100644 --- a/ydb/core/tx/schemeshard/ut_replication/ut_replication.cpp +++ b/ydb/core/tx/schemeshard/ut_replication/ut_replication.cpp @@ -344,6 +344,7 @@ Y_UNIT_TEST_SUITE(TReplicationTests) { TestDescribeResult(DescribePath(runtime, "/MyRoot/Table"), { NLs::ReplicationMode(NKikimrSchemeOp::TTableReplicationConfig::REPLICATION_MODE_NONE), + NLs::UserAttrsEqual({}), }); }