summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkruall <[email protected]>2026-07-16 18:35:31 +0500
committerGitHub <[email protected]>2026-07-16 13:35:31 +0000
commit7704f4da5d44ca260f84983da7c2b493e8475307 (patch)
tree2b9446d36207e65b6de71a56b346b58587637f47
parent67efdfe45b14915c1c963bb968068db21f503672 (diff)
Fix stale VDisk latency reports (#46753)
-rw-r--r--ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp22
-rw-r--r--ydb/core/blobstorage/nodewarden/node_warden_stat_aggr.cpp2
2 files changed, 23 insertions, 1 deletions
diff --git a/ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp b/ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp
index 33795a25451..a93e6cce7ab 100644
--- a/ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp
+++ b/ydb/core/blobstorage/nodewarden/blobstorage_node_warden_ut.cpp
@@ -706,6 +706,28 @@ Y_UNIT_TEST_SUITE(TBlobStorageWardenTest) {
});
}
+ CUSTOM_UNIT_TEST(TestStopAggregatorRemovesReportedStats) {
+ TTestActorSystem runtime(1);
+ runtime.Start();
+
+ TIntrusivePtr<TNodeWardenConfig> nodeWardenConfig(
+ new TNodeWardenConfig(static_cast<IPDiskServiceFactory*>(new TRealPDiskServiceFactory())));
+ const TActorId nodeWarden = runtime.Register(CreateBSNodeWarden(nodeWardenConfig.Release()), 1);
+
+ runtime.WrapInActorContext(nodeWarden, [](IActor* wardenActor) {
+ auto& warden = *dynamic_cast<NStorage::TNodeWarden*>(wardenActor);
+ const TActorId vdiskServiceId = MakeBlobStorageVDiskID(1, 2, 3);
+
+ warden.RunningVDiskServiceIds.insert(vdiskServiceId);
+ warden.PerAggregatorInfo.emplace(vdiskServiceId, NStorage::TNodeWarden::TAggregatorInfo{42, {}});
+
+ warden.StopAggregator(vdiskServiceId);
+
+ UNIT_ASSERT(!warden.RunningVDiskServiceIds.contains(vdiskServiceId));
+ UNIT_ASSERT(!warden.PerAggregatorInfo.contains(vdiskServiceId));
+ });
+ }
+
CUSTOM_UNIT_TEST(TestSendToInvalidGroupId) {
TTestBasicRuntime runtime(1, false);
Setup(runtime, "", nullptr);
diff --git a/ydb/core/blobstorage/nodewarden/node_warden_stat_aggr.cpp b/ydb/core/blobstorage/nodewarden/node_warden_stat_aggr.cpp
index 8cf1a58a7b2..0c5f4f01356 100644
--- a/ydb/core/blobstorage/nodewarden/node_warden_stat_aggr.cpp
+++ b/ydb/core/blobstorage/nodewarden/node_warden_stat_aggr.cpp
@@ -50,6 +50,6 @@ void TNodeWarden::StopAggregator(const TActorId& vdiskServiceId) {
if (RunningVDiskServiceIds.erase(vdiskServiceId)) {
const TActorId groupStatAggregatorId = MakeGroupStatAggregatorId(vdiskServiceId);
TActivationContext::Send(new IEventHandle(TEvents::TSystem::Poison, 0, groupStatAggregatorId, {}, nullptr, 0));
- PerAggregatorInfo.erase(groupStatAggregatorId);
+ PerAggregatorInfo.erase(vdiskServiceId);
}
}