From 30374e58c366e0cc08cbe9b8bf26418fd0490bb8 Mon Sep 17 00:00:00 2001 From: Varjitt Jeeva Date: Wed, 30 Oct 2024 20:55:22 -0400 Subject: [PATCH 1/2] fix: analyze runs without statement timeout #605 --- pgbelt/cmd/sync.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pgbelt/cmd/sync.py b/pgbelt/cmd/sync.py index 8685084..b2fa8c0 100644 --- a/pgbelt/cmd/sync.py +++ b/pgbelt/cmd/sync.py @@ -150,7 +150,13 @@ async def analyze(config_future: Awaitable[DbupgradeConfig]) -> None: """ conf = await config_future logger = get_logger(conf.db, conf.dc, "sync.dst") - async with create_pool(conf.dst.root_uri, min_size=1) as dst_pool: + async with create_pool( + conf.dst.root_uri, + min_size=1, + server_settings={ + "statement_timeout": "0", + }, + ) as dst_pool: await run_analyze(dst_pool, logger) From c5a6a683da6c36c6cb3674c9c37fd41facac6b78 Mon Sep 17 00:00:00 2001 From: Varjitt Jeeva Date: Wed, 30 Oct 2024 21:00:29 -0400 Subject: [PATCH 2/2] fix: analyze without statement timeout during sync command #605 --- pgbelt/cmd/sync.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pgbelt/cmd/sync.py b/pgbelt/cmd/sync.py index b2fa8c0..944f2f0 100644 --- a/pgbelt/cmd/sync.py +++ b/pgbelt/cmd/sync.py @@ -214,8 +214,15 @@ async def sync( create_pool(conf.src.pglogical_uri, min_size=1), create_pool(conf.dst.root_uri, min_size=1), create_pool(conf.dst.owner_uri, min_size=1), + create_pool( + conf.dst.root_uri, + min_size=1, + server_settings={ + "statement_timeout": "0", + }, + ), ) - src_pool, dst_root_pool, dst_owner_pool = pools + src_pool, dst_root_pool, dst_owner_pool, dst_root_no_timeout_pool = pools try: src_logger = get_logger(conf.db, conf.dc, "sync.src") @@ -259,7 +266,7 @@ async def sync( conf.schema_name, validation_logger, ), - run_analyze(dst_owner_pool, dst_logger), + run_analyze(dst_root_no_timeout_pool, dst_logger), ) finally: await gather(*[p.close() for p in pools])