pgsql: Remove useless errdetail_abort() - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Remove useless errdetail_abort()
Date
Msg-id E1vnGAB-000unj-1P@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Remove useless errdetail_abort()

I don't understand how to reach errdetail_abort() with
MyProc->recoveryConflictPending set. If a recovery conflict signal is
received, ProcessRecoveryConflictInterrupt() raises an ERROR or FATAL
error to cancel the query or connection, and abort processing clears
the flag. The error message from ProcessRecoveryConflictInterrupt() is
very clear that the query or connection was terminated because of
recovery conflict.

The only way to reach it AFAICS is with a race condition, if the
startup process sends a recovery conflict signal when the transaction
has just entered aborted state for some other reason. And in that case
the detail would be misleading, as the transaction was already aborted
for some other reason, not because of the recovery conflict.

errdetail_abort() was the only user of the recoveryConflictPending
flag in PGPROC, so we can remove that and all the related code too.

Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://www.postgresql.org/message-id/4cc13ba1-4248-4884-b6ba-4805349e7f39@iki.fi

Branch
------
master

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

Modified Files
--------------
src/backend/storage/ipc/procarray.c | 20 +++-----------------
src/backend/storage/ipc/standby.c   | 15 +++++++--------
src/backend/storage/lmgr/proc.c     |  1 -
src/backend/tcop/postgres.c         | 35 ++++++-----------------------------
src/include/storage/proc.h          |  7 -------
src/include/storage/procarray.h     |  6 ++----
6 files changed, 18 insertions(+), 66 deletions(-)


pgsql-committers by date:

Previous
From: Álvaro Herrera
Date:
Subject: pgsql: Reject ADD CONSTRAINT NOT NULL if name mismatches existing const
Next
From: Álvaro Herrera
Date:
Subject: pgsql: Update .abi-compliance-history for AdjustNotNullInheritance().