From c4f5b189a3777002a22081f89cd87421f81714b1 Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Tue, 19 Jul 2022 09:08:01 -0400 Subject: [PATCH] =?UTF-8?q?If=20changelog=20topic=20partitions=20are=20onl?= =?UTF-8?q?y=20listed=20in=20the=20actives=5Ftps=20set=20=E2=80=A6=20(#325?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * If changelog topic partitions are only listed in the actives_tps set and not in standbys, then those partitions need to be resumed to ensure GlobalTable stays in sync for all workers * fix recovery linting * pass flake8 test Co-authored-by: lmetzger Co-authored-by: Vikram Patki <54442035+patkivikram@users.noreply.github.com> --- faust/tables/recovery.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/faust/tables/recovery.py b/faust/tables/recovery.py index f54afbca8..1adbcf4b5 100644 --- a/faust/tables/recovery.py +++ b/faust/tables/recovery.py @@ -470,6 +470,14 @@ async def _restart_recovery(self) -> None: T(self.app.flow_control.resume)() T(consumer.resume_flow)() self._set_recovery_ended() + + # The changelog partitions only in the active_tps set need to be resumed + active_only_partitions = active_tps - standby_tps + if active_only_partitions: + T(consumer.resume_partitions)(active_only_partitions) + T(self.app.flow_control.resume)() + T(consumer.resume_flow)() + self.log.info("Recovery complete") if span: span.set_tag("Recovery-Completed", True)