pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Somebody seems to have thought they could get away without
2+ messages / 2 participants
[nested] [flat]

* pgsql: Somebody seems to have thought they could get away without
@ 2009-06-11 16:14 Tom Lane <tgl@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: tgl@postgresql.org @ 2009-06-11 16:14 UTC (permalink / raw)
  To: pgsql-committers

Log Message:
-----------
Somebody seems to have thought they could get away without checking for
rsinfo->expectedDesc == NULL in deflist_to_tuplestore(), but that doesn't
look very safe to me.  Noted in passing while studying problem report
from Greg Davidson.

Modified Files:
--------------
    pgsql/src/backend/foreign:
        foreign.c (r1.4 -> r1.5)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/foreign/foreign.c?r1=1.4&r2=1.5)




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Post-commit review fixes for slot synchronization.
@ 2024-04-25 08:44 Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Amit Kapila @ 2024-04-25 08:44 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Post-commit review fixes for slot synchronization.

Allow pg_sync_replication_slots() to error out during promotion of standby.
This makes the behavior of the SQL function consistent with the slot sync
worker. We also ensured that pg_sync_replication_slots() cannot be
executed if sync_replication_slots is enabled and the slotsync worker is
already running to perform the synchronization of slots. Previously, it
would have succeeded in cases when the worker is idle and failed when it
is performing sync which could confuse users.

This patch fixes another issue in the slot sync worker where
SignalHandlerForShutdownRequest() needs to be registered *before* setting
SlotSyncCtx->pid, otherwise, the slotsync worker could miss handling
SIGINT sent by the startup process(ShutDownSlotSync) if it is sent before
worker could register SignalHandlerForShutdownRequest(). To be consistent,
all signal handlers' registration is moved to a prior location before we
set the worker's pid.

Ensure that we clean up synced temp slots at the end of
pg_sync_replication_slots() to avoid such slots being left over after
promotion.

Ensure that ShutDownSlotSync() captures SlotSyncCtx->pid under spinlock to
avoid accessing invalid value as it can be reset by concurrent slot sync
exit due to an error.

Author: Shveta Malik
Reviewed-by: Hou Zhijie, Bertrand Drouvot, Amit Kapila, Masahiko Sawada
Discussion: https://postgr.es/m/CAJpy0uBefXUS_TSz=oxmYKHdg-fhxUT0qfjASW3nmqnzVC3p6A@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/func.sgml                     |   4 +
src/backend/replication/logical/slotsync.c | 282 +++++++++++++++++++----------
src/backend/replication/slot.c             |  12 +-
src/backend/replication/walsender.c        |   2 +-
src/backend/tcop/postgres.c                |   2 +-
src/include/replication/slot.h             |   2 +-
6 files changed, 206 insertions(+), 98 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-04-25 08:44 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-06-11 16:14 pgsql: Somebody seems to have thought they could get away without Tom Lane <tgl@postgresql.org>
2024-04-25 08:44 pgsql: Post-commit review fixes for slot synchronization. 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