pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix race condition in TransactionGroupUpdateXidStatus().
4+ messages / 1 participants
[nested] [flat]

* pgsql: Fix race condition in TransactionGroupUpdateXidStatus().
@ 2021-06-28 04:08  Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Amit Kapila @ 2021-06-28 04:08 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix race condition in TransactionGroupUpdateXidStatus().

When we cannot immediately acquire CLogControlLock in exclusive mode at
commit time, we add ourselves to a list of processes that need their XIDs
status update. We do this if the clog page where we need to update the
current transaction status is the same as the group leader's clog page,
otherwise, we allow the caller to clear it by itself. Now, when we can't
add ourselves to any group, we were not clearing the current proc if it
has already become a member of some group which was leading to an
assertion failure when the same proc was assigned to another backend after
the current backend exits.

Reported-by: Alexander Lakhin
Bug: 17072
Author: Amit Kapila
Tested-By: Alexander Lakhin
Backpatch-through: 11, where it was introduced
Discussion: https://postgr.es/m/17072-2f8764857ef2c92a@postgresql.org

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/access/transam/clog.c | 5 +++++
1 file changed, 5 insertions(+)



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

* pgsql: Fix race condition in TransactionGroupUpdateXidStatus().
@ 2021-06-28 04:08  Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Amit Kapila @ 2021-06-28 04:08 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix race condition in TransactionGroupUpdateXidStatus().

When we cannot immediately acquire CLogControlLock in exclusive mode at
commit time, we add ourselves to a list of processes that need their XIDs
status update. We do this if the clog page where we need to update the
current transaction status is the same as the group leader's clog page,
otherwise, we allow the caller to clear it by itself. Now, when we can't
add ourselves to any group, we were not clearing the current proc if it
has already become a member of some group which was leading to an
assertion failure when the same proc was assigned to another backend after
the current backend exits.

Reported-by: Alexander Lakhin
Bug: 17072
Author: Amit Kapila
Tested-By: Alexander Lakhin
Backpatch-through: 11, where it was introduced
Discussion: https://postgr.es/m/17072-2f8764857ef2c92a@postgresql.org

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/access/transam/clog.c | 5 +++++
1 file changed, 5 insertions(+)



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

* pgsql: Fix race condition in TransactionGroupUpdateXidStatus().
@ 2021-06-28 04:08  Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Amit Kapila @ 2021-06-28 04:08 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix race condition in TransactionGroupUpdateXidStatus().

When we cannot immediately acquire XactSLRULock in exclusive mode at
commit time, we add ourselves to a list of processes that need their XIDs
status update. We do this if the clog page where we need to update the
current transaction status is the same as the group leader's clog page,
otherwise, we allow the caller to clear it by itself. Now, when we can't
add ourselves to any group, we were not clearing the current proc if it
has already become a member of some group which was leading to an
assertion failure when the same proc was assigned to another backend after
the current backend exits.

Reported-by: Alexander Lakhin
Bug: 17072
Author: Amit Kapila
Tested-By: Alexander Lakhin
Backpatch-through: 11, where it was introduced
Discussion: https://postgr.es/m/17072-2f8764857ef2c92a@postgresql.org

Branch
------
master

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

Modified Files
--------------
src/backend/access/transam/clog.c | 5 +++++
1 file changed, 5 insertions(+)



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

* pgsql: Fix race condition in TransactionGroupUpdateXidStatus().
@ 2021-06-28 04:08  Amit Kapila <akapila@postgresql.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Amit Kapila @ 2021-06-28 04:08 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix race condition in TransactionGroupUpdateXidStatus().

When we cannot immediately acquire XactSLRULock in exclusive mode at
commit time, we add ourselves to a list of processes that need their XIDs
status update. We do this if the clog page where we need to update the
current transaction status is the same as the group leader's clog page,
otherwise, we allow the caller to clear it by itself. Now, when we can't
add ourselves to any group, we were not clearing the current proc if it
has already become a member of some group which was leading to an
assertion failure when the same proc was assigned to another backend after
the current backend exits.

Reported-by: Alexander Lakhin
Bug: 17072
Author: Amit Kapila
Tested-By: Alexander Lakhin
Backpatch-through: 11, where it was introduced
Discussion: https://postgr.es/m/17072-2f8764857ef2c92a@postgresql.org

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/741deb2603c758c67f199c9129d2e92bd80cec2e

Modified Files
--------------
src/backend/access/transam/clog.c | 5 +++++
1 file changed, 5 insertions(+)



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


end of thread, other threads:[~2021-06-28 04:08 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28 04:08 pgsql: Fix race condition in TransactionGroupUpdateXidStatus(). Amit Kapila <akapila@postgresql.org>
2021-06-28 04:08 pgsql: Fix race condition in TransactionGroupUpdateXidStatus(). Amit Kapila <akapila@postgresql.org>
2021-06-28 04:08 pgsql: Fix race condition in TransactionGroupUpdateXidStatus(). Amit Kapila <akapila@postgresql.org>
2021-06-28 04:08 pgsql: Fix race condition in TransactionGroupUpdateXidStatus(). 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