Skip to content

Commit

Permalink
schemeboard: fix path updates from both root and tenant schemeshards (y…
Browse files Browse the repository at this point in the history
  • Loading branch information
ijon authored Mar 7, 2024
1 parent 4616d9d commit 3f8fbaa
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions ydb/core/tx/scheme_board/replica.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,6 @@ class TReplica: public TMonitorableActor<TReplica> {
TrackMemory();
}

explicit TDescription(
TReplica* owner,
const TPathId& pathId,
TOpaquePathDescription&& pathDescription)
: Owner(owner)
, PathId(pathId)
, PathDescription(std::move(pathDescription))
{
TrackMemory();
}

explicit TDescription(
TReplica* owner,
const TString& path,
Expand Down Expand Up @@ -540,13 +529,13 @@ class TReplica: public TMonitorableActor<TReplica> {
}

// upsert description only by pathId
TDescription& UpsertDescription(const TPathId& pathId, TOpaquePathDescription&& pathDescription) {
TDescription& UpsertDescriptionByPathId(const TString& path, const TPathId& pathId, TOpaquePathDescription&& pathDescription) {
SBR_LOG_I("Upsert description"
<< ": pathId# " << pathId
<< ", pathDescription# " << pathDescription.ToString()
);

return Descriptions.Upsert(pathId, TDescription(this, pathId, std::move(pathDescription)));
return Descriptions.Upsert(pathId, TDescription(this, path, pathId, std::move(pathDescription)));
}

// upsert description by path AND pathId both
Expand Down Expand Up @@ -898,7 +887,7 @@ class TReplica: public TMonitorableActor<TReplica> {
if (abandonedSchemeShards.contains(pathId.OwnerId)) { // TSS is ignored, present GSS reverted it
log("Replace GSS by TSS description is rejected, GSS implicitly knows that TSS has been reverted"
", but still inject description only by pathId for safe");
UpsertDescription(pathId, std::move(pathDescription));
UpsertDescriptionByPathId(path, pathId, std::move(pathDescription));
return AckUpdate(ev);
}

Expand All @@ -923,7 +912,7 @@ class TReplica: public TMonitorableActor<TReplica> {
}

log("Inject description only by pathId, it is update from GSS");
UpsertDescription(pathId, std::move(pathDescription));
UpsertDescriptionByPathId(path, pathId, std::move(pathDescription));
return AckUpdate(ev);
}

Expand Down

0 comments on commit 3f8fbaa

Please sign in to comment.