diff --git a/ydb/core/tx/limiter/grouped_memory/service/allocation.h b/ydb/core/tx/limiter/grouped_memory/service/allocation.h index 47d5043188d0..dcbf2971367c 100644 --- a/ydb/core/tx/limiter/grouped_memory/service/allocation.h +++ b/ydb/core/tx/limiter/grouped_memory/service/allocation.h @@ -1,4 +1,5 @@ #pragma once +#include #include namespace NKikimr::NOlap::NGroupedMemoryManager { @@ -9,7 +10,7 @@ enum class EAllocationStatus { Failed }; -class TAllocationInfo { +class TAllocationInfo: public NColumnShard::TMonitoringObjectsCounter { private: std::shared_ptr Allocation; YDB_READONLY(ui64, AllocationInternalGroupId, 0); @@ -25,7 +26,7 @@ class TAllocationInfo { if (GetAllocationStatus() != EAllocationStatus::Failed) { Stage->Free(AllocatedVolume, GetAllocationStatus() == EAllocationStatus::Allocated); } - + AFL_TRACE(NKikimrServices::GROUPED_MEMORY_LIMITER)("event", "destroy")("allocation_id", Identifier)("stage", Stage->GetName()); } @@ -69,8 +70,8 @@ class TAllocationInfo { } } - TAllocationInfo(const ui64 processId, const ui64 scopeId, const ui64 allocationInternalGroupId, const std::shared_ptr& allocation, - const std::shared_ptr& stage); + TAllocationInfo(const ui64 processId, const ui64 scopeId, const ui64 allocationInternalGroupId, + const std::shared_ptr& allocation, const std::shared_ptr& stage); }; } // namespace NKikimr::NOlap::NGroupedMemoryManager diff --git a/ydb/core/tx/limiter/grouped_memory/service/group.h b/ydb/core/tx/limiter/grouped_memory/service/group.h index 8f4434c886b8..1c988081b02e 100644 --- a/ydb/core/tx/limiter/grouped_memory/service/group.h +++ b/ydb/core/tx/limiter/grouped_memory/service/group.h @@ -1,11 +1,13 @@ #pragma once #include "allocation.h" +#include + namespace NKikimr::NOlap::NGroupedMemoryManager { class TProcessMemoryScope; -class TGrouppedAllocations { +class TGrouppedAllocations: public NColumnShard::TMonitoringObjectsCounter { private: THashMap> Allocations; diff --git a/ydb/core/tx/limiter/grouped_memory/service/process.h b/ydb/core/tx/limiter/grouped_memory/service/process.h index 855b3daeb43a..4695bb2a444e 100644 --- a/ydb/core/tx/limiter/grouped_memory/service/process.h +++ b/ydb/core/tx/limiter/grouped_memory/service/process.h @@ -2,11 +2,13 @@ #include "group.h" #include "ids.h" +#include + #include namespace NKikimr::NOlap::NGroupedMemoryManager { -class TProcessMemoryScope { +class TProcessMemoryScope: public NColumnShard::TMonitoringObjectsCounter { private: const ui64 ExternalProcessId; const ui64 ExternalScopeId; @@ -63,6 +65,8 @@ class TProcessMemoryScope { } GroupIds.Clear(); AllocationInfo.clear(); + AFL_INFO(NKikimrServices::GROUPED_MEMORY_LIMITER)("event", "scope_cleaned")("process_id", ExternalProcessId)( + "external_scope_id", ExternalScopeId); return true; } @@ -106,7 +110,11 @@ class TProcessMemoryScope { bool UnregisterAllocation(const ui64 allocationId) { ui64 memoryAllocated = 0; auto it = AllocationInfo.find(allocationId); - AFL_VERIFY(it != AllocationInfo.end()); + if (it == AllocationInfo.end()) { + AFL_WARN(NKikimrServices::GROUPED_MEMORY_LIMITER)("reason", "allocation_cleaned_in_previous_scope_id_live")( + "allocation_id", allocationId)("process_id", ExternalProcessId)("external_scope_id", ExternalScopeId); + return true; + } bool waitFlag = false; const ui64 internalGroupId = it->second->GetAllocationInternalGroupId(); switch (it->second->GetAllocationStatus()) { @@ -144,7 +152,7 @@ class TProcessMemoryScope { } }; -class TProcessMemory { +class TProcessMemory: public NColumnShard::TMonitoringObjectsCounter { private: const ui64 ExternalProcessId; @@ -217,7 +225,6 @@ class TProcessMemory { if (it->second->Unregister()) { AllocationScopes.erase(it); } - } void RegisterScope(const ui64 externalScopeId) { @@ -227,7 +234,6 @@ class TProcessMemory { } else { it->second->Register(); } - } void SetPriorityProcess() {