Skip to content

Support sampling/limiting topology refresh source nodes for large clusters #3565

@dlgocks1

Description

@dlgocks1

Feature Request

Is your feature request related to a problem? Please describe

With dynamicRefreshSources(true), Lettuce queries all discovered nodes during topology refresh. In our 256-node cluster, this causes unnecessary load and connection churn.

Current options are all-or-nothing:

  • true: Query all 256 nodes
  • false: Query only initial seed nodes (loses dynamic discovery)

Related: #240, #1394

Describe the solution you'd like

Add option to limit/sample the number of nodes queried:

ClusterTopologyRefreshOptions.builder()
    .dynamicRefreshSources(true)
    .maxTopologyRefreshSources(5)  // Only query up to 5 nodes
    .build()

Describe alternatives you've considered

  • dynamicRefreshSources(false): Works but loses dynamic node discovery
  • Longer refresh intervals: Delays failover detection

Teachability, Documentation, Adoption, Migration Strategy

// For large clusters (100+ nodes), limit topology refresh sources
ClusterTopologyRefreshOptions.builder()
    .dynamicRefreshSources(true)
    .maxTopologyRefreshSources(10)
    .build()

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions