pgsql: Remove AELs from subxids correctly on standby

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Remove AELs from subxids correctly on standby
Date: 2018-06-16 13:08:36
Message-ID: E1fUAwW-0002Yk-In@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Remove AELs from subxids correctly on standby

Issues relate only to subtransactions that hold AccessExclusiveLocks
when replayed on standby.

Prior to PG10, aborting subtransactions that held an
AccessExclusiveLock failed to release the lock until top level commit or
abort. 49bff5300d527 fixed that.

However, 49bff5300d527 also introduced a similar bug where subtransaction
commit would fail to release an AccessExclusiveLock, leaving the lock to
be removed sometimes early and sometimes late. This commit fixes
that bug also. Backpatch to PG10 needed.

Tested by observation. Note need for multi-node isolationtester to improve
test coverage for this and other HS cases.

Reported-by: Simon Riggs
Author: Simon Riggs

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/15378c1a15390a2b4c315f19f1644af46c7e3a15

Modified Files
--------------
src/backend/access/transam/xact.c | 6 ++----
src/backend/storage/ipc/procarray.c | 5 +----
src/backend/storage/ipc/standby.c | 24 +++---------------------
src/include/storage/standby.h | 2 +-
4 files changed, 7 insertions(+), 30 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-06-16 18:11:19 pgsql: Fix some minor error-checking oversights in ParseFuncOrColumn().
Previous Message Peter Eisentraut 2018-06-16 12:44:30 Re: pgsql: Fix memory leak in PLySequence_ToJsonbValue()