Re: REPACK (CONCURRENTLY) decoding worker is canceled by lock_timeout

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: REPACK (CONCURRENTLY) decoding worker is canceled by lock_timeout
Date: 2026-09-10 03:21:53
Message-ID: CAGRkXqSdP2cpsnN8TLEuPs+MnRBTKgX3g4Lz0DiSjRTqAeuGXg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Alvaro,

> I would prefer to have a way to transmit the effective values from the
> leader backend to the worker

Done in v2, through the DSM segment the worker already attaches to.

Only lock_timeout and transaction_timeout are passed. A bgworker never
arms statement_timeout or idle_in_transaction_session_timeout. v1 have
because it aligns with the autovacuum worker.

One behavior change from v1. v1 turned the timeouts off, so REPACK always
got through. v2 uses the caller's values instead, so if the caller has a
lock_timeout of its own, the command can still be cancelled.

The difference is that it is now cancelled by a value the
caller sees in SHOW and can override with SET, rather than by one coming
from the owner role that the caller cannot reach at all.

I did consider SerializeGUCState, but that seems too much.

Applies cleanly to master and REL_19_STABLE.

Regards,
Shihao

Attachment Content-Type Size
v2-0001-Pass-the-backend-s-timeout-settings-to-the-REPACK.patch application/octet-stream 3.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-09-10 03:31:27 Re: [PATCH] Rewrite undirected edge patterns in GRAPH_TABLE using UNION ALL
Previous Message Fujii Masao 2026-09-10 02:57:09 Re: pg_stat_progress_cluster: do not default to CLUSTER