Skip to content

Commit 34c0cf8

Browse files
committed
minor fixes
1 parent dbcb9a0 commit 34c0cf8

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

ydb/core/tx/columnshard/background_controller.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,13 @@ void TBackgroundController::CheckDeadlinesIndexation() {
2727
}
2828

2929
TInstant TBackgroundController::GetLastCompactionFinishInstant(ui64 pathId) const {
30-
auto findInstant = LastCompactionFinishInstants.find(pathId);
30+
auto findInstant = LastCompactionFinishByPathId.find(pathId);
3131
if (findInstant.IsEnd()) {
3232
return TInstant::Zero();
3333
}
3434
return findInstant->second;
3535
}
3636

37-
TInstant TBackgroundController::GetLastCompactionFinishInstant() const {
38-
TInstant maxInstant = TInstant::Zero();
39-
for (const auto& [pathId, instant] : LastCompactionFinishInstants) {
40-
if (maxInstant < instant) {
41-
maxInstant = instant;
42-
}
43-
}
44-
return maxInstant;
45-
}
46-
4737
void TBackgroundController::StartIndexing(const NOlap::TColumnEngineChanges& changes) {
4838
LastIndexationInstant = TMonotonic::Now();
4939
Y_ABORT_UNLESS(ActiveIndexationTasks.emplace(changes.GetTaskIdentifier(), TMonotonic::Now()).second);

ydb/core/tx/columnshard/background_controller.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22
#include "engines/changes/abstract/compaction_info.h"
33
#include "engines/portions/meta.h"
4+
#include <ydb/core/base/appdata.h>
45

56
namespace NKikimr::NOlap {
67
class TColumnEngineChanges;
@@ -14,7 +15,7 @@ class TBackgroundController {
1415

1516
using TCurrentCompaction = THashMap<ui64, NOlap::TPlanCompactionInfo>;
1617
TCurrentCompaction ActiveCompactionInfo;
17-
THashMap<ui64, TInstant> LastCompactionFinishInstants; // pathId to finish time
18+
THashMap<ui64, TInstant> LastCompactionFinishByPathId;
1819

1920
bool ActiveCleanupPortions = false;
2021
bool ActiveCleanupTables = false;
@@ -30,8 +31,8 @@ class TBackgroundController {
3031
bool StartCompaction(const NOlap::TPlanCompactionInfo& info);
3132
void FinishCompaction(const NOlap::TPlanCompactionInfo& info) {
3233
Y_ABORT_UNLESS(ActiveCompactionInfo.erase(info.GetPathId()));
33-
TInstant& lastFinishInstant = LastCompactionFinishInstants[info.GetPathId()];
34-
lastFinishInstant = std::max(lastFinishInstant, TInstant::Now());
34+
TInstant& lastFinishInstant = LastCompactionFinishByPathId[info.GetPathId()];
35+
lastFinishInstant = std::max(lastFinishInstant, TAppData::TimeProvider->Now());
3536
}
3637
const TCurrentCompaction& GetActiveCompaction() const {
3738
return ActiveCompactionInfo;
@@ -40,7 +41,6 @@ class TBackgroundController {
4041
return ActiveCompactionInfo.size();
4142
}
4243
TInstant GetLastCompactionFinishInstant(ui64 pathId) const;
43-
TInstant GetLastCompactionFinishInstant() const;
4444

4545
void StartIndexing(const NOlap::TColumnEngineChanges& changes);
4646
void FinishIndexing(const NOlap::TColumnEngineChanges& changes);

ydb/core/tx/columnshard/hooks/testing/ro_controller.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ class TReadOnlyController: public ICSController {
8282

8383
void WaitIndexation(const TDuration d) const {
8484
TInstant start = TInstant::Now();
85-
ui32 indexationStart = GetInsertStartedCounter().Val();
85+
ui32 insertsStart = GetInsertStartedCounter().Val();
8686
while (Now() - start < d) {
87-
if (indexationStart != GetInsertStartedCounter().Val()) {
88-
indexationStart = GetInsertStartedCounter().Val();
87+
if (insertsStart != GetInsertStartedCounter().Val()) {
88+
insertsStart = GetInsertStartedCounter().Val();
8989
start = TInstant::Now();
9090
}
9191
Cerr << "WAIT_INDEXATION: " << GetInsertStartedCounter().Val() << Endl;

0 commit comments

Comments
 (0)