Skip to content

Commit bb97e8c

Browse files
disc limiter selective usage for compaction only (#5062)
1 parent 4b60d4d commit bb97e8c

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

ydb/core/tx/columnshard/columnshard__write_index.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,16 @@ void TColumnShard::Handle(TEvPrivate::TEvWriteIndex::TPtr& ev, const TActorConte
4949
} else {
5050
ACFL_DEBUG("event", "TEvWriteIndex")("count", ev->Get()->IndexChanges->GetWritePortionsCount());
5151
AFL_VERIFY(ev->Get()->IndexChanges->GetWritePortionsCount());
52-
52+
const bool needDiskLimiter = ev->Get()->IndexChanges->NeedDiskWriteLimiter();
5353
auto writeController = std::make_shared<NOlap::TCompactedWriteController>(ctx.SelfID, ev->Release());
5454
const TConclusion<bool> needDraftTransaction = writeController->GetBlobsAction().NeedDraftWritingTransaction();
5555
AFL_VERIFY(needDraftTransaction.IsSuccess())("error", needDraftTransaction.GetErrorMessage());
5656
if (*needDraftTransaction) {
5757
Execute(new TTxWriteDraft(this, writeController));
58-
} else {
58+
} else if (needDiskLimiter) {
5959
NLimiter::TCompDiskOperator::AskResource(std::make_shared<TDiskResourcesRequest>(writeController, TabletID()));
60+
} else {
61+
Register(CreateWriteActor(TabletID(), writeController, TInstant::Max()));
6062
}
6163
}
6264
} else {

ydb/core/tx/columnshard/engines/changes/abstract/abstract.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ class TColumnEngineChanges {
234234
virtual ~IMemoryPredictor() = default;
235235
};
236236

237+
virtual bool NeedDiskWriteLimiter() const {
238+
return false;
239+
}
240+
237241
void OnFinish(NColumnShard::TColumnShard& self, TChangesFinishContext& context);
238242

239243
ui64 CalcMemoryForUsage() const {

ydb/core/tx/columnshard/engines/changes/general_compaction.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ class TGeneralCompactColumnEngineChanges: public TCompactColumnEngineChanges {
1414
void BuildAppendedPortionsByChunks(TConstructionContext& context, std::vector<TReadPortionInfoWithBlobs>&& portions) noexcept;
1515
protected:
1616
virtual TConclusionStatus DoConstructBlobs(TConstructionContext& context) noexcept override;
17+
18+
virtual bool NeedDiskWriteLimiter() const override {
19+
return true;
20+
}
21+
1722
virtual TPortionMeta::EProduced GetResultProducedClass() const override {
1823
return TPortionMeta::EProduced::SPLIT_COMPACTED;
1924
}

0 commit comments

Comments
 (0)