aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Rutkovsky <alexvru@mail.ru>2022-03-14 16:54:27 +0300
committerAlexander Rutkovsky <alexvru@mail.ru>2022-03-14 16:54:27 +0300
commitd5c1d40525bfa7ced9bb9becda8a54427459744b (patch)
tree6c6c6a102191b5e576638ee35ea12dc6cbd3ee93
parent743003e05c206ec0ae9c2b21ae899a0de5158af6 (diff)
downloadydb-d5c1d40525bfa7ced9bb9becda8a54427459744b.tar.gz
Add some logging to defrag code KIKIMR-14494
ref:5a3ebc1e6852f55874fe143eb87f250d0c37aa8b
-rw-r--r--ydb/core/blobstorage/vdisk/defrag/defrag_actor.cpp17
-rw-r--r--ydb/core/protos/services.proto1
2 files changed, 17 insertions, 1 deletions
diff --git a/ydb/core/blobstorage/vdisk/defrag/defrag_actor.cpp b/ydb/core/blobstorage/vdisk/defrag/defrag_actor.cpp
index 4916a059414..f7393d4f9b3 100644
--- a/ydb/core/blobstorage/vdisk/defrag/defrag_actor.cpp
+++ b/ydb/core/blobstorage/vdisk/defrag/defrag_actor.cpp
@@ -6,6 +6,7 @@
#include <ydb/core/blobstorage/vdisk/common/sublog.h>
#include <ydb/core/blobstorage/vdisk/common/vdisk_hugeblobctx.h>
#include <ydb/core/blobstorage/vdisk/skeleton/blobstorage_takedbsnap.h>
+#include <ydb/core/util/stlog.h>
#include <library/cpp/actors/core/invoke.h>
namespace NKikimr {
@@ -96,6 +97,7 @@ namespace NKikimr {
{}
void Bootstrap(const TActorId parentId) {
+ STLOG(PRI_DEBUG, BS_VDISK_DEFRAG, BSVDD01, VDISKP(DCtx->VCtx->VDiskLogPrefix, "Bootstrap"));
ParentId = parentId;
Send(DCtx->SkeletonId, new TEvTakeHullSnapshot(false));
Become(&TThis::StateFunc);
@@ -112,19 +114,32 @@ namespace NKikimr {
} else {
const ui32 totalChunks = CalcStat->GetTotalChunks();
const ui32 usefulChunks = CalcStat->GetUsefulChunks();
+ const auto& oos = DCtx->VCtx->GetOutOfSpaceState();
Y_VERIFY(usefulChunks <= totalChunks);
const ui32 canBeFreedChunks = totalChunks - usefulChunks;
- if (HugeHeapDefragmentationRequired(DCtx->VCtx->GetOutOfSpaceState(), canBeFreedChunks, totalChunks)) {
+ if (HugeHeapDefragmentationRequired(oos, canBeFreedChunks, totalChunks)) {
TChunksToDefrag chunksToDefrag = CalcStat->GetChunksToDefrag(DCtx->MaxChunksToDefrag);
Y_VERIFY(chunksToDefrag);
+ STLOG(PRI_INFO, BS_VDISK_DEFRAG, BSVDD03, VDISKP(DCtx->VCtx->VDiskLogPrefix, "scan finished"),
+ (TotalChunks, totalChunks), (UsefulChunks, usefulChunks),
+ (LocalColor, NKikimrBlobStorage::TPDiskSpaceColor_E_Name(oos.GetLocalColor())),
+ (ChunksToDefrag, chunksToDefrag.ToString()));
Send(ParentId, new TEvDefragStartQuantum(std::move(chunksToDefrag)));
} else {
+ STLOG(PRI_INFO, BS_VDISK_DEFRAG, BSVDD04, VDISKP(DCtx->VCtx->VDiskLogPrefix, "scan finished"),
+ (TotalChunks, totalChunks), (UsefulChunks, usefulChunks),
+ (LocalColor, NKikimrBlobStorage::TPDiskSpaceColor_E_Name(oos.GetLocalColor())));
Send(ParentId, new TEvDefragStartQuantum(TChunksToDefrag()));
}
PassAway();
}
}
+ void PassAway() override {
+ STLOG(PRI_DEBUG, BS_VDISK_DEFRAG, BSVDD02, VDISKP(DCtx->VCtx->VDiskLogPrefix, "PassAway"));
+ TActorBootstrapped::PassAway();
+ }
+
STRICT_STFUNC(StateFunc,
hFunc(TEvTakeHullSnapshotResult, Handle);
cFunc(EvResume, HandleResume);
diff --git a/ydb/core/protos/services.proto b/ydb/core/protos/services.proto
index 50d0d80a965..76fd4b59790 100644
--- a/ydb/core/protos/services.proto
+++ b/ydb/core/protos/services.proto
@@ -49,6 +49,7 @@ enum EServiceKikimr {
BS_PROXY_PATCH = 343;
BS_VDISK_SCRUB = 344;
BS_VDISK_PATCH = 345;
+ BS_VDISK_DEFRAG = 346;
// DATASHARD section //
TX_DATASHARD = 290; //