Skip to content

Commit

Permalink
cluster: wait between config set_status RPCs
Browse files Browse the repository at this point in the history
On a healthy system, we do want to send set_status
RPCs as soon as we're ready.  However, if the controller
log updates are not being seen promptly, this would lead
to the follower spamming the controller leader with
very many set_status RPCs in a tight loop.

Nodes will still send their status immediately when
a config change occurs: this change only effects the
behaviour if _another_ config change occurs while
it is reporting status from the first change: in this
case the follower will wait 5 seconds before sending
its next status RPC.

Related redpanda-data#4923
  • Loading branch information
jcsp committed May 25, 2022
1 parent 0a2b991 commit 3b1e56e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/v/cluster/config_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,14 @@ ss::future<> config_manager::reconcile_status() {
}

try {
if (failed) {
// If we were dirty & failed to send our update, sleep until retry
if (failed || should_send_status()) {
// * we were dirty & failed to send our update, sleep until retry
// OR
// * our status updated while we were sending, wait a short time
// before sending our next update to avoid spamming the leader
// with too many set_status RPCs if we are behind on seeing
// updates to the controller log.
co_await ss::sleep_abortable(status_retry, _as.local());
} else if (should_send_status()) {
// Our status updated while we were sending, proceed
// immediately to next iteration of loop.
} else {
// We are clean: sleep until signalled.
co_await _reconcile_wait.wait();
Expand Down

0 comments on commit 3b1e56e

Please sign in to comment.