Have the REPACK decoding worker use timeout values from the steering backend

The worker connects as the table owner in a new session, so a role- or
database-level lock_timeout and transaction_timeout unhelpfully apply to
it, possibly canceling the wait for older transactions.  This cannot be
overridden by the REPACK calling session.  Fix by passing the timeout
values from the steering backend via the DecodingWorkerShared struct and
adopting these values in the worker; this way, values from session-local
SET reach the worker too.

In passing, remove a pointless member from the same struct.

Author: Shihao Zhong <[email protected]>
Backpatch-through: 19
Discussion: 
https://postgr.es/m/CAGRkXqTYaBjFvjtjPb1+=sZWvt93=2c472bmm+xdg7w9zva...@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a62ff0829d6b151a7107f6ae7f7f90b52405a247

Modified Files
--------------
src/backend/commands/repack.c          |  5 ++++-
src/backend/commands/repack_worker.c   | 11 ++++++++++-
src/include/commands/repack_internal.h |  5 ++++-
3 files changed, 18 insertions(+), 3 deletions(-)

Reply via email to