diff --git a/ydb/core/tx/limiter/grouped_memory/service/process.h b/ydb/core/tx/limiter/grouped_memory/service/process.h index a1c13e091d59..855b3daeb43a 100644 --- a/ydb/core/tx/limiter/grouped_memory/service/process.h +++ b/ydb/core/tx/limiter/grouped_memory/service/process.h @@ -127,12 +127,15 @@ class TProcessMemoryScope { } void UnregisterGroup(const bool isPriorityProcess, const ui64 externalGroupId) { - const ui64 internalGroupId = GroupIds.ExtractInternalIdVerified(externalGroupId); - AFL_INFO(NKikimrServices::GROUPED_MEMORY_LIMITER)("event", "remove_group")("external_group_id", externalGroupId)( - "internal_group_id", internalGroupId); - UnregisterGroupImpl(internalGroupId); - if (isPriorityProcess && (internalGroupId < GroupIds.GetMinInternalIdDef(internalGroupId))) { - Y_UNUSED(TryAllocateWaiting(isPriorityProcess, 0)); + if (auto internalGroupId = GroupIds.GetInternalIdOptional(externalGroupId)) { + AFL_INFO(NKikimrServices::GROUPED_MEMORY_LIMITER)("event", "remove_group")("external_group_id", externalGroupId)( + "internal_group_id", internalGroupId); + UnregisterGroupImpl(*internalGroupId); + if (isPriorityProcess && (*internalGroupId < GroupIds.GetMinInternalIdDef(*internalGroupId))) { + Y_UNUSED(TryAllocateWaiting(isPriorityProcess, 0)); + } + } else { + AFL_WARN(NKikimrServices::GROUPED_MEMORY_LIMITER)("event", "remove_absent_group")("external_group_id", externalGroupId); } }