Skip to content

Commit

Permalink
Merge 119d2fe into 4381e8c
Browse files Browse the repository at this point in the history
  • Loading branch information
swalrus1 authored Jul 29, 2024
2 parents 4381e8c + 119d2fe commit c2972a5
Show file tree
Hide file tree
Showing 39 changed files with 701 additions and 320 deletions.
2 changes: 2 additions & 0 deletions ydb/core/protos/counters_columnshard.proto
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ enum ECumulativeCounters {
COUNTER_READING_EXPORTED_BLOBS = 79 [(CounterOpts) = {Name: "ReadingExportedBlobs"}];
COUNTER_READING_EXPORTED_BYTES = 80 [(CounterOpts) = {Name: "ReadingExportedBytes"}];
COUNTER_READING_EXPORTED_RANGES = 81 [(CounterOpts) = {Name: "ReadingExportedRanges"}];
COUNTER_PLANNED_TX_COMPLETED = 82 [(CounterOpts) = {Name: "PlannedTxCompleted"}];
COUNTER_IMMEDIATE_TX_COMPLETED = 83 [(CounterOpts) = {Name: "ImmediateTxCompleted"}];
}

enum EPercentileCounters {
Expand Down
8 changes: 8 additions & 0 deletions ydb/core/tx/columnshard/background_controller.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#pragma once
#include "engines/changes/abstract/compaction_info.h"
#include "engines/portions/meta.h"
#include <ydb/core/tx/columnshard/counters/statistics_store.h>
#include <ydb/core/base/appdata.h>

namespace NKikimr::NOlap {
class TColumnEngineChanges;
Expand All @@ -15,11 +17,15 @@ class TBackgroundController {
using TCurrentCompaction = THashMap<ui64, NOlap::TPlanCompactionInfo>;
TCurrentCompaction ActiveCompactionInfo;

TBackgroundControllerCounters& Stats;
bool ActiveCleanupPortions = false;
bool ActiveCleanupTables = false;
bool ActiveCleanupInsertTable = false;
YDB_READONLY(TMonotonic, LastIndexationInstant, TMonotonic::Zero());
public:
TBackgroundController(TBackgroundControllerCounters& stats) : Stats(stats) {
}

THashSet<NOlap::TPortionAddress> GetConflictTTLPortions() const;
THashSet<NOlap::TPortionAddress> GetConflictCompactionPortions() const;

Expand All @@ -29,13 +35,15 @@ class TBackgroundController {
bool StartCompaction(const NOlap::TPlanCompactionInfo& info);
void FinishCompaction(const NOlap::TPlanCompactionInfo& info) {
Y_ABORT_UNLESS(ActiveCompactionInfo.erase(info.GetPathId()));
Stats.OnCompactionFinish(info.GetPathId());
}
const TCurrentCompaction& GetActiveCompaction() const {
return ActiveCompactionInfo;
}
ui32 GetCompactionsCount() const {
return ActiveCompactionInfo.size();
}
TInstant GetLastCompactionFinishInstant(ui64 pathId) const;

void StartIndexing(const NOlap::TColumnEngineChanges& changes);
void FinishIndexing(const NOlap::TColumnEngineChanges& changes);
Expand Down
10 changes: 5 additions & 5 deletions ydb/core/tx/columnshard/blobs_action/bs/write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ void TWriteAction::DoOnCompleteTxAfterWrite(NColumnShard::TColumnShard& self, co
ui64 blobsWritten = BlobBatch.GetBlobCount();
ui64 bytesWritten = BlobBatch.GetTotalSize();
if (blobsWroteSuccessfully) {
self.IncCounter(NColumnShard::COUNTER_UPSERT_BLOBS_WRITTEN, blobsWritten);
self.IncCounter(NColumnShard::COUNTER_UPSERT_BYTES_WRITTEN, bytesWritten);
// self.IncCounter(NColumnShard::COUNTER_RAW_BYTES_UPSERTED, insertedBytes);
self.IncCounter(NColumnShard::COUNTER_WRITE_SUCCESS);
self.Stats.GetTabletCounters().IncCounter(NColumnShard::COUNTER_UPSERT_BLOBS_WRITTEN, blobsWritten);
self.Stats.GetTabletCounters().IncCounter(NColumnShard::COUNTER_UPSERT_BYTES_WRITTEN, bytesWritten);
// self.Stats.GetTabletCounters().IncCounter(NColumnShard::COUNTER_RAW_BYTES_UPSERTED, insertedBytes);
self.Stats.GetTabletCounters().IncCounter(NColumnShard::COUNTER_WRITE_SUCCESS);
Manager->SaveBlobBatchOnComplete(std::move(BlobBatch));
} else {
self.IncCounter(NColumnShard::COUNTER_WRITE_FAIL);
self.Stats.GetTabletCounters().IncCounter(NColumnShard::COUNTER_WRITE_FAIL);
}
}

Expand Down
8 changes: 4 additions & 4 deletions ydb/core/tx/columnshard/blobs_action/transaction/tx_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ bool TTxWrite::Execute(TTransactionContext& txc, const TActorContext&) {

if (!InsertOneBlob(txc, i, writeId)) {
LOG_S_DEBUG(TxPrefix() << "duplicate writeId " << (ui64)writeId << TxSuffix());
Self->IncCounter(COUNTER_WRITE_DUPLICATE);
Self->Stats.GetTabletCounters().IncCounter(COUNTER_WRITE_DUPLICATE);
}
}
}
Expand Down Expand Up @@ -140,10 +140,10 @@ void TTxWrite::Complete(const TActorContext& ctx) {
}
for (ui32 i = 0; i < buffer.GetAggregations().size(); ++i) {
const auto& writeMeta = buffer.GetAggregations()[i]->GetWriteMeta();
Self->CSCounters.OnWriteTxComplete(now - writeMeta.GetWriteStartInstant());
Self->CSCounters.OnSuccessWriteResponse();
Self->Stats.GetCSCounters().OnWriteTxComplete(now - writeMeta.GetWriteStartInstant());
Self->Stats.GetCSCounters().OnSuccessWriteResponse();
}

Self->Stats.GetTabletCounters().IncCounter(COUNTER_IMMEDIATE_TX_COMPLETED);
}

}
Loading

0 comments on commit c2972a5

Please sign in to comment.