Re: BUG #18641: Logical decoding of two-phase commit fails with TOASTed default values
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Takeshi Ideriha <iderihatakeshi@gmail.com>
Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
Date: 2024-09-30T16:20:00Z
Lists: pgsql-bugs, pgsql-hackers
On Mon, Sep 30, 2024 at 6:46 AM Takeshi Ideriha <iderihatakeshi@gmail.com> wrote: > > Thank you for reporting the issue. > I was able to reproduce the issue by modifying 022_twophase_cascade.pl > accordingly. > > The scan for toast index is actually done under systable_getnext_ordered, > where HandleConcurrentAbort() is called. So it seems to me that this > scan is actually safe for concurrent abort in logical decoding. > Logic around HandleConcurrentAbort is intorduced > https://github.com/postgres/postgres/commit/7259736a6e5b7c7588fff9578370736a6648acbb. > > Though I may not understand the logic around HandleConcurrentAbort > fully and I am not sure not-setting bsysscan at > systable_beginscan_ordered is intentional, > it seems to me setting and unsetting a bsysscan flag in > systable_beginscan_ordered and systable_endscan_ordered would resolve > the issue. > We forgot to set/unset the flag in functions systable_beginscan_ordered and systable_endscan_ordered. BTW, shouldn't this occur even without prepare transaction? If so, we need to backpatch this till 14. Also, it is better to have a test for this, and let's ensure that the new test doesn't increase the regression time too much if possible. One minor point: + + /* + * If CheckXidAlive is set then set a flag to indicate that system table The indentation in the first comment line seems off. -- With Regards, Amit Kapila.
Commits
-
Fix fetching default toast value during decoding of in-progress transactions.
- 022564f60ca5 18.0 landed
- 91810775904f 17.1 landed
- 0f0e253dbf9e 16.5 landed
- 8175a7d11f70 15.9 landed
- efe706e273ce 14.14 landed
-
Implement streaming mode in ReorderBuffer.
- 7259736a6e5b 14.0 cited