Re: Decoding speculative insert with toast leaks memory
Amit Langote <amitlangote09@gmail.com>
From: Amit Langote <amitlangote09@gmail.com>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, osumi.takamichi@fujitsu.com, Alvaro Herrera <alvherre@alvh.no-ip.org>, Andres Freund <andres@anarazel.de>,
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, Petr Jelinek <petr.jelinek@enterprisedb.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Tomas Vondra <tomas.vondra@enterprisedb.com>
Date: 2021-06-17T08:05:30Z
Lists: pgsql-hackers
Attachments
- pg13-init-RelationSyncEntry-properly_v2.patch (application/octet-stream) patch v2
- HEAD-fix-get_rel_sync_entry-comment.patch (application/octet-stream) patch
Hi Dilip,
On Thu, Jun 17, 2021 at 4:45 PM Dilip Kumar <dilipbalaut@gmail.com> wrote:
> On Thu, Jun 17, 2021 at 12:52 PM Amit Langote <amitlangote09@gmail.com> wrote:
>
> > Oh I missed that the problem report is for the PG13 branch.
> >
> > How about the attached patch then?
> >
> Looks good,
Thanks for checking.
> one minor comment, how about making the below comment,
> same as on the head?
>
> - if (!found || !entry->replicate_valid)
> + if (!found)
> + {
> + /*
> + * Make the new entry valid enough for the callbacks to look at, in
> + * case any of them get invoked during the more complicated
> + * initialization steps below.
> + */
>
> On head:
> if (!found)
> {
> /* immediately make a new entry valid enough to satisfy callbacks */
Agree it's better to have the same comment in both branches.
Though, I think it should be "the new entry", not "a new entry". I
find the sentence I wrote a bit more enlightening, but I am fine with
just fixing the aforementioned problem with the existing comment.
I've updated the patch. Also, attaching a patch for HEAD for the
s/a/the change. While at it, I also capitalized "immediately".
--
Amit Langote
EDB: http://www.enterprisedb.com
Commits
-
Fix ABI break introduced by commit 4daa140a2f.
- e95f617acc48 11.13 landed
- 72b51e214a2c 12.8 landed
- 56e366f6757d 13.4 landed
-
Fix valgrind issue in pgoutput.c.
- 357cb8f07f95 13.4 landed
-
Fix decoding of speculative aborts.
- 43acadfcebec 9.6.23 landed
- 35f56c124a7a 10.18 landed
- 1f8a934e0a86 11.13 landed
- 40ad7ebff6ca 12.8 landed
- 602a32a685e4 13.4 landed
- 4daa140a2f50 14.0 landed
-
pgoutput: Fix memory leak due to RelationSyncEntry.map.
- d2505681211b 13.4 cited
-
Fix initialization of RelationSyncEntry for streaming transactions.
- 69bd60672af6 14.0 cited
-
Implement streaming mode in ReorderBuffer.
- 7259736a6e5b 14.0 cited