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

[backport] [v23.1.x] raft: dynamic learner recovery rate #10505

Merged
merged 6 commits into from
May 5, 2023

Conversation

bharathv
Copy link
Contributor

@bharathv bharathv commented May 2, 2023

Implements a new recovery throttle that coordinates the available bandwidth among shards and reallocates it dynamically based on load. It replaces the current static recovery throttle that assigns bandwidth per shard up front.

Ran this patch on a 5 node cluster in ec2 with 7-8tb of a test topic. Ran a targeted test for reconfiguring a 500gb partition and made sure it consumed the entire bandwidth on the node.

Also decommissioned a node and reconfigurations progressed much faster with higher bandwidth share than they otherwise would with static rate assignment. Here is what rate allocation looks like visually for a node. Decommissioning starts at 21:30 and 21:40-21:45 is when we start to have laggers that benefit from reassignment as they can consume the total available bandwidth. 22:05 is when the decommission finished and the rate distribution if back to fair rate.

Backport of PR #10339

Fixes #10494

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.1.x
  • v22.3.x
  • v22.2.x

Release Notes

Improvements

  • Better recovery bandwidth utilization and faster reconfigurations

bharathv added 6 commits May 2, 2023 10:51
This implementation periodically coordinates with other shards and
reallocates any unused rate from idle shards among shards with deficit.
More details in raft::coordinated_recovery_throttle.

(cherry picked from commit 8087915)
Update all the call sites that used to rely on legacy
raft::recovery_throttle implementation to use the new implementation.
Includes callsites in test fixtures.

(cherry picked from commit 4c406ae)
Adds unit tests for the new recovery throttle implementation. The unit
tests disable the coordination and instead invoke it on demand to have
more control of the test state. The logic encapsulated in a test
fixture.

(cherry picked from commit e2ac37a)
Adds the following per shard metrics.

(1) partition_movement_available_bandwidth
(2) partition_movement_assigned_bandwidth

(1) is available unused bandwidth on the shard in bytes for callers
(2) is total assigned bandwidth on the shard in bytes in the last
coordination tick.

(cherry picked from commit dc8d2f0)
With the changes in the patch, the new recovery rate is applied in the
next coordinator tick (may take as long as 1s). Reflect that wait
in the tests that update the rate during testing.

(cherry picked from commit 91baa42)
@bharathv
Copy link
Contributor Author

bharathv commented May 2, 2023

/ci-repeat 5

@piyushredpanda piyushredpanda added this to the v23.1.9 milestone May 3, 2023
@bharathv bharathv merged commit e6d0133 into redpanda-data:v23.1.x May 5, 2023
@bharathv bharathv deleted the v231x-raft-recovery-dyn branch May 5, 2023 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants