Skip to content

Commit

Permalink
fix useless snapshot refresh in case no data in db (ydb-platform#4777)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 authored and zverevgeny committed Jun 18, 2024
1 parent 51e425d commit a66a5fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ydb/services/metadata/ds_table/accessor_refresh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void TDSAccessorRefresher::OnNewEnrichedSnapshot(NFetcher::ISnapshot::TPtr snaps

void TDSAccessorRefresher::OnNewParsedSnapshot(Ydb::Table::ExecuteQueryResult&& qResult, NFetcher::ISnapshot::TPtr snapshot) {
*ProposedProto.mutable_result_sets() = std::move(*qResult.mutable_result_sets());
if (CurrentSelection.SerializeAsString() != ProposedProto.SerializeAsString()) {
if (!CurrentSnapshot || CurrentSelection.SerializeAsString() != ProposedProto.SerializeAsString()) {
ALS_INFO(NKikimrServices::METADATA_PROVIDER) << "New refresher data: " << ProposedProto.DebugString();
SnapshotConstructor->EnrichSnapshotData(snapshot, InternalController);
} else {
Expand Down
2 changes: 1 addition & 1 deletion ydb/services/metadata/ds_table/accessor_snapshot_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void TDSAccessorBase::Handle(TTableExistsActor::TEvController::TEvResult::TPtr&
}
}
if (!hasExists) {
OnNewEnrichedSnapshot(SnapshotConstructor->CreateEmpty(RequestedActuality));
OnNewParsedSnapshot(Ydb::Table::ExecuteQueryResult(), SnapshotConstructor->CreateEmpty(RequestedActuality));
} else {
StartSnapshotsFetchingImpl();
}
Expand Down

0 comments on commit a66a5fa

Please sign in to comment.