Skip to content

Commit 946c37e

Browse files
authored
Reset __async_replica attr after changing REPLICATION_MODE to NONE (#8610)
1 parent d32c80c commit 946c37e

File tree

6 files changed

+10
-5
lines changed

6 files changed

+10
-5
lines changed

ydb/core/tx/schemeshard/schemeshard__init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1826,7 +1826,7 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> {
18261826
Y_ABORT_UNLESS(parseOk);
18271827

18281828
if (tableInfo->IsAsyncReplica()) {
1829-
Self->PathsById.at(pathId)->SetAsyncReplica();
1829+
Self->PathsById.at(pathId)->SetAsyncReplica(true);
18301830
}
18311831
}
18321832

ydb/core/tx/schemeshard/schemeshard__operation_alter_table.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,10 @@ class TPropose: public TSubOperationState {
366366
TTableInfo::TPtr table = context.SS->Tables.at(pathId);
367367
table->FinishAlter();
368368

369+
if (!table->IsAsyncReplica()) {
370+
path->SetAsyncReplica(false);
371+
}
372+
369373
auto ttlIt = context.SS->TTLEnabledTables.find(pathId);
370374
if (table->IsTTLEnabled() && ttlIt == context.SS->TTLEnabledTables.end()) {
371375
context.SS->TTLEnabledTables[pathId] = table;

ydb/core/tx/schemeshard/schemeshard__operation_create_table.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ class TCreateTable: public TSubOperation {
651651
Y_ABORT_UNLESS(tableInfo->GetPartitions().back().EndOfRange.empty(), "End of last range must be +INF");
652652

653653
if (tableInfo->IsAsyncReplica()) {
654-
newTable->SetAsyncReplica();
654+
newTable->SetAsyncReplica(true);
655655
}
656656

657657
if (tableInfo->IsRestoreTable()) {

ydb/core/tx/schemeshard/schemeshard_path_element.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ bool TPathElement::CheckFileStoreSpaceChange(TFileStoreSpace newSpace, TFileStor
419419
CheckSpaceChanged(FileStoreSpaceHDD, newSpace.HDD, oldSpace.HDD, errStr, "filestore", " (hdd)"));
420420
}
421421

422-
void TPathElement::SetAsyncReplica() {
423-
IsAsyncReplica = true;
422+
void TPathElement::SetAsyncReplica(bool value) {
423+
IsAsyncReplica = value;
424424
}
425425

426426
void TPathElement::SetRestoreTable() {

ydb/core/tx/schemeshard/schemeshard_path_element.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ struct TPathElement : TSimpleRefCount<TPathElement> {
162162
void ChangeFileStoreSpaceBegin(TFileStoreSpace newSpace, TFileStoreSpace oldSpace);
163163
void ChangeFileStoreSpaceCommit(TFileStoreSpace newSpace, TFileStoreSpace oldSpace);
164164
bool CheckFileStoreSpaceChange(TFileStoreSpace newSpace, TFileStoreSpace oldSpace, TString& errStr);
165-
void SetAsyncReplica();
165+
void SetAsyncReplica(bool value);
166166
void SetRestoreTable();
167167
bool HasRuntimeAttrs() const;
168168
void SerializeRuntimeAttrs(google::protobuf::RepeatedPtrField<NKikimrSchemeOp::TUserAttribute>* userAttrs) const;

ydb/core/tx/schemeshard/ut_replication/ut_replication.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ Y_UNIT_TEST_SUITE(TReplicationTests) {
369369

370370
TestDescribeResult(DescribePath(runtime, "/MyRoot/Table"), {
371371
NLs::ReplicationMode(NKikimrSchemeOp::TTableReplicationConfig::REPLICATION_MODE_NONE),
372+
NLs::UserAttrsEqual({}),
372373
});
373374
}
374375

0 commit comments

Comments
 (0)