Commit e11ff1a
committed
fix(aggregation): target-filtered per-entity fan-out
Per-entity collection endpoints (/components/{id}/logs, /apps/{id}/data,
/areas/{id}/faults, /functions/{id}/logs, etc.) unconditionally fanned
out req.path to every healthy peer. Peers that do not host the entity
returned 404, the response was flagged as partial with those peers in
failed_peers, even though nothing is broken.
Fan-out is now directed at the peers that actually host or contribute to
the entity:
- AggregationManager tracks a peer_contributors_by_entity_ map alongside
the existing routing_table_. gateway_node rebuilds both after every
discovery cycle by walking contributors on the merged entities and
stripping the 'peer:' prefix.
- get_peer_contributors(id) unions the routing-table owner (routed leaf,
collision-renamed peer-only entity) with the per-entity contributor
map (merged Areas/Functions, hierarchical parent Components that were
stripped from the routing table during classification).
- fan_out_get accepts an optional target_peers list; when supplied, only
matching healthy peers are queried. Non-contributors never see the
request, so they cannot appear in failed_peers.
- merge_peer_items extracts the entity id from per-entity paths, asks
AggregationManager for contributors, and passes the list as the
target filter. Local-only entities produce an empty list and skip
fan-out entirely. Global collection endpoints without an entity id
keep fan-out-to-all behavior.
Covers the common cases: local-only entity (no fan-out), routed leaf
(only the owning peer queried), merged/hierarchical entity (only
contributing peers queried), partial failure isolated to the specific
contributor that failed. Updates aggregation.rst design doc and extends
unit tests for AggregationManager (has_peer_contributors,
get_peer_contributors, empty-entry pruning) and fan-out helpers (owner-
only, contributor-only, partial-only-on-contributor-failure).1 parent 48ece75 commit e11ff1a
9 files changed
Lines changed: 751 additions & 11 deletions
File tree
- src/ros2_medkit_gateway
- design
- include/ros2_medkit_gateway
- aggregation
- http
- src
- aggregation
- updates
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
427 | 454 | | |
428 | 455 | | |
429 | 456 | | |
| |||
Lines changed: 49 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
206 | 243 | | |
207 | 244 | | |
208 | 245 | | |
| |||
223 | 260 | | |
224 | 261 | | |
225 | 262 | | |
226 | | - | |
| 263 | + | |
227 | 264 | | |
228 | | - | |
229 | | - | |
230 | | - | |
| 265 | + | |
| 266 | + | |
231 | 267 | | |
232 | 268 | | |
233 | 269 | | |
234 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
235 | 276 | | |
236 | | - | |
| 277 | + | |
| 278 | + | |
237 | 279 | | |
238 | 280 | | |
239 | 281 | | |
| |||
248 | 290 | | |
249 | 291 | | |
250 | 292 | | |
| 293 | + | |
251 | 294 | | |
252 | 295 | | |
253 | 296 | | |
| |||
Lines changed: 56 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
48 | 88 | | |
49 | 89 | | |
50 | 90 | | |
| |||
76 | 116 | | |
77 | 117 | | |
78 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
79 | 134 | | |
80 | | - | |
| 135 | + | |
81 | 136 | | |
82 | 137 | | |
83 | 138 | | |
| |||
Lines changed: 64 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
550 | 594 | | |
551 | 595 | | |
552 | 596 | | |
| |||
609 | 653 | | |
610 | 654 | | |
611 | 655 | | |
612 | | - | |
| 656 | + | |
| 657 | + | |
613 | 658 | | |
614 | 659 | | |
615 | 660 | | |
616 | 661 | | |
617 | 662 | | |
618 | 663 | | |
619 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
620 | 675 | | |
| 676 | + | |
621 | 677 | | |
622 | 678 | | |
623 | 679 | | |
624 | 680 | | |
625 | | - | |
626 | | - | |
| 681 | + | |
| 682 | + | |
627 | 683 | | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
628 | 689 | | |
629 | 690 | | |
630 | 691 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
| 26 | + | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| |||
1682 | 1685 | | |
1683 | 1686 | | |
1684 | 1687 | | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
1685 | 1723 | | |
1686 | 1724 | | |
1687 | 1725 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
160 | 167 | | |
| 168 | + | |
161 | 169 | | |
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
165 | 173 | | |
166 | | - | |
167 | 174 | | |
168 | 175 | | |
169 | 176 | | |
| |||
0 commit comments