Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb786304

Browse files
author
Amit Kapila
committed
Fix race condition in TransactionGroupUpdateXidStatus().
When we cannot immediately acquire XactSLRULock in exclusive mode atcommit time, we add ourselves to a list of processes that need their XIDsstatus update. We do this if the clog page where we need to update thecurrent 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'tadd ourselves to any group, we were not clearing the current proc if ithas already become a member of some group which was leading to anassertion failure when the same proc was assigned to another backend afterthe current backend exits.Reported-by: Alexander LakhinBug: 17072Author: Amit KapilaTested-By: Alexander LakhinBackpatch-through: 11, where it was introducedDiscussion:https://postgr.es/m/17072-2f8764857ef2c92a@postgresql.org
1 parent34a8b64 commitb786304

File tree

1 file changed

+5
-0
lines changed
  • src/backend/access/transam

1 file changed

+5
-0
lines changed

‎src/backend/access/transam/clog.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,12 @@ TransactionGroupUpdateXidStatus(TransactionId xid, XidStatus status,
451451
if (nextidx!=INVALID_PGPROCNO&&
452452
ProcGlobal->allProcs[nextidx].clogGroupMemberPage!=proc->clogGroupMemberPage)
453453
{
454+
/*
455+
* Ensure that this proc is not a member of any clog group that
456+
* needs an XID status update.
457+
*/
454458
proc->clogGroupMember= false;
459+
pg_atomic_write_u32(&proc->clogGroupNext,INVALID_PGPROCNO);
455460
return false;
456461
}
457462

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp