Skip to content

Commit

Permalink
feat: minimize standby remaining total calls
Browse files Browse the repository at this point in the history
Reduce the calls in the recovery service agent checking if standby remaining totals is done
by verifying on the tables if the standbys_ready
is already set as this is the only thing which happens in the
if statement and is computational cheap compared
to iterating constantly over the standby_remaining_totals call.
  • Loading branch information
cbrand committed Mar 29, 2022
1 parent 26d2fb6 commit ce8dc5d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion faust/tables/recovery.py
Expand Up @@ -843,7 +843,10 @@ async def detect_aborted_tx():

await _maybe_signal_recovery_end()

if not self.standby_remaining_total():
standby_ready = (
self._standbys_span is None and self.tables.standbys_ready
)
if not standby_ready and not self.standby_remaining_total():
logger.debug("Completed standby partition fetch")
if self._standbys_span:
finish_span(self._standbys_span)
Expand Down

0 comments on commit ce8dc5d

Please sign in to comment.