Skip to content

Commit 6633c6e

Browse files
authored
24-3: Reset __async_replica attr after changing REPLICATION_MODE to NONE (#8620)
1 parent c4d70ec commit 6633c6e

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
@@ -1825,7 +1825,7 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> {
18251825
Y_ABORT_UNLESS(parseOk);
18261826

18271827
if (tableInfo->IsAsyncReplica()) {
1828-
Self->PathsById.at(pathId)->SetAsyncReplica();
1828+
Self->PathsById.at(pathId)->SetAsyncReplica(true);
18291829
}
18301830
}
18311831

ydb/core/tx/schemeshard/schemeshard__operation_alter_table.cpp

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

368+
if (!table->IsAsyncReplica()) {
369+
path->SetAsyncReplica(false);
370+
}
371+
368372
auto ttlIt = context.SS->TTLEnabledTables.find(pathId);
369373
if (table->IsTTLEnabled() && ttlIt == context.SS->TTLEnabledTables.end()) {
370374
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
@@ -641,7 +641,7 @@ class TCreateTable: public TSubOperation {
641641
Y_ABORT_UNLESS(tableInfo->GetPartitions().back().EndOfRange.empty(), "End of last range must be +INF");
642642

643643
if (tableInfo->IsAsyncReplica()) {
644-
newTable->SetAsyncReplica();
644+
newTable->SetAsyncReplica(true);
645645
}
646646

647647
context.SS->Tables[newTable->PathId] = tableInfo;

ydb/core/tx/schemeshard/schemeshard_path_element.cpp

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

414-
void TPathElement::SetAsyncReplica() {
415-
IsAsyncReplica = true;
414+
void TPathElement::SetAsyncReplica(bool value) {
415+
IsAsyncReplica = value;
416416
}
417417

418418
bool TPathElement::HasRuntimeAttrs() const {

ydb/core/tx/schemeshard/schemeshard_path_element.h

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

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

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

345345
TestDescribeResult(DescribePath(runtime, "/MyRoot/Table"), {
346346
NLs::ReplicationMode(NKikimrSchemeOp::TTableReplicationConfig::REPLICATION_MODE_NONE),
347+
NLs::UserAttrsEqual({}),
347348
});
348349
}
349350

0 commit comments

Comments
 (0)