RE: [BUG] Assert failure in ReorderBufferReturnTXN during logical decoding due to leaked specinsert change
Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Vishal Prasanna' <vishal.g@zohocorp.com>
Cc: "'Álvaro Herrera'" <alvherre@kurilemu.de>, pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Date: 2026-03-09T04:52:56Z
Lists: pgsql-bugs
Dear Vishal,
Thanks for updating the patch. They look good to me except one minor point.
```
@@ -2663,6 +2655,13 @@ ReorderBufferProcessTXN(ReorderBuffer *rb, ReorderBufferTXN *txn,
if (using_subtxn)
RollbackAndReleaseCurrentSubTransaction();
+ /* Free the specinsert change before freeing the ReorderBufferTXN */
+ if (specinsert != NULL)
+ {
+ ReorderBufferReturnChange(rb, specinsert, true);
+ specinsert = NULL;
+ }
```
In PG17-, we seem to use the term "return" to deallocate the change. Should we follow that?
I have no strong opinion for it.
I have no comments anymore. I registered your patch in commitfest [1]: and marked as
"Ready for Committer" not to forget. If needed you can register your name as author.
[1]: https://commitfest.postgresql.org/patch/6569/
Best regards,
Hayato Kuroda
FUJITSU LIMITED
Commits
-
logical decoding: Correctly free speculative insertion
- f50c329f538f 19 (unreleased) landed
- bd7b2184390f 18 (unreleased) landed
- ac445069002c 17 (unreleased) landed
- 813b0d8f455d 16 (unreleased) landed
- 1add4a41bc31 15 (unreleased) landed
- 0939aad56402 14 (unreleased) landed
-
Fix memory counter update in ReorderBuffer.
- dbed2e36625d 17.0 cited