From 1e9d4a5bfc768cce0ed0766fe709c47de019288b Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Tue, 19 Jul 2022 08:39:15 -0400 Subject: [PATCH 1/2] Fix flake warning with bound loop var (#326) * Fix flake warning with bound loop var * fix variable names --- tests/bench/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bench/base.py b/tests/bench/base.py index f686feb11..9bad097d6 100644 --- a/tests/bench/base.py +++ b/tests/bench/base.py @@ -94,7 +94,7 @@ async def produce(self, max_latency: float, max_messages: int, **kwargs): time_start = monotonic() time_1st = monotonic() - def on_published(meta): + def on_published(meta, time_1st=time_1st): print(f"1ST OK: {meta} AFTER {monotonic() - time_1st}s") callback = on_published From c4f5b189a3777002a22081f89cd87421f81714b1 Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Tue, 19 Jul 2022 09:08:01 -0400 Subject: [PATCH 2/2] =?UTF-8?q?If=20changelog=20topic=20partitions=20are?= =?UTF-8?q?=20only=20listed=20in=20the=20actives=5Ftps=20set=20=E2=80=A6?= =?UTF-8?q?=20(#325)?= 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)