Commit efe1210
authored
Add configurable coordinator buffer limit for per-query Arrow allocator (#21726)
* Add configurable coordinator buffer limit for per-query Arrow allocator
Replace hardcoded 256MB per-query Arrow allocator limit with dynamic
cluster setting `analytics.coordinator.buffer_limit`. Add debug/warn
logging at allocator close to detect memory leaks.
Signed-off-by: Bowen Lan <bowenlan@amazon.com>
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
* Refactor coordinator allocator lifecycle and address review feedback
- Move coordinator allocator creation to AnalyticsPlugin (proper lifecycle,
closed on plugin shutdown)
- DefaultPlanExecutor receives it via Guice injection
- QueryContext receives a ready-to-use allocator + ownsAllocator flag
(no more lazy init or branching inside QueryContext)
- Setting value 0 = use coordinator allocator directly (no per-query child)
- Guard per-query allocator against leak if QueryContext construction fails
- Test factories create per-test child allocators for proper leak isolation
Signed-off-by: Bowen Lan <bowenlan@amazon.com>
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
---------
Signed-off-by: Bowen Lan <bowenlan@amazon.com>
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>1 parent 70cf46f commit efe1210
4 files changed
Lines changed: 79 additions & 65 deletions
File tree
- sandbox/plugins/analytics-engine/src/main/java/org/opensearch/analytics
- exec
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
65 | 74 | | |
66 | 75 | | |
67 | 76 | | |
| |||
129 | 138 | | |
130 | 139 | | |
131 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
132 | 146 | | |
133 | 147 | | |
134 | 148 | | |
| |||
Lines changed: 27 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
76 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
77 | 82 | | |
78 | 83 | | |
79 | 84 | | |
| |||
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
99 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
| |||
144 | 152 | | |
145 | 153 | | |
146 | 154 | | |
147 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
148 | 172 | | |
149 | 173 | | |
150 | 174 | | |
| |||
Lines changed: 25 additions & 62 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
40 | 36 | | |
41 | | - | |
42 | 37 | | |
43 | | - | |
44 | | - | |
| 38 | + | |
| 39 | + | |
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
58 | 51 | | |
59 | 52 | | |
60 | 53 | | |
| |||
63 | 56 | | |
64 | 57 | | |
65 | 58 | | |
66 | | - | |
67 | 59 | | |
68 | | - | |
| 60 | + | |
| 61 | + | |
69 | 62 | | |
70 | 63 | | |
71 | 64 | | |
72 | 65 | | |
73 | 66 | | |
74 | | - | |
75 | 67 | | |
76 | | - | |
| 68 | + | |
| 69 | + | |
77 | 70 | | |
78 | 71 | | |
79 | 72 | | |
| |||
101 | 94 | | |
102 | 95 | | |
103 | 96 | | |
104 | | - | |
105 | 97 | | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 98 | + | |
120 | 99 | | |
121 | 100 | | |
122 | 101 | | |
| |||
139 | 118 | | |
140 | 119 | | |
141 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
142 | 125 | | |
143 | 126 | | |
144 | 127 | | |
145 | 128 | | |
146 | 129 | | |
147 | | - | |
148 | | - | |
149 | | - | |
| 130 | + | |
| 131 | + | |
150 | 132 | | |
151 | 133 | | |
152 | 134 | | |
| |||
157 | 139 | | |
158 | 140 | | |
159 | 141 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 142 | + | |
181 | 143 | | |
182 | 144 | | |
183 | 145 | | |
| |||
186 | 148 | | |
187 | 149 | | |
188 | 150 | | |
| 151 | + | |
189 | 152 | | |
190 | 153 | | |
191 | 154 | | |
192 | 155 | | |
193 | 156 | | |
194 | | - | |
195 | 157 | | |
196 | | - | |
| 158 | + | |
| 159 | + | |
197 | 160 | | |
198 | 161 | | |
199 | 162 | | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| 122 | + | |
121 | 123 | | |
122 | 124 | | |
123 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
124 | 137 | | |
125 | 138 | | |
126 | 139 | | |
| |||
0 commit comments