RE: Assertion failure in SnapBuildInitialSnapshot()
Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Masahiko Sawada' <sawada.mshk@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Thomas Munro <thomas.munro@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>
Date: 2023-01-27T11:01:19Z
Lists: pgsql-hackers
Dear Sawada-san, Thank you for making the patch! I'm still considering whether this approach is correct, but I can put a comment to your patch anyway. ``` - Assert(!already_locked || LWLockHeldByMe(ProcArrayLock)); - - if (!already_locked) - LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE); + Assert(LWLockHeldByMe(ProcArrayLock)); ``` In this function, we regard that the ProcArrayLock has been already acquired as exclusive mode and modify data. I think LWLockHeldByMeInMode() should be used instead of LWLockHeldByMe(). I confirmed that there is only one caller that uses ReplicationSlotsComputeRequiredXmin(true) and it acquires exclusive lock correctly, but it can avoid future bug. Best Regards, Hayato Kuroda FUJITSU LIMITED
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix a race condition in updating procArray->replication_slot_xmin.
- 2a5225b99d76 19 (unreleased) landed
- fd7c86cfaf13 18.2 landed
- 123b851abdac 17.8 landed
- 82146672261d 16.12 landed
- fa557d3005e7 15.16 landed
- 57048d6e1733 14.21 landed
-
Don't retreat slot's confirmed_flush LSN.
- ad5eaf390c58 18.0 cited
-
Add additional checks while creating the initial decoding snapshot.
- 240e0dbacd39 16.0 landed