Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset __async_replica attr after changing REPLICATION_MODE to NONE #8610

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ydb/core/tx/schemeshard/schemeshard__init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ struct TSchemeShard::TTxInit : public TTransactionBase<TSchemeShard> {
Y_ABORT_UNLESS(parseOk);

if (tableInfo->IsAsyncReplica()) {
Self->PathsById.at(pathId)->SetAsyncReplica();
Self->PathsById.at(pathId)->SetAsyncReplica(true);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/tx/schemeshard/schemeshard_path_element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion ydb/core/tx/schemeshard/schemeshard_path_element.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ struct TPathElement : TSimpleRefCount<TPathElement> {
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<NKikimrSchemeOp::TUserAttribute>* userAttrs) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ Y_UNIT_TEST_SUITE(TReplicationTests) {

TestDescribeResult(DescribePath(runtime, "/MyRoot/Table"), {
NLs::ReplicationMode(NKikimrSchemeOp::TTableReplicationConfig::REPLICATION_MODE_NONE),
NLs::UserAttrsEqual({}),
});
}

Expand Down
Loading