diff --git a/ydb/core/tx/schemeshard/schemeshard__init.cpp b/ydb/core/tx/schemeshard/schemeshard__init.cpp index 4f77237d09a4..bb754ef402db 100644 --- a/ydb/core/tx/schemeshard/schemeshard__init.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__init.cpp @@ -1826,7 +1826,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 1c2f78e1d97c..3bd872cd2682 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_alter_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_alter_table.cpp @@ -366,6 +366,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 9f41393bac09..204c7574c46b 100644 --- a/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp +++ b/ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp @@ -651,7 +651,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); } if (tableInfo->IsRestoreTable()) { diff --git a/ydb/core/tx/schemeshard/schemeshard_path_element.cpp b/ydb/core/tx/schemeshard/schemeshard_path_element.cpp index 74ea529a2189..f2f30095173f 100644 --- a/ydb/core/tx/schemeshard/schemeshard_path_element.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_path_element.cpp @@ -419,8 +419,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; } void TPathElement::SetRestoreTable() { diff --git a/ydb/core/tx/schemeshard/schemeshard_path_element.h b/ydb/core/tx/schemeshard/schemeshard_path_element.h index 173bbf8fd686..61e5b3b40c53 100644 --- a/ydb/core/tx/schemeshard/schemeshard_path_element.h +++ b/ydb/core/tx/schemeshard/schemeshard_path_element.h @@ -162,7 +162,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); void SetRestoreTable(); 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 a354d575897d..f29efff076e3 100644 --- a/ydb/core/tx/schemeshard/ut_replication/ut_replication.cpp +++ b/ydb/core/tx/schemeshard/ut_replication/ut_replication.cpp @@ -369,6 +369,7 @@ Y_UNIT_TEST_SUITE(TReplicationTests) { TestDescribeResult(DescribePath(runtime, "/MyRoot/Table"), { NLs::ReplicationMode(NKikimrSchemeOp::TTableReplicationConfig::REPLICATION_MODE_NONE), + NLs::UserAttrsEqual({}), }); }