Skip to content

Create load balancing policy: random_prefer_first #4820

Closed
@nvartolomei

Description

@nvartolomei
Contributor

Use case
For cross-replication topology setups load_balancing=in_order works best as nodes handle equal amount of load and usually they hit only 1/n of data (n = number of replicas), which makes page cache usage more efficient.

The problem is when one node of the shard goes down. If one replica goes down, the next one in config will handle twice the usual load while remaining ones will handle usual traffic.

Describe the solution you'd like

Create a random_prefer_first load balancing policy, so that when all replicas are present load will be spread equally among them, but when one goes down all other replicas will handle 1+1/(n-1) load instead of 1+1.

Activity

alexey-milovidov

alexey-milovidov commented on Mar 27, 2019

@alexey-milovidov
Member

Prefer first replica in order, and if it is unavailable, loop through all other replicas at random?

nvartolomei

nvartolomei commented on Mar 28, 2019

@nvartolomei
ContributorAuthor

@alexey-milovidov sounds like it ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @nvartolomei@alexey-milovidov

      Issue actions

        Create load balancing policy: random_prefer_first · Issue #4820 · ClickHouse/ClickHouse