Skip to content

Commit 0a19242

Browse files
authored
Added time counter for local db precharge (#10883)
1 parent 43363e5 commit 0a19242

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

ydb/core/tx/columnshard/columnshard__init.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,20 @@ bool TTxInit::Precharge(TTransactionContext& txc) {
9999
}
100100

101101
bool TTxInit::ReadEverything(TTransactionContext& txc, const TActorContext& ctx) {
102-
if (!Precharge(txc)) {
103-
return false;
102+
TTablesManager tManagerLocal(Self->StoragesManager, Self->TabletID());
103+
{
104+
TLoadTimeSignals::TLoadTimer timer = tManagerLocal.GetLoadTimeCounters()->PrechargeTimeCounters.StartGuard();
105+
if (!Precharge(txc)) {
106+
timer.AddLoadingFail();
107+
return false;
108+
}
104109
}
105110

106111
NIceDb::TNiceDb db(txc.DB);
107112
TBlobGroupSelector dsGroupSelector(Self->Info());
108113
NOlap::TDbWrapper dbTable(txc.DB, &dsGroupSelector);
109114
{
110115
ACFL_DEBUG("step", "TTablesManager::Load_Start");
111-
TTablesManager tManagerLocal(Self->StoragesManager, Self->TabletID());
112116
{
113117
TMemoryProfileGuard g("TTxInit/TTablesManager");
114118
if (!tManagerLocal.InitFromDB(db)) {

ydb/core/tx/columnshard/columnshard_impl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ TColumnShard::TColumnShard(TTabletStorageInfo* info, const TActorId& tablet)
8989
, TTLTaskSubscription(NOlap::TTTLColumnEngineChanges::StaticTypeName(), Counters.GetSubscribeCounters())
9090
, BackgroundController(Counters.GetBackgroundControllerCounters())
9191
, NormalizerController(StoragesManager, Counters.GetSubscribeCounters())
92-
, SysLocks(this) {
92+
, SysLocks(this)
93+
{
9394
}
9495

9596
void TColumnShard::OnDetach(const TActorContext& ctx) {

ydb/core/tx/columnshard/counters/common_data.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,15 @@ class TTableLoadTimeCounters {
120120
NColumnShard::TLoadTimeSignals SchemaPresetLoadTimeCounters;
121121
NColumnShard::TLoadTimeSignals TableVersionsLoadTimeCounters;
122122
NColumnShard::TLoadTimeSignals SchemaPresetVersionsLoadTimeCounters;
123+
NColumnShard::TLoadTimeSignals PrechargeTimeCounters;
123124

124125
public:
125126
TTableLoadTimeCounters()
126127
: TableLoadTimeCounters("Tables")
127128
, SchemaPresetLoadTimeCounters("SchemaPreset")
128129
, TableVersionsLoadTimeCounters("TableVersionss")
129130
, SchemaPresetVersionsLoadTimeCounters("SchemaPresetVersions")
131+
, PrechargeTimeCounters("Precharge")
130132
{
131133
}
132134
};

ydb/core/tx/columnshard/tables_manager.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,14 @@ class TTablesManager {
157157
ui64 TabletId = 0;
158158

159159
public:
160+
friend class TTxInit;
161+
160162
TTablesManager(const std::shared_ptr<NOlap::IStoragesManager>& storagesManager, const ui64 tabletId);
161163

164+
const std::unique_ptr<TTableLoadTimeCounters>& GetLoadTimeCounters() const {
165+
return LoadTimeCounters;
166+
}
167+
162168
bool TryFinalizeDropPathOnExecute(NTable::TDatabase& dbTable, const ui64 pathId) const;
163169
bool TryFinalizeDropPathOnComplete(const ui64 pathId);
164170

0 commit comments

Comments
 (0)