-
Notifications
You must be signed in to change notification settings - Fork 2
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
Remove disks endpoint using IntraBrokerDiskCapacityGoal #12
Remove disks endpoint using IntraBrokerDiskCapacityGoal #12
Conversation
… of the same broker (linkedin#7)" This reverts commit 8b203be.
- Extend IntraBrokerDiskCapacityGoal to allow moving all replicas from a 0 capacity disk - Added new endpoint that removes disks by setting 0 capacity on them and optimizing the IntraBrokerDiskCapacityGoal
@ilievladiulian do we also have a PR with the upstream project? |
This PR addresses the comments in the upstream PR. Will also update the PR there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I think this version is better since it reuses an existing goal. The only thing that should be confirmed is that the task is marked as "CompletedWithError" if the disk removal fails (koperator relies on this information)
- refactored for better readability - throw exception if goal could not move all replicas from 0 capacity disks
Added exception in case the goal could not move all replicas from deleted disks so that the task ends with CompletedWithError status. |
@@ -244,12 +262,17 @@ public String name() { | |||
|
|||
/** | |||
* Check whether the combined replica utilization is above the given disk capacity limits. | |||
* If _shouldEmptyZeroCapacityDisks is true, the disk utilization is over limit only if it greater than 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* If _shouldEmptyZeroCapacityDisks is true, the disk utilization is over limit only if it greater than 0. | |
* If _shouldEmptyZeroCapacityDisks is true, the disk utilization is over limit only if it is greater than 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed typo in latest commit.
@@ -43,6 +43,7 @@ public class IntraBrokerDiskCapacityGoal extends AbstractGoal { | |||
private static final Logger LOG = LoggerFactory.getLogger(IntraBrokerDiskCapacityGoal.class); | |||
private static final int MIN_NUM_VALID_WINDOWS = 1; | |||
private static final Resource RESOURCE = Resource.DISK; | |||
private boolean _shouldEmptyZeroCapacityDisks = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this naming format specific to CC? Is it ok not to be thread safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be the naming convention in CC. I changed the field to be final.
|
||
public RemoveDisksRunnable(KafkaCruiseControl kafkaCruiseControl, | ||
OperationFuture future, | ||
RemoveDisksParameters parameters, | ||
String uuid) { | ||
super(kafkaCruiseControl, future, parameters, parameters.dryRun(), parameters.stopOngoingExecution(), parameters.skipHardGoalCheck(), | ||
super(kafkaCruiseControl, future, parameters, parameters.dryRun(), parameters.stopOngoingExecution(), false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the param removal needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a parameter that was previously exposed in the API, although it was never used (and should not be needed for disk removal). There is no sense in skipping goal checking as this endpoint only uses one goal, the IntraBrokerDiskCapacityGoal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* Revert "Add endpoint to move all replicas from a disk to another disk of the same broker (#7)" This reverts commit 8b203be. * Added new endpoint to remove disks: - Extend IntraBrokerDiskCapacityGoal to allow moving all replicas from a 0 capacity disk - Added new endpoint that removes disks by setting 0 capacity on them and optimizing the IntraBrokerDiskCapacityGoal * Additional fixes: - refactored for better readability - throw exception if goal could not move all replicas from 0 capacity disks * Fix typo * Changed class field to final
* Revert "Add endpoint to move all replicas from a disk to another disk of the same broker (#7)" This reverts commit 8b203be. * Added new endpoint to remove disks: - Extend IntraBrokerDiskCapacityGoal to allow moving all replicas from a 0 capacity disk - Added new endpoint that removes disks by setting 0 capacity on them and optimizing the IntraBrokerDiskCapacityGoal * Additional fixes: - refactored for better readability - throw exception if goal could not move all replicas from 0 capacity disks * Fix typo * Changed class field to final
* Revert "Add endpoint to move all replicas from a disk to another disk of the same broker (#7)" This reverts commit 8b203be. * Added new endpoint to remove disks: - Extend IntraBrokerDiskCapacityGoal to allow moving all replicas from a 0 capacity disk - Added new endpoint that removes disks by setting 0 capacity on them and optimizing the IntraBrokerDiskCapacityGoal * Additional fixes: - refactored for better readability - throw exception if goal could not move all replicas from 0 capacity disks * Fix typo * Changed class field to final
* Revert "Add endpoint to move all replicas from a disk to another disk of the same broker (#7)" This reverts commit 8b203be. * Added new endpoint to remove disks: - Extend IntraBrokerDiskCapacityGoal to allow moving all replicas from a 0 capacity disk - Added new endpoint that removes disks by setting 0 capacity on them and optimizing the IntraBrokerDiskCapacityGoal * Additional fixes: - refactored for better readability - throw exception if goal could not move all replicas from 0 capacity disks * Fix typo * Changed class field to final
* Revert "Add endpoint to move all replicas from a disk to another disk of the same broker (#7)" This reverts commit 8b203be. * Added new endpoint to remove disks: - Extend IntraBrokerDiskCapacityGoal to allow moving all replicas from a 0 capacity disk - Added new endpoint that removes disks by setting 0 capacity on them and optimizing the IntraBrokerDiskCapacityGoal * Additional fixes: - refactored for better readability - throw exception if goal could not move all replicas from 0 capacity disks * Fix typo * Changed class field to final
* Revert "Add endpoint to move all replicas from a disk to another disk of the same broker (#7)" This reverts commit 8b203be. * Added new endpoint to remove disks: - Extend IntraBrokerDiskCapacityGoal to allow moving all replicas from a 0 capacity disk - Added new endpoint that removes disks by setting 0 capacity on them and optimizing the IntraBrokerDiskCapacityGoal * Additional fixes: - refactored for better readability - throw exception if goal could not move all replicas from 0 capacity disks * Fix typo * Changed class field to final
This PR changes the implementation of the remove disks endpoint to set disks to 0 capacity and to use IntraBrokerDiskCapacityGoal to move all replicas from a disk with 0 capacity.