Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a ReplicaMovementStrategy that prioritizes (At/Under)MinISR partitions with offline replicas #1559

Merged
merged 3 commits into from May 27, 2021

Conversation

efeg
Copy link
Collaborator

@efeg efeg commented May 15, 2021

This PR resolves #1558.

  • Make TopicMinIsrCache#minIsrWithTimeByTopic() return a snapshot within a synchronized block to ensure proper synchronization.
  • Create StrategyOptions to move any options intended to be used during application of a replica movement strategy. The existing code was limited to Cluster as the sole option, and didn't allow adding new options to a replica movement strategy without an API change in ReplicaMovementStrategy interface. With StrategyOptions new options can be added w/o changing the API.
  • Drop redundant chaining of BaseReplicaMovementStrategy to the default replica movement task strategy while creating an ExecutionTaskPlanner object. The redundancy was due to lack of check for the configured default.replica.movement.strategies. If the config had a list of entries containing BaseReplicaMovementStrategy (i.e. this is the default config), then the existing was still chaining an extra BaseReplicaMovementStrategy, causing inefficiency for no reason.
  • Add an option to ExecutionUtils#populateMinIsrState function to control whether to retrieve (At/Under)MinISR partitions each containing at least an offline replica, or to retrieve (At/Under)MinISR partitions without any offline replicas.
  • Current PR assumes that if users intend to use the new PrioritizeMinIsrWithOfflineReplicasStrategy strategy, then minISR-based concurrency adjustment is enabled. Otherwise, the PrioritizeMinIsrWithOfflineReplicasStrategy strategy is just a no-op.
  • Remove duplicate config entry for default.replica.movement.strategies from Analyzer Configurations -- it is already documented in the correct section (i.e. Executor Configurations)

@efeg efeg requested a review from zornhsu May 15, 2021 02:42
Copy link
Contributor

@zornhsu zornhsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the feature, Efe!
I left some comments, but shouldn't be merge blockers.

partitions.add(generatePartitionInfo(_partitionMovement4, false));

Cluster expectedCluster = new Cluster(null, _expectedNodes, partitions, Collections.<String>emptySet(), Collections.<String>emptySet());
// This ensures that the _partitionMovement1 and _partitionMovement3 are AtMinISR, while the other partitions are not.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we want to add a test for UnderMinISR is prioritized before AtMinISR partitions?
I am a little hesitant because I don't see a quick way to add this without involving 3 replicas in the replica set.

@efeg efeg merged commit 77c26ba into linkedin:master May 27, 2021
@efeg efeg deleted the feat/prioritizeMinISR branch May 27, 2021 16:30
efeg added a commit to efeg/cruise-control that referenced this pull request May 27, 2021
efeg added a commit to efeg/cruise-control that referenced this pull request May 27, 2021
kaitlynp1206 pushed a commit to kaitlynp1206/cruise-control that referenced this pull request Jun 10, 2021
zornhsu pushed a commit to zornhsu/cruise-control that referenced this pull request Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a ReplicaMovementStrategy that prioritizes (At/Under)MinISR partitions with offline replicas
2 participants