-
Notifications
You must be signed in to change notification settings - Fork 601
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
Support intra-broker throttling (replica.alter.log.dirs.io.max.bytes.per.second) #2145
base: main
Are you sure you want to change the base?
Conversation
This PR is an WIP; I will test this feature in our in-house fork (@naver) this week. Stay tuned!! 🙃 |
@aswinayyolath @mhratson @jiao-zhangS Could you kindly have a look? We adopted this patch to our in-house distribution and confirmed it works correctly. 🙏 |
…ationThrottledRate
- Add: setLogDirThrottles, setLogDirThrottledRateIfNecessary - Rename: removeReplicationThrottledRateFromBroker → removeThrottledRatesFromBroker
…oker rebalanacing - Rename: ReplicationThrottleHelper.clearThrottles → clearInterBrokerThrottles - Add ReplicationThrottleHelper.clearIntraBrokerThrottles - Executor.intraBrokerMoveReplicas now calls ReplicationThrottleHelper.setLogDirThrottles, ReplicationThrottleHelper.clearIntraBrokerThrottles
4781c13
to
c59c864
Compare
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.
Will make things a lot more stable for JBOD clusters, good change
@@ -1707,6 +1729,11 @@ private void intraBrokerMoveReplicas() { | |||
waitForIntraBrokerReplicaTasksToFinish(); | |||
inExecutionTasks = inExecutionTasks(); | |||
} | |||
|
|||
if (_logDirThrottle != null) { |
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.
for my understanding, why the underscore in the variable names here?
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.
In consistency with _replicationThrottle
.
I don't see any issues with this PR, but I'm not a maintainer of this project. We need a maintainer to review this and add their approval. |
@CCisGG could you please review this PR? |
@CCisGG Hello. Could you please have a look when you are free? 🙏 |
Hi @mhratson, would you mind taking a look at this one? Thanks! |
Anyone caring to review this? |
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.
Added some comments/questions.
Some other questions I have:
- Did you test that with your change, when no replication/intra broker throttling was set (which I think is by default), does this work properly?
- Is their any case that this intra-broker throttling can interfere with inter-broker thorttling? E.g. what happens if they are enabled together?
- Please update Configuration.md for this new config.
* <code>default.log.dir.throttle</code> | ||
*/ | ||
public static final String DEFAULT_LOG_DIR_THROTTLE_CONFIG = "default.log.dir.throttle"; | ||
public static final Long DEFAULT_DEFAULT_LOG_DIR_THROTTLE = null; |
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.
Would that be more reasonable to have it Long.MAX_VALUE rather than null? I'm a bit concerned to have a null default value for a LONG type. I'm not entirely sure what will happen here by default
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.
Nvm. Just realize that default replication throttle is also null. This is fine then.
@@ -830,7 +834,7 @@ public synchronized void executeProposals(Collection<ExecutionProposal> proposal | |||
requestedIntraBrokerPartitionMovementConcurrency, requestedClusterLeadershipMovementConcurrency, | |||
requestedBrokerLeadershipMovementConcurrency, requestedExecutionProgressCheckIntervalMs, replicaMovementStrategy, | |||
isTriggeredByUserRequest, loadMonitor); | |||
startExecution(loadMonitor, null, removedBrokers, replicationThrottle, isTriggeredByUserRequest); | |||
startExecution(loadMonitor, null, removedBrokers, replicationThrottle, logDirThrottle, isTriggeredByUserRequest); |
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.
Just curious, does that make more sense to have a separate method for intra-broker throttling since this parameter only applies for inter-broker movement?
@@ -918,7 +922,7 @@ public synchronized void executeDemoteProposals(Collection<ExecutionProposal> pr | |||
initProposalExecution(proposals, demotedBrokers, concurrentSwaps, null, 0, | |||
requestedClusterLeadershipMovementConcurrency, requestedBrokerLeadershipMovementConcurrency, | |||
requestedExecutionProgressCheckIntervalMs, replicaMovementStrategy, isTriggeredByUserRequest, loadMonitor); | |||
startExecution(loadMonitor, demotedBrokers, null, replicationThrottle, isTriggeredByUserRequest); | |||
startExecution(loadMonitor, demotedBrokers, null, replicationThrottle, replicationThrottle, isTriggeredByUserRequest); |
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.
What is the implication here to have log dir throttling set to replication throttle here?
for (Map.Entry<String, Set<String>> entry : throttledReplicas.entrySet()) { | ||
setThrottledReplicas(entry.getKey(), entry.getValue()); | ||
} | ||
LOG.info("Setting a rebalance throttle of {} bytes/sec", throttleRate); |
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 do we remove the "if (throttlingEnabled())" check here?
@@ -336,7 +355,7 @@ private void removeThrottledReplicasFromTopic(String topic, Set<String> replicas | |||
} | |||
} | |||
|
|||
private void removeThrottledRateFromBroker(Integer brokerId) | |||
private void removeThrottledRatesFromBroker(Integer brokerId) |
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 method now become "remove both throttle rates"? In that case we should add a comment to specify that.
This PR resolves #1851.