RE: [BUG] Assert failure in ReorderBufferReturnTXN during logical decoding due to leaked specinsert change - Mailing list pgsql-bugs

From Hayato Kuroda (Fujitsu)
Subject RE: [BUG] Assert failure in ReorderBufferReturnTXN during logical decoding due to leaked specinsert change
Date
Msg-id OS9PR01MB1214923A50CA2640D572FEBE1F579A@OS9PR01MB12149.jpnprd01.prod.outlook.com
Whole thread Raw
In response to RE: [BUG] Assert failure in ReorderBufferReturnTXN during logical decoding due to leaked specinsert change  (Vishal Prasanna <vishal.g@zohocorp.com>)
Responses RE: [BUG] Assert failure in ReorderBufferReturnTXN during logical decoding due to leaked specinsert change
List 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


pgsql-bugs by date:

Previous
From: Vishal Prasanna
Date:
Subject: RE: [BUG] Assert failure in ReorderBufferReturnTXN during logical decoding due to leaked specinsert change
Next
From: Michael Paquier
Date:
Subject: Re: BUG #18943: Return value of a function 'xmlBufferCreate' isdereferenced at xpath.c:177 without checking for NUL