Commit f69ca66
authored
fix(server): align cache event actions in legacy EventHub path (#3017)
- Align legacy cache invalidation producers and listeners on ACTION_INVALID and
ACTION_CLEAR, removing the obsolete ACTION_INVALIDED/ACTION_CLEARED constants.
- Add EventHub.notifyExcept(...) so cache transactions and the cache notifier
bridge can avoid re-processing their own local listener while still delivering
events to other listeners.
- Track registered graph/schema cache listeners per graph so notifyExcept(...)
uses the listener instance actually registered on the EventHub, including
multi-transaction cases where later transactions reuse the first listener.
- Update cache notifier forwarding to prevent local RPC bridge loops after action
names are unified.
- Add regression coverage for notifyExcept semantics, graph/schema action names,
listener teardown/re-registration, and notifier no-loop behavior.
- The holder keeps the EventHub listener registered while any transaction for the
graph is alive, and unregisters/removes it only when the last transaction
releases it. The registry update, ref-count decrement, and hub unlisten now run
inside ConcurrentMap.compute() to avoid owner-closes-first invalidation gaps.
Also add graph/schema regression coverage for owner-first close and last-close
cleanup, including graph close/reopen handling for stale EventHub holders.1 parent e108076 commit f69ca66
11 files changed
Lines changed: 727 additions & 53 deletions
File tree
- hugegraph-commons/hugegraph-common/src
- main/java/org/apache/hugegraph/event
- test/java/org/apache/hugegraph/unit/event
- hugegraph-server
- hugegraph-core/src/main/java/org/apache/hugegraph
- backend
- cache
- tx
- hugegraph-test/src/main/java/org/apache/hugegraph/unit/cache
Lines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
152 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
153 | 173 | | |
154 | 174 | | |
155 | 175 | | |
| |||
173 | 193 | | |
174 | 194 | | |
175 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
176 | 200 | | |
177 | | - | |
| 201 | + | |
178 | 202 | | |
179 | 203 | | |
180 | 204 | | |
| |||
hugegraph-commons/hugegraph-common/src/test/java/org/apache/hugegraph/unit/event/EventHubTest.java
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
391 | 428 | | |
392 | 429 | | |
393 | 430 | | |
| |||
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1394 | 1394 | | |
1395 | 1395 | | |
1396 | 1396 | | |
1397 | | - | |
| 1397 | + | |
1398 | 1398 | | |
1399 | 1399 | | |
1400 | 1400 | | |
| |||
1410 | 1410 | | |
1411 | 1411 | | |
1412 | 1412 | | |
1413 | | - | |
| 1413 | + | |
1414 | 1414 | | |
1415 | 1415 | | |
1416 | 1416 | | |
| |||
1435 | 1435 | | |
1436 | 1436 | | |
1437 | 1437 | | |
1438 | | - | |
| 1438 | + | |
| 1439 | + | |
1439 | 1440 | | |
1440 | 1441 | | |
1441 | 1442 | | |
1442 | 1443 | | |
1443 | | - | |
| 1444 | + | |
| 1445 | + | |
1444 | 1446 | | |
1445 | 1447 | | |
1446 | 1448 | | |
1447 | 1449 | | |
1448 | | - | |
| 1450 | + | |
| 1451 | + | |
1449 | 1452 | | |
1450 | 1453 | | |
1451 | 1454 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
| |||
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
Lines changed: 61 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
63 | 73 | | |
64 | 74 | | |
65 | 75 | | |
66 | 76 | | |
67 | 77 | | |
| 78 | + | |
68 | 79 | | |
69 | 80 | | |
70 | 81 | | |
| |||
138 | 149 | | |
139 | 150 | | |
140 | 151 | | |
141 | | - | |
| 152 | + | |
142 | 153 | | |
143 | 154 | | |
144 | 155 | | |
| |||
184 | 195 | | |
185 | 196 | | |
186 | 197 | | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
191 | 218 | | |
192 | 219 | | |
193 | 220 | | |
194 | 221 | | |
195 | | - | |
196 | | - | |
197 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
198 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
199 | 244 | | |
200 | 245 | | |
201 | 246 | | |
202 | 247 | | |
203 | 248 | | |
204 | 249 | | |
205 | 250 | | |
206 | | - | |
| 251 | + | |
| 252 | + | |
207 | 253 | | |
208 | 254 | | |
209 | 255 | | |
210 | 256 | | |
211 | | - | |
| 257 | + | |
| 258 | + | |
212 | 259 | | |
213 | 260 | | |
214 | 261 | | |
| |||
220 | 267 | | |
221 | 268 | | |
222 | 269 | | |
223 | | - | |
| 270 | + | |
224 | 271 | | |
225 | 272 | | |
226 | 273 | | |
| |||
397 | 444 | | |
398 | 445 | | |
399 | 446 | | |
400 | | - | |
| 447 | + | |
401 | 448 | | |
402 | 449 | | |
403 | 450 | | |
| |||
411 | 458 | | |
412 | 459 | | |
413 | 460 | | |
414 | | - | |
| 461 | + | |
415 | 462 | | |
416 | 463 | | |
417 | 464 | | |
| |||
425 | 472 | | |
426 | 473 | | |
427 | 474 | | |
428 | | - | |
| 475 | + | |
429 | 476 | | |
430 | 477 | | |
431 | 478 | | |
| |||
0 commit comments