Skip to content

Commit

Permalink
add limits for simultaneous compaction (ydb-platform#1096)
Browse files Browse the repository at this point in the history
* add limits for simultaneous compaction

* fix build
  • Loading branch information
ivanmorozov333 authored Jan 18, 2024
1 parent 2d2adb6 commit d160c50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions ydb/core/protos/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,7 @@ message TColumnShardConfig {
optional bool WritingEnabled = 7 [default = true];
optional uint32 WritingBufferDurationMs = 8 [default = 0];
optional bool UseChunkedMergeOnCompaction = 9 [default = true];
optional uint64 CompactionMemoryLimit = 10 [default = 536870912];
}

message TSchemeShardConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,8 @@ class TPortionsBucket: public TMoveOnly {
}
std::optional<NArrow::TReplaceKey> stopPoint;
std::optional<TInstant> stopInstant;
std::vector<std::shared_ptr<TPortionInfo>> portions = Others.GetOptimizerTaskPortions(512 * 1024 * 1024, stopPoint);
const ui64 memLimit = HasAppData() ? AppDataVerified().ColumnShardConfig.GetCompactionMemoryLimit() : 512 * 1024 * 1024;
std::vector<std::shared_ptr<TPortionInfo>> portions = Others.GetOptimizerTaskPortions(memLimit, stopPoint);
if (nextBorder) {
if (MainPortion) {
portions.emplace_back(MainPortion);
Expand Down

0 comments on commit d160c50

Please sign in to comment.