Skip to content

CostBalancerStrategy.pickSegmentToMove can pick the same segment twice #6329

@egor-ryashin

Description

@egor-ryashin
  @Override
  public BalancerSegmentHolder pickSegmentToMove(final List<ServerHolder> serverHolders)
  {
    ReservoirSegmentSampler sampler = new ReservoirSegmentSampler();
    return sampler.getRandomBalancerSegmentHolder(serverHolders);
  }

I see a probability here that the coordinator picks the same segment several times within a single rebalancing phase as nothing keeps the record of selected segments.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions