Re: [PATCH] Fix memory leak in pgstat_progress_parallel_incr_param()
Re: [PATCH] Fix memory leak in pgstat_progress_parallel_incr_param()
On Fri, Jun 5, 2026 at 4:29 PM Tristan Partin <tristan@partin.io> wrote:
This looks pretty reasonable to me. Nice find. Did you think about
keeping the code path as is and just removing the first initStringInfo()
call? Removing the allocation per progress message seems like a good
idea to me. Maybe you could separate this change into two patches. One
to fix the memory leak and another to remove the allocation per message.
A committer could then decide for themselves if the second patch is
worth committing.
a good idea. I see f1889729dd3 itself is in PG17+, so the bug fix is
a backport candidate independently of the PG19 caller bb8dff9995f.
Patches attached:
0001: drop the redundant initStringInfo() call (backport candidate)
0002: allocate the static buffer once per process via
pq_beginmessage_reuse / pq_endmessage_reuse, to avoid the
per-call allocation (master only)
Thanks,
Baji Shaik
Re: [PATCH] Fix memory leak in pgstat_progress_parallel_incr_param()
От:
Sami Imseih <samimseih@gmail.com>
Дата:
Hi, good find, and thanks for the patches! > 0001: drop the redundant initStringInfo() call (backport candidate) This one looks like an obvious fix to me. > 0002: allocate the static buffer once per process via > pq_beginmessage_reuse / pq_endmessage_reuse, to avoid the > per-call allocation (master only) I am less convinced this will have any benefits for the additional complexity. The callers of pgstat_progress_parallel_incr_param() are not frequent enough to make a measurable difference here. cost delay reporting for parallel workers is throttled by PARALLEL_VACUUM_DELAY_REPORT_INTERVAL_NS and index progress reporting does not happen very frequently either. -- Sami Imseih Amazon Web Services (AWS)
Re: [PATCH] Fix memory leak in pgstat_progress_parallel_incr_param()
On Sat, Jun 6, 2026 at 9:55 AM Sami Imseih <samimseih@gmail.com> wrote:
> 0002: allocate the static buffer once per process via
> pq_beginmessage_reuse / pq_endmessage_reuse, to avoid the
> per-call allocation (master only)
I am less convinced this will have any benefits for the additional complexity.
The callers of pgstat_progress_parallel_incr_param() are not frequent enough
to make a measurable difference here. cost delay reporting for parallel workers
is throttled by PARALLEL_VACUUM_DELAY_REPORT_INTERVAL_NS and
index progress reporting does not happen very frequently either.
Agreed, at those call frequencies the per-call palloc is not worth
the added complexity. Dropping 0002.
v3 attached (just 0001, unchanged from previous).
v3 attached (just 0001, unchanged from previous).
Thanks,
Baji Shaik.
Baji Shaik.
pgsql: Revert "Validate subscription conninfo on owner change"
Revert "Validate subscription conninfo on owner change" This reverts commit 1c9c35890421e96a91129b51f2c6446a6d95af95. Raising errors during OWNER TO can cause problems during restore. An upcoming commit will avoid other errors that can happen in this path. Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/e103ae8daf74485e0c0ebde297fae735d38f54d1.camel@j-davis.com Backpatch-through: 19 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/ac230cd3ce93c4752489564cfe6b37b584a465ac Modified Files -------------- doc/src/sgml/ref/alter_subscription.sgml | 7 ------- src/backend/commands/subscriptioncmds.c | 14 ++------------ src/test/regress/expected/subscription.out | 17 ----------------- src/test/regress/regress.c | 9 --------- src/test/regress/sql/subscription.sql | 15 --------------- 5 files changed, 2 insertions(+), 60 deletions(-)