aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorserg-belyakov <serg-belyakov@yandex-team.com>2023-09-20 09:47:06 +0300
committerserg-belyakov <serg-belyakov@yandex-team.com>2023-09-20 10:14:57 +0300
commitc78263f3defefa0d9e04bc9af5b72c855a886dcf (patch)
tree9dfe895bdd6ba10e38e0c53285a8f75739792da6
parenta9a65c1affe5d4d872e4fdf7852d4bc79d466d21 (diff)
downloadydb-c78263f3defefa0d9e04bc9af5b72c855a886dcf.tar.gz
Add monitoring counters for GroupLayoutSanitizer, KIKIMR-18170
Add monitoring counters for GroupLayoutSanitizer, KIKIMR-18170
-rw-r--r--ydb/core/blobstorage/base/blobstorage_events.h1
-rw-r--r--ydb/core/mind/bscontroller/config_cmd.cpp15
-rw-r--r--ydb/core/mind/bscontroller/self_heal.cpp3
-rw-r--r--ydb/core/protos/counters_bs_controller.proto4
4 files changed, 20 insertions, 3 deletions
diff --git a/ydb/core/blobstorage/base/blobstorage_events.h b/ydb/core/blobstorage/base/blobstorage_events.h
index 905d343163..78dd1e8571 100644
--- a/ydb/core/blobstorage/base/blobstorage_events.h
+++ b/ydb/core/blobstorage/base/blobstorage_events.h
@@ -258,6 +258,7 @@ namespace NKikimr {
NKikimrBlobStorage::TEvControllerConfigRequest, TEvBlobStorage::EvControllerConfigRequest>
{
bool SelfHeal = false;
+ bool GroupLayoutSanitizer = false;
TEvControllerConfigRequest() = default;
};
diff --git a/ydb/core/mind/bscontroller/config_cmd.cpp b/ydb/core/mind/bscontroller/config_cmd.cpp
index 7c2437a610..ccffeb2edf 100644
--- a/ydb/core/mind/bscontroller/config_cmd.cpp
+++ b/ydb/core/mind/bscontroller/config_cmd.cpp
@@ -11,6 +11,7 @@ namespace NKikimr::NBsController {
const ui64 Cookie;
const NKikimrBlobStorage::TConfigRequest Cmd;
const bool SelfHeal;
+ const bool GroupLayoutSanitizer;
THolder<TEvBlobStorage::TEvControllerConfigResponse> Ev;
NKikimrBlobStorage::TConfigResponse *Response;
std::optional<TConfigState> State;
@@ -19,12 +20,13 @@ namespace NKikimr::NBsController {
public:
TTxConfigCmd(const NKikimrBlobStorage::TConfigRequest &cmd, const TActorId &notifyId, ui64 cookie,
- bool selfHeal, TBlobStorageController *controller)
+ bool selfHeal, bool groupLayoutSanitizer, TBlobStorageController *controller)
: TTransactionBase(controller)
, NotifyId(notifyId)
, Cookie(cookie)
, Cmd(cmd)
, SelfHeal(selfHeal)
+ , GroupLayoutSanitizer(groupLayoutSanitizer)
, Ev(new TEvBlobStorage::TEvControllerConfigResponse())
, Response(Ev->Record.MutableResponse())
{}
@@ -270,6 +272,12 @@ namespace NKikimr::NBsController {
: NBlobStorageController::COUNTER_SELFHEAL_REASSIGN_BSC_ERR;
Self->TabletCounters->Cumulative()[counter].Increment(1);
}
+ if (GroupLayoutSanitizer) {
+ const auto counter = Success
+ ? NBlobStorageController::COUNTER_GROUP_LAYOUT_SANITIZER_BSC_OK
+ : NBlobStorageController::COUNTER_GROUP_LAYOUT_SANITIZER_BSC_ERR;
+ Self->TabletCounters->Cumulative()[counter].Increment(1);
+ }
if (!Success) {
// rollback transaction
@@ -365,11 +373,14 @@ namespace NKikimr::NBsController {
if (ev->Get()->SelfHeal) {
TabletCounters->Cumulative()[NBlobStorageController::COUNTER_SELFHEAL_REASSIGN_BSC_REQUESTS].Increment(1);
}
+ if (ev->Get()->GroupLayoutSanitizer) {
+ TabletCounters->Cumulative()[NBlobStorageController::COUNTER_GROUP_LAYOUT_SANITIZER_BSC_REQUESTS].Increment(1);
+ }
NKikimrBlobStorage::TEvControllerConfigRequest& record(ev->Get()->Record);
const NKikimrBlobStorage::TConfigRequest& request = record.GetRequest();
STLOG(PRI_DEBUG, BS_CONTROLLER, BSCTXCC01, "Execute TEvControllerConfigRequest", (Request, request));
- Execute(new TTxConfigCmd(request, ev->Sender, ev->Cookie, ev->Get()->SelfHeal, this));
+ Execute(new TTxConfigCmd(request, ev->Sender, ev->Cookie, ev->Get()->SelfHeal, ev->Get()->GroupLayoutSanitizer, this));
}
} // NKikimr::NBsController
diff --git a/ydb/core/mind/bscontroller/self_heal.cpp b/ydb/core/mind/bscontroller/self_heal.cpp
index c3254838b1..dfebc047b5 100644
--- a/ydb/core/mind/bscontroller/self_heal.cpp
+++ b/ydb/core/mind/bscontroller/self_heal.cpp
@@ -147,13 +147,13 @@ namespace NKikimr::NBsController {
}
auto ev = MakeHolder<TEvBlobStorage::TEvControllerConfigRequest>();
- ev->SelfHeal = true;
auto& record = ev->Record;
auto *request = record.MutableRequest();
request->SetIgnoreGroupReserve(true);
request->SetSettleOnlyOnOperationalDisks(true);
request->SetIsSelfHealReasonDecommit(IsSelfHealReasonDecommit);
if (VDiskToReplace) {
+ ev->SelfHeal = true;
auto *cmd = request->AddCommand()->MutableReassignGroupDisk();
cmd->SetGroupId(VDiskToReplace->GroupID);
cmd->SetGroupGeneration(VDiskToReplace->GroupGeneration);
@@ -161,6 +161,7 @@ namespace NKikimr::NBsController {
cmd->SetFailDomainIdx(VDiskToReplace->FailDomain);
cmd->SetVDiskIdx(VDiskToReplace->VDisk);
} else {
+ ev->GroupLayoutSanitizer = true;
auto *cmd = request->AddCommand()->MutableSanitizeGroup();
cmd->SetGroupId(GroupId);
}
diff --git a/ydb/core/protos/counters_bs_controller.proto b/ydb/core/protos/counters_bs_controller.proto
index 77e2dfb8c3..0a74ca8ab7 100644
--- a/ydb/core/protos/counters_bs_controller.proto
+++ b/ydb/core/protos/counters_bs_controller.proto
@@ -80,6 +80,10 @@ enum ECumulativeCounters {
COUNTER_CONFIGCMD_ALLOCATE_VIRTUAL_GROUP_USEC = 42 [(CounterOpts) = {Name: "AllocateVirtualGroup"}];
COUNTER_CONFIGCMD_DECOMMIT_GROUPS_USEC = 43 [(CounterOpts) = {Name: "DecommitGroups"}];
COUNTER_CONFIGCMD_CANCEL_VIRTUAL_GROUP_USEC = 44 [(CounterOpts) = {Name: "CancelVirtualGroup"}];
+
+ COUNTER_GROUP_LAYOUT_SANITIZER_BSC_REQUESTS = 45 [(CounterOpts) = {Name: "GroupLayoutSanitizerBscRequests"}];
+ COUNTER_GROUP_LAYOUT_SANITIZER_BSC_OK = 46 [(CounterOpts) = {Name: "GroupLayoutSanitizerBscOk"}];
+ COUNTER_GROUP_LAYOUT_SANITIZER_BSC_ERR = 47 [(CounterOpts) = {Name: "GroupLayoutSanitizerBscErr"}];
}
enum EPercentileCounters {