Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added time counter for local db precharge #10883

Merged
merged 3 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions ydb/core/tx/columnshard/columnshard__init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,20 @@ bool TTxInit::Precharge(TTransactionContext& txc) {
}

bool TTxInit::ReadEverything(TTransactionContext& txc, const TActorContext& ctx) {
if (!Precharge(txc)) {
return false;
TTablesManager tManagerLocal(Self->StoragesManager, Self->TabletID());
{
TLoadTimeSignals::TLoadTimer timer = tManagerLocal.GetLoadTimeCounters()->PrechargeTimeCounters.StartGuard();
if (!Precharge(txc)) {
timer.AddLoadingFail();
return false;
}
}

NIceDb::TNiceDb db(txc.DB);
TBlobGroupSelector dsGroupSelector(Self->Info());
NOlap::TDbWrapper dbTable(txc.DB, &dsGroupSelector);
{
ACFL_DEBUG("step", "TTablesManager::Load_Start");
TTablesManager tManagerLocal(Self->StoragesManager, Self->TabletID());
{
TMemoryProfileGuard g("TTxInit/TTablesManager");
if (!tManagerLocal.InitFromDB(db)) {
Expand Down
3 changes: 2 additions & 1 deletion ydb/core/tx/columnshard/columnshard_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ TColumnShard::TColumnShard(TTabletStorageInfo* info, const TActorId& tablet)
, TTLTaskSubscription(NOlap::TTTLColumnEngineChanges::StaticTypeName(), Counters.GetSubscribeCounters())
, BackgroundController(Counters.GetBackgroundControllerCounters())
, NormalizerController(StoragesManager, Counters.GetSubscribeCounters())
, SysLocks(this) {
, SysLocks(this)
{
}

void TColumnShard::OnDetach(const TActorContext& ctx) {
Expand Down
2 changes: 2 additions & 0 deletions ydb/core/tx/columnshard/counters/common_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,15 @@ class TTableLoadTimeCounters {
NColumnShard::TLoadTimeSignals SchemaPresetLoadTimeCounters;
NColumnShard::TLoadTimeSignals TableVersionsLoadTimeCounters;
NColumnShard::TLoadTimeSignals SchemaPresetVersionsLoadTimeCounters;
NColumnShard::TLoadTimeSignals PrechargeTimeCounters;

public:
TTableLoadTimeCounters()
: TableLoadTimeCounters("Tables")
, SchemaPresetLoadTimeCounters("SchemaPreset")
, TableVersionsLoadTimeCounters("TableVersionss")
, SchemaPresetVersionsLoadTimeCounters("SchemaPresetVersions")
, PrechargeTimeCounters("Precharge")
{
}
};
Expand Down
6 changes: 6 additions & 0 deletions ydb/core/tx/columnshard/tables_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,14 @@ class TTablesManager {
std::unique_ptr<TTableLoadTimeCounters> LoadTimeCounters;
ui64 TabletId = 0;
public:
friend class TTxInit;

TTablesManager(const std::shared_ptr<NOlap::IStoragesManager>& storagesManager, const ui64 tabletId);

const std::unique_ptr<TTableLoadTimeCounters>& GetLoadTimeCounters() const {
return LoadTimeCounters;
}

bool TryFinalizeDropPathOnExecute(NTable::TDatabase& dbTable, const ui64 pathId) const;
bool TryFinalizeDropPathOnComplete(const ui64 pathId);

Expand Down
Loading