diff options
author | Alexey Borzenkov <snaury@yandex-team.ru> | 2022-06-06 16:47:11 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-06-06 16:47:11 +0300 |
commit | 4b2bcca39c8932b48853d9107f7909516db2564a (patch) | |
tree | c925c65dc28517681b3336d38bd4131af40748b3 | |
parent | 31846aab71130c74baf2a34115726954b1ff26df (diff) | |
download | ydb-4b2bcca39c8932b48853d9107f7909516db2564a.tar.gz |
22-2: Check if log snapshot is needed after each misc commit, KIKIMR-15039
Merge from trunk: r9540312
REVIEW: 2606946
x-ydb-stable-ref: 411d3d5e8c7da2e4e1b0a89acb5f8242c9ac8272
-rw-r--r-- | ydb/core/tablet_flat/flat_executor.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ydb/core/tablet_flat/flat_executor.cpp b/ydb/core/tablet_flat/flat_executor.cpp index 76ef090dd1..844333096f 100644 --- a/ydb/core/tablet_flat/flat_executor.cpp +++ b/ydb/core/tablet_flat/flat_executor.cpp @@ -1448,6 +1448,10 @@ TExecutor::TLeaseCommit* TExecutor::EnsureReadOnlyLease(TMonotonic at) { lease = &LeaseCommits.emplace_back(commit->Step, ts, ts + LeaseDuration); CommitManager->Commit(commit); + + if (LogicSnap->MayFlush(false)) { + MakeLogSnapshot(); + } } return lease; @@ -2943,6 +2947,10 @@ THolder<TScanSnapshot> TExecutor::PrepareScanSnapshot(ui32 table, const NTable:: GcLogic->HoldBarrier(barrier->Step); CompactionLogic->UpdateLogUsage(LogicRedo->GrabLogUsage()); + if (LogicSnap->MayFlush(false)) { + MakeLogSnapshot(); + } + return THolder<TScanSnapshot>(new TScanSnapshot{table, std::move(barrier), subset, snapshot}); } @@ -4463,6 +4471,10 @@ void TExecutor::Handle(TEvPrivate::TEvActivateCompactionChanges::TPtr& ev, const for (auto& logicResult : CompactionLogic->ApplyChanges()) { CommitCompactionChanges(logicResult.Table, logicResult.Changes, logicResult.Strategy); } + + if (LogicSnap->MayFlush(false)) { + MakeLogSnapshot(); + } } void TExecutor::CommitCompactionChanges( |