Commit 410b8c6
committed
fix(opensearchtransport): keep dedicated cluster managers in the connection inventory
A dedicated cluster manager (cluster_manager role with no work roles) was
filtered out of the allConns pool during discovery and promotion, while the
router received the unfiltered added/removed diffs. Because the node was absent
from allConns, the discovery reuse lookup (findConnectionByURL) never matched
it, so a new *Connection was created for it on every discovery cycle, and the
removed diff (computed against allConns) never contained it, so the prior
cycle's connection was never evicted. The round-robin fallback pool accumulated
these connections without bound, and its checkDead health checks repopulated a
per-connection poolRegistry sync.Map each cycle, growing the heap without limit.
The rate scaled with discovery frequency.
Make allConns the full connection inventory: it holds every discovered node
regardless of role, so discovery reuses and evicts connections symmetrically.
Keep dedicated cluster managers out of request routing at the point of
selection instead:
- RoundRobinPolicy, the only policy that admits nodes irrespective of role,
skips dedicated cluster managers in its DiscoveryUpdate add path unless
IncludeDedicatedClusterManagers is set. The setting flows via policyConfig.
- The allConns pool carries excludeDCM (set when IncludeDedicatedClusterManagers
is false) so multiServerPool.Next() skips dedicated cluster managers during
selection, including the no-router fallback path. A pool of only dedicated
cluster managers exhausts its attempts and reports ErrNoConnections.
Discovery still bootstraps against a dedicated cluster manager seed via the
seed-fallback pool, which is unaffected.
Signed-off-by: Sean Chittenden <sean.chittenden@crowdstrike.com>1 parent ac45b8e commit 410b8c6
12 files changed
Lines changed: 394 additions & 303 deletions
File tree
- internal/version
- opensearchtransport
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
656 | 660 | | |
657 | 661 | | |
658 | 662 | | |
| 663 | + | |
659 | 664 | | |
660 | 665 | | |
661 | 666 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
967 | 967 | | |
968 | 968 | | |
969 | 969 | | |
970 | | - | |
971 | | - | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
972 | 975 | | |
973 | 976 | | |
974 | 977 | | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
986 | | - | |
987 | | - | |
988 | | - | |
989 | | - | |
990 | | - | |
| 978 | + | |
| 979 | + | |
991 | 980 | | |
992 | 981 | | |
993 | 982 | | |
| |||
Lines changed: 66 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
436 | | - | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
437 | 441 | | |
438 | 442 | | |
439 | | - | |
| 443 | + | |
440 | 444 | | |
441 | 445 | | |
442 | 446 | | |
443 | 447 | | |
444 | 448 | | |
445 | | - | |
446 | | - | |
| 449 | + | |
| 450 | + | |
447 | 451 | | |
448 | 452 | | |
449 | | - | |
| 453 | + | |
450 | 454 | | |
451 | 455 | | |
452 | 456 | | |
453 | 457 | | |
454 | 458 | | |
455 | 459 | | |
456 | | - | |
457 | | - | |
| 460 | + | |
| 461 | + | |
458 | 462 | | |
459 | 463 | | |
460 | | - | |
| 464 | + | |
461 | 465 | | |
462 | 466 | | |
463 | 467 | | |
464 | 468 | | |
465 | 469 | | |
466 | | - | |
467 | | - | |
| 470 | + | |
| 471 | + | |
468 | 472 | | |
469 | 473 | | |
470 | 474 | | |
| |||
481 | 485 | | |
482 | 486 | | |
483 | 487 | | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
501 | 527 | | |
502 | 528 | | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
507 | 541 | | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | 542 | | |
520 | 543 | | |
521 | 544 | | |
| |||
0 commit comments