HDDS-8233. ReplicationManager: Throttle delete container commands from over-replication handlers #4447
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Similar to ReplicateContainerCommands, we should limit the number of delete commands queued on a given datanode at any time. This PR will enforce the limit with a static config variable with a view to making this more dynamic later.
This change does not limit any delete container commands sent from the health check chain in RM. It only affects deletes for the Ratis and EC Over Replication Handlers, which should drive the bulk of the deletes.
Note that delete container replicas from the balancer are not throttled. The balancer issues moves in a controlled way, and its deletes are triggered when a replication completes. Therefore its deletes are naturally throttled by the rate of completion of the replicated commands. It will not flood the cluster with deletes like could happen when a couple of dead nodes are brought back into the cluster still with their containers in place.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8233
How was this patch tested?
New unit tests added.