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

Add CompactionMergedBlobThresholdHDD parameter #2984

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ test-results
# Test binaries and generated dirs
*-ut
**/tests/tests
**/tests/**/cloud-blockstore-tests-loadtest-compaction

# Autogenerated util, library and contrib files
/util/all_*.cpp
Expand Down
4 changes: 4 additions & 0 deletions cloud/blockstore/config/storage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1113,4 +1113,8 @@ message TStorageServiceConfig

// Timeout for TDestroyVolumeActor (in milliseconds)
optional uint32 DestroyVolumeTimeout = 405;

// Minimum compaction data size (in bytes) that lets us write the data to
// blobstorage (as a merged blob) else we will write it to mixed channel.
optional uint32 CompactionToMergedThresholdHDD = 406;
}
1 change: 1 addition & 0 deletions cloud/blockstore/libs/storage/core/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ TDuration MSeconds(ui32 value)
xxx(CalculateSplittedUsedQuotaMetric, bool, false )\
\
xxx(DestroyVolumeTimeout, TDuration, Seconds(30) )\
xxx(CompactionToMergedThresholdHDD, ui32, 0 )\
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CompactionMergedBlobThresholdHDD

// BLOCKSTORE_STORAGE_CONFIG_RW

#define BLOCKSTORE_STORAGE_CONFIG(xxx) \
Expand Down
2 changes: 2 additions & 0 deletions cloud/blockstore/libs/storage/core/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,8 @@ class TStorageConfig
bool GetAutomaticallyEnableBufferCopyingAfterChecksumMismatch() const;
[[nodiscard]] bool GetNonReplicatedVolumeDirectAcquireEnabled() const;
[[nodiscard]] TDuration GetDestroyVolumeTimeout() const;

ui32 GetCompactionToMergedThresholdHDD() const;
};

ui64 GetAllocationUnit(
Expand Down
28 changes: 24 additions & 4 deletions cloud/blockstore/libs/storage/partition/part_actor_addblobs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,35 @@ class TAddBlobsExecutor

void Execute(const TActorContext& ctx, TPartitionDatabase& db)
{
for (const auto& blob: Args.MixedBlobs) {
if (Args.Mode == ADD_COMPACTION_RESULT) {
Y_ABORT_UNLESS(
Args.MixedBlobs.size() ==
Args.MixedBlockCompactionInfos.size());
}

for (ui32 i = 0; i < Args.MixedBlobs.size(); ++i) {
const auto& blob = Args.MixedBlobs[i];
ProcessNewBlob(ctx, db, blob);
UpdateCompactionCounters(blob);
if (Args.Mode == EAddBlobMode::ADD_WRITE_RESULT) {
UpdateUsedBlocks(db, blob);
}

if (Args.Mode == ADD_COMPACTION_RESULT) {
const auto& cm = State.GetCompactionMap();
const auto blockIndex = cm.GetRangeStart(BlockIndex(blob, 0));
auto& rangeInfo = CompactionCounters[blockIndex];
rangeInfo.BlobsSkippedByCompaction =
Args.MixedBlockCompactionInfos[i].BlobsSkippedByCompaction;
rangeInfo.BlocksSkippedByCompaction =
Args.MixedBlockCompactionInfos[i].BlocksSkippedByCompaction;
}
}

if (Args.Mode == ADD_COMPACTION_RESULT) {
Y_ABORT_UNLESS(Args.MergedBlobs.size()
== Args.MergedBlobCompactionInfos.size());
Y_ABORT_UNLESS(
Args.MergedBlobs.size() ==
Args.MergedBlobCompactionInfos.size());
}

for (ui32 i = 0; i < Args.MergedBlobs.size(); ++i) {
Expand All @@ -111,7 +129,8 @@ class TAddBlobsExecutor
if (Args.Mode == ADD_COMPACTION_RESULT) {
const auto& cm = State.GetCompactionMap();
const auto blockIndex = cm.GetRangeStart(blob.BlockRange.Start);
Y_DEBUG_ABORT_UNLESS(blockIndex == cm.GetRangeStart(blob.BlockRange.End));
Y_DEBUG_ABORT_UNLESS(
blockIndex == cm.GetRangeStart(blob.BlockRange.End));
auto& rangeInfo = CompactionCounters[blockIndex];
rangeInfo.BlobsSkippedByCompaction =
Args.MergedBlobCompactionInfos[i].BlobsSkippedByCompaction;
Expand Down Expand Up @@ -641,6 +660,7 @@ void TPartitionActor::HandleAddBlobs(
msg->Mode,
std::move(msg->AffectedBlobs),
std::move(msg->AffectedBlocks),
std::move(msg->MixedBlockBlobCompactionInfos),
std::move(msg->MergedBlobCompactionInfos));
}

Expand Down
Loading
Loading