Repository navigation
Commit 1798c83
committed
tm: render the anycast Via cid from the live node id, not a frozen one
tm_init_cluster() read this node cluster id once, at mod_init, and baked
it into the ";cid=<id>" Via parameter (and into a cached tm_node_id used
to decide whether an anycast reply is ours). That assumes the id is known
and stable by mod_init, which holds for a statically configured clusterer
but not for a controller-managed one: there the id is assigned at runtime,
after the node joins, and can change on re-election. So mod_init froze the
still-unassigned id (-1, printed as its unsigned form 18446744073709551615)
into every outgoing Via, and every node compared incoming cids against -1
- t_anycast_replicate() could never route a reply to the owning node.
Read the id live instead: pre-build only the fixed ";<param>=" prefix at
init, and have tm_via_cid() append the current get_my_id() per request
(returning no parameter while the node still has no id); compare incoming
cids against the live get_my_id() too. cl_get_my_id() already returns the
runtime id, so this needs nothing from the caller and self-corrects across
re-elections.1 parent be7dbf2 commit 1798c83
2 files changed
Lines changed: 39 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
256 | 258 | | |
257 | 259 | | |
258 | 260 | | |
259 | | - | |
260 | | - | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
290 | 292 | | |
291 | 293 | | |
292 | 294 | | |
| |||
296 | 298 | | |
297 | 299 | | |
298 | 300 | | |
299 | | - | |
300 | | - | |
| 301 | + | |
301 | 302 | | |
302 | 303 | | |
303 | 304 | | |
| |||
306 | 307 | | |
307 | 308 | | |
308 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
309 | 332 | | |
310 | 333 | | |
311 | 334 | | |
| |||
522 | 545 | | |
523 | 546 | | |
524 | 547 | | |
525 | | - | |
| 548 | + | |
526 | 549 | | |
527 | 550 | | |
528 | 551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
0 commit comments