You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(opensearchtransport): keep dedicated cluster managers in the connection inventory (#1003)
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>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,11 @@
2
2
3
3
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
4
4
5
-
## [4.7.2]
5
+
## [4.7.3]
6
+
7
+
### Fixed
8
+
9
+
- Fix an unbounded connection/heap leak in node discovery when the cluster has a dedicated cluster manager (`cluster_manager` role with no work roles). The node was filtered out of the `allConns` inventory while the router received the unfiltered added/removed diffs, so `findConnectionByURL` never matched it: a new `*Connection` was created every discovery cycle and the stale one was never evicted, accumulating without bound in the round-robin fallback pool whose `checkDead` health checks repopulated a per-connection `poolRegistry` `sync.Map` each cycle (leak rate scaled with discovery frequency). `allConns` is now the full connection inventory so discovery reuses and evicts symmetrically, and dedicated cluster managers are excluded at request-routing selection instead: `RoundRobinPolicy` skips them in its `DiscoveryUpdate` add path and `multiServerPool.Next()` skips them during selection (including the no-router fallback), both gated on `IncludeDedicatedClusterManagers`. Discovery still bootstraps against a dedicated cluster manager seed via the seed-fallback pool ([#1003](https://github.com/opensearch-project/opensearch-go/pull/1003))
6
10
7
11
## [4.7.0]
8
12
@@ -656,6 +660,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
656
660
- Bumps `github.com/stretchr/testify` from 1.8.0 to 1.8.1
657
661
- Bumps `github.com/aws/aws-sdk-go` from 1.44.45 to 1.44.132
0 commit comments