Skip to content

Commit

Permalink
fix: run analyze without statement timeout (#606)
Browse files Browse the repository at this point in the history
* fix: analyze runs without statement timeout #605

* fix: analyze without statement timeout during sync command #605
  • Loading branch information
vjeeva authored Nov 6, 2024
1 parent 1b423a3 commit 3bac10c
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions pgbelt/cmd/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down Expand Up @@ -208,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")
Expand Down Expand Up @@ -253,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])
Expand Down

0 comments on commit 3bac10c

Please sign in to comment.