public inbox for [email protected]  
help / color / mirror / Atom feed
From: Heikki Linnakangas <[email protected]>
To: [email protected]
Subject: pgsql: Refactor ProcessRecoveryConflictInterrupt for readability
Date: Tue, 10 Feb 2026 14:32:37 +0000
Message-ID: <[email protected]> (raw)

Refactor ProcessRecoveryConflictInterrupt for readability

Two changes here:

1. Introduce a separate RECOVERY_CONFLICT_BUFFERPIN_DEADLOCK flag to
indicate a suspected deadlock that involves a buffer pin. Previously
the startup process used the same flag for a deadlock involving just
regular locks, and to check for deadlocks involving the buffer
pin. The cases are handled separately in the startup process, but the
receiving backend had to deduce which one it was based on
HoldingBufferPinThatDelaysRecovery(). With a separate flag, the
receiver doesn't need to guess.

2. Rewrite the ProcessRecoveryConflictInterrupt() function to not rely
on fallthrough through the switch-statement. That was difficult to
read.

Reviewed-by: Chao Li <[email protected]>
Discussion: https://www.postgresql.org/message-id/[email protected]

Branch
------
master

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

Modified Files
--------------
src/backend/storage/ipc/standby.c            |   7 +-
src/backend/tcop/postgres.c                  | 262 ++++++++++++++++-----------
src/backend/utils/activity/pgstat_database.c |  10 +
src/include/storage/standby.h                |  10 +-
4 files changed, 181 insertions(+), 108 deletions(-)



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Refactor ProcessRecoveryConflictInterrupt for readability
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox