pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix LOCK_TIMEOUT handling during parallel apply. 4+ messages / 1 participants [nested] [flat]
* pgsql: Fix LOCK_TIMEOUT handling during parallel apply. @ 2025-09-24 04:25 Amit Kapila <akapila@postgresql.org> 0 siblings, 0 replies; 4+ messages in thread From: Amit Kapila @ 2025-09-24 04:25 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix LOCK_TIMEOUT handling during parallel apply. Previously, the parallel apply worker used SIGINT to receive a graceful shutdown signal from the leader apply worker. However, SIGINT is also used by the LOCK_TIMEOUT handler to trigger a query-cancel interrupt. This overlap caused the parallel apply worker to miss LOCK_TIMEOUT signals, leading to incorrect behavior during lock wait/contention. This patch resolves the conflict by switching the graceful shutdown signal from SIGINT to SIGUSR2. Reported-by: Zane Duffield <duffieldzane@gmail.com> Diagnosed-by: Zhijie Hou <houzj.fnst@fujitsu.com> Author: Hayato Kuroda <kuroda.hayato@fujitsu.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Backpatch-through: 16, where it was introduced Discussion: https://postgr.es/m/CACMiCkXyC4au74kvE2g6Y=mCEF8X6r-Ne_ty4r7qWkUjRE4+oQ@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/e41d954da6aa04f0a4453e566d3bcc064512d457 Modified Files -------------- src/backend/postmaster/interrupt.c | 5 ++--- src/backend/replication/logical/applyparallelworker.c | 17 ++++++++++++----- src/backend/replication/logical/launcher.c | 4 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix LOCK_TIMEOUT handling during parallel apply. @ 2025-09-24 04:25 Amit Kapila <akapila@postgresql.org> 0 siblings, 0 replies; 4+ messages in thread From: Amit Kapila @ 2025-09-24 04:25 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix LOCK_TIMEOUT handling during parallel apply. Previously, the parallel apply worker used SIGINT to receive a graceful shutdown signal from the leader apply worker. However, SIGINT is also used by the LOCK_TIMEOUT handler to trigger a query-cancel interrupt. This overlap caused the parallel apply worker to miss LOCK_TIMEOUT signals, leading to incorrect behavior during lock wait/contention. This patch resolves the conflict by switching the graceful shutdown signal from SIGINT to SIGUSR2. Reported-by: Zane Duffield <duffieldzane@gmail.com> Diagnosed-by: Zhijie Hou <houzj.fnst@fujitsu.com> Author: Hayato Kuroda <kuroda.hayato@fujitsu.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Backpatch-through: 16, where it was introduced Discussion: https://postgr.es/m/CACMiCkXyC4au74kvE2g6Y=mCEF8X6r-Ne_ty4r7qWkUjRE4+oQ@mail.gmail.com Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/37fc5de438b423f34ba8551a9902a52963be98f5 Modified Files -------------- src/backend/postmaster/interrupt.c | 5 ++--- src/backend/replication/logical/applyparallelworker.c | 17 ++++++++++++----- src/backend/replication/logical/launcher.c | 4 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix LOCK_TIMEOUT handling during parallel apply. @ 2025-09-24 04:25 Amit Kapila <akapila@postgresql.org> 0 siblings, 0 replies; 4+ messages in thread From: Amit Kapila @ 2025-09-24 04:25 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix LOCK_TIMEOUT handling during parallel apply. Previously, the parallel apply worker used SIGINT to receive a graceful shutdown signal from the leader apply worker. However, SIGINT is also used by the LOCK_TIMEOUT handler to trigger a query-cancel interrupt. This overlap caused the parallel apply worker to miss LOCK_TIMEOUT signals, leading to incorrect behavior during lock wait/contention. This patch resolves the conflict by switching the graceful shutdown signal from SIGINT to SIGUSR2. Reported-by: Zane Duffield <duffieldzane@gmail.com> Diagnosed-by: Zhijie Hou <houzj.fnst@fujitsu.com> Author: Hayato Kuroda <kuroda.hayato@fujitsu.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Backpatch-through: 16, where it was introduced Discussion: https://postgr.es/m/CACMiCkXyC4au74kvE2g6Y=mCEF8X6r-Ne_ty4r7qWkUjRE4+oQ@mail.gmail.com Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2f6e1a49066f512813c0ad0b4a77e0fd04a3a508 Modified Files -------------- src/backend/postmaster/interrupt.c | 5 ++--- src/backend/replication/logical/applyparallelworker.c | 17 ++++++++++++----- src/backend/replication/logical/launcher.c | 4 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Fix LOCK_TIMEOUT handling during parallel apply. @ 2025-09-24 04:25 Amit Kapila <akapila@postgresql.org> 0 siblings, 0 replies; 4+ messages in thread From: Amit Kapila @ 2025-09-24 04:25 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix LOCK_TIMEOUT handling during parallel apply. Previously, the parallel apply worker used SIGINT to receive a graceful shutdown signal from the leader apply worker. However, SIGINT is also used by the LOCK_TIMEOUT handler to trigger a query-cancel interrupt. This overlap caused the parallel apply worker to miss LOCK_TIMEOUT signals, leading to incorrect behavior during lock wait/contention. This patch resolves the conflict by switching the graceful shutdown signal from SIGINT to SIGUSR2. Reported-by: Zane Duffield <duffieldzane@gmail.com> Diagnosed-by: Zhijie Hou <houzj.fnst@fujitsu.com> Author: Hayato Kuroda <kuroda.hayato@fujitsu.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Backpatch-through: 16, where it was introduced Discussion: https://postgr.es/m/CACMiCkXyC4au74kvE2g6Y=mCEF8X6r-Ne_ty4r7qWkUjRE4+oQ@mail.gmail.com Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/a54c7a1133a4338c09b435f7870152f305bbf3ad Modified Files -------------- src/backend/postmaster/interrupt.c | 5 ++--- src/backend/replication/logical/applyparallelworker.c | 17 ++++++++++++----- src/backend/replication/logical/launcher.c | 4 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2025-09-24 04:25 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-09-24 04:25 pgsql: Fix LOCK_TIMEOUT handling during parallel apply. Amit Kapila <akapila@postgresql.org> 2025-09-24 04:25 pgsql: Fix LOCK_TIMEOUT handling during parallel apply. Amit Kapila <akapila@postgresql.org> 2025-09-24 04:25 pgsql: Fix LOCK_TIMEOUT handling during parallel apply. Amit Kapila <akapila@postgresql.org> 2025-09-24 04:25 pgsql: Fix LOCK_TIMEOUT handling during parallel apply. Amit Kapila <akapila@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox