2
2
#include " group.h"
3
3
#include " ids.h"
4
4
5
+ #include < ydb/core/tx/columnshard/counters/common/object_counter.h>
6
+
5
7
#include < ydb/library/accessor/validator.h>
6
8
7
9
namespace NKikimr ::NOlap::NGroupedMemoryManager {
8
10
9
- class TProcessMemoryScope {
11
+ class TProcessMemoryScope : public NColumnShard ::TMonitoringObjectsCounter<TProcessMemoryScope> {
10
12
private:
11
13
const ui64 ExternalProcessId;
12
14
const ui64 ExternalScopeId;
@@ -63,6 +65,8 @@ class TProcessMemoryScope {
63
65
}
64
66
GroupIds.Clear ();
65
67
AllocationInfo.clear ();
68
+ AFL_INFO (NKikimrServices::GROUPED_MEMORY_LIMITER)(" event" , " scope_cleaned" )(" process_id" , ExternalProcessId)(
69
+ " external_scope_id" , ExternalScopeId);
66
70
return true ;
67
71
}
68
72
@@ -106,7 +110,11 @@ class TProcessMemoryScope {
106
110
bool UnregisterAllocation (const ui64 allocationId) {
107
111
ui64 memoryAllocated = 0 ;
108
112
auto it = AllocationInfo.find (allocationId);
109
- AFL_VERIFY (it != AllocationInfo.end ());
113
+ if (it == AllocationInfo.end ()) {
114
+ AFL_WARN (NKikimrServices::GROUPED_MEMORY_LIMITER)(" reason" , " allocation_cleaned_in_previous_scope_id_live" )(
115
+ " allocation_id" , allocationId)(" process_id" , ExternalProcessId)(" external_scope_id" , ExternalScopeId);
116
+ return true ;
117
+ }
110
118
bool waitFlag = false ;
111
119
const ui64 internalGroupId = it->second ->GetAllocationInternalGroupId ();
112
120
switch (it->second ->GetAllocationStatus ()) {
@@ -144,7 +152,7 @@ class TProcessMemoryScope {
144
152
}
145
153
};
146
154
147
- class TProcessMemory {
155
+ class TProcessMemory : public NColumnShard ::TMonitoringObjectsCounter<TProcessMemory> {
148
156
private:
149
157
const ui64 ExternalProcessId;
150
158
@@ -217,7 +225,6 @@ class TProcessMemory {
217
225
if (it->second ->Unregister ()) {
218
226
AllocationScopes.erase (it);
219
227
}
220
-
221
228
}
222
229
223
230
void RegisterScope (const ui64 externalScopeId) {
@@ -227,7 +234,6 @@ class TProcessMemory {
227
234
} else {
228
235
it->second ->Register ();
229
236
}
230
-
231
237
}
232
238
233
239
void SetPriorityProcess () {
0 commit comments