pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Avoid leaking memory during large-scale REASSIGN OWNED BY operat
6+ messages / 1 participants
[nested] [flat]

* pgsql: Avoid leaking memory during large-scale REASSIGN OWNED BY operat
@ 2021-12-01 18:45  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2021-12-01 18:45 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid leaking memory during large-scale REASSIGN OWNED BY operations.

The various ALTER OWNER routines tend to leak memory in
CurrentMemoryContext.  That's not a problem when they're only called
once per command; but in this usage where we might be touching many
objects, it can amount to a serious memory leak.  Fix that by running
each call in a short-lived context.

(DROP OWNED BY likely has a similar issue, except that you'll probably
run out of lock table space before noticing.  REASSIGN is worth fixing
since for most non-table object types, it won't take any lock.)

Back-patch to all supported branches.  Unfortunately, in the back
branches this helps to only a limited extent, since the sinval message
queue bloats quite a lot in this usage before commit 3aafc030a,
consuming memory more or less comparable to what's actually leaked.
Still, it's clearly a leak with a simple fix, so we might as well fix it.

Justin Pryzby, per report from Guillaume Lelarge

Discussion: https://postgr.es/m/CAECtzeW2DAoioEGBRjR=CzHP6TdL=yosGku8qZxfX9hhtrBB0Q@mail.gmail.com

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fec187dc3ca2b684d31e4cb0445f392d9c909f85

Modified Files
--------------
src/backend/catalog/pg_shdepend.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid leaking memory during large-scale REASSIGN OWNED BY operat
@ 2021-12-01 18:45  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2021-12-01 18:45 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid leaking memory during large-scale REASSIGN OWNED BY operations.

The various ALTER OWNER routines tend to leak memory in
CurrentMemoryContext.  That's not a problem when they're only called
once per command; but in this usage where we might be touching many
objects, it can amount to a serious memory leak.  Fix that by running
each call in a short-lived context.

(DROP OWNED BY likely has a similar issue, except that you'll probably
run out of lock table space before noticing.  REASSIGN is worth fixing
since for most non-table object types, it won't take any lock.)

Back-patch to all supported branches.  Unfortunately, in the back
branches this helps to only a limited extent, since the sinval message
queue bloats quite a lot in this usage before commit 3aafc030a,
consuming memory more or less comparable to what's actually leaked.
Still, it's clearly a leak with a simple fix, so we might as well fix it.

Justin Pryzby, per report from Guillaume Lelarge

Discussion: https://postgr.es/m/CAECtzeW2DAoioEGBRjR=CzHP6TdL=yosGku8qZxfX9hhtrBB0Q@mail.gmail.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8f4b0200e15a5684f6331f94caea002370754257

Modified Files
--------------
src/backend/catalog/pg_shdepend.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid leaking memory during large-scale REASSIGN OWNED BY operat
@ 2021-12-01 18:45  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2021-12-01 18:45 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid leaking memory during large-scale REASSIGN OWNED BY operations.

The various ALTER OWNER routines tend to leak memory in
CurrentMemoryContext.  That's not a problem when they're only called
once per command; but in this usage where we might be touching many
objects, it can amount to a serious memory leak.  Fix that by running
each call in a short-lived context.

(DROP OWNED BY likely has a similar issue, except that you'll probably
run out of lock table space before noticing.  REASSIGN is worth fixing
since for most non-table object types, it won't take any lock.)

Back-patch to all supported branches.  Unfortunately, in the back
branches this helps to only a limited extent, since the sinval message
queue bloats quite a lot in this usage before commit 3aafc030a,
consuming memory more or less comparable to what's actually leaked.
Still, it's clearly a leak with a simple fix, so we might as well fix it.

Justin Pryzby, per report from Guillaume Lelarge

Discussion: https://postgr.es/m/CAECtzeW2DAoioEGBRjR=CzHP6TdL=yosGku8qZxfX9hhtrBB0Q@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/babe545caeba4c62feb3030940d93432721eea57

Modified Files
--------------
src/backend/catalog/pg_shdepend.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid leaking memory during large-scale REASSIGN OWNED BY operat
@ 2021-12-01 18:45  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2021-12-01 18:45 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid leaking memory during large-scale REASSIGN OWNED BY operations.

The various ALTER OWNER routines tend to leak memory in
CurrentMemoryContext.  That's not a problem when they're only called
once per command; but in this usage where we might be touching many
objects, it can amount to a serious memory leak.  Fix that by running
each call in a short-lived context.

(DROP OWNED BY likely has a similar issue, except that you'll probably
run out of lock table space before noticing.  REASSIGN is worth fixing
since for most non-table object types, it won't take any lock.)

Back-patch to all supported branches.  Unfortunately, in the back
branches this helps to only a limited extent, since the sinval message
queue bloats quite a lot in this usage before commit 3aafc030a,
consuming memory more or less comparable to what's actually leaked.
Still, it's clearly a leak with a simple fix, so we might as well fix it.

Justin Pryzby, per report from Guillaume Lelarge

Discussion: https://postgr.es/m/CAECtzeW2DAoioEGBRjR=CzHP6TdL=yosGku8qZxfX9hhtrBB0Q@mail.gmail.com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5cf08b4db79d6e3a82c4b92f8c9cf35e87c70d01

Modified Files
--------------
src/backend/catalog/pg_shdepend.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid leaking memory during large-scale REASSIGN OWNED BY operat
@ 2021-12-01 18:45  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2021-12-01 18:45 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid leaking memory during large-scale REASSIGN OWNED BY operations.

The various ALTER OWNER routines tend to leak memory in
CurrentMemoryContext.  That's not a problem when they're only called
once per command; but in this usage where we might be touching many
objects, it can amount to a serious memory leak.  Fix that by running
each call in a short-lived context.

(DROP OWNED BY likely has a similar issue, except that you'll probably
run out of lock table space before noticing.  REASSIGN is worth fixing
since for most non-table object types, it won't take any lock.)

Back-patch to all supported branches.  Unfortunately, in the back
branches this helps to only a limited extent, since the sinval message
queue bloats quite a lot in this usage before commit 3aafc030a,
consuming memory more or less comparable to what's actually leaked.
Still, it's clearly a leak with a simple fix, so we might as well fix it.

Justin Pryzby, per report from Guillaume Lelarge

Discussion: https://postgr.es/m/CAECtzeW2DAoioEGBRjR=CzHP6TdL=yosGku8qZxfX9hhtrBB0Q@mail.gmail.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7413caabe66e02b8967825a2dc1041e9db246622

Modified Files
--------------
src/backend/catalog/pg_shdepend.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Avoid leaking memory during large-scale REASSIGN OWNED BY operat
@ 2021-12-01 18:45  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2021-12-01 18:45 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Avoid leaking memory during large-scale REASSIGN OWNED BY operations.

The various ALTER OWNER routines tend to leak memory in
CurrentMemoryContext.  That's not a problem when they're only called
once per command; but in this usage where we might be touching many
objects, it can amount to a serious memory leak.  Fix that by running
each call in a short-lived context.

(DROP OWNED BY likely has a similar issue, except that you'll probably
run out of lock table space before noticing.  REASSIGN is worth fixing
since for most non-table object types, it won't take any lock.)

Back-patch to all supported branches.  Unfortunately, in the back
branches this helps to only a limited extent, since the sinval message
queue bloats quite a lot in this usage before commit 3aafc030a,
consuming memory more or less comparable to what's actually leaked.
Still, it's clearly a leak with a simple fix, so we might as well fix it.

Justin Pryzby, per report from Guillaume Lelarge

Discussion: https://postgr.es/m/CAECtzeW2DAoioEGBRjR=CzHP6TdL=yosGku8qZxfX9hhtrBB0Q@mail.gmail.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/82d354411749ac9756974c789bec4f78f2dafbf7

Modified Files
--------------
src/backend/catalog/pg_shdepend.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2021-12-01 18:45 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01 18:45 pgsql: Avoid leaking memory during large-scale REASSIGN OWNED BY operat Tom Lane <tgl@sss.pgh.pa.us>
2021-12-01 18:45 pgsql: Avoid leaking memory during large-scale REASSIGN OWNED BY operat Tom Lane <tgl@sss.pgh.pa.us>
2021-12-01 18:45 pgsql: Avoid leaking memory during large-scale REASSIGN OWNED BY operat Tom Lane <tgl@sss.pgh.pa.us>
2021-12-01 18:45 pgsql: Avoid leaking memory during large-scale REASSIGN OWNED BY operat Tom Lane <tgl@sss.pgh.pa.us>
2021-12-01 18:45 pgsql: Avoid leaking memory during large-scale REASSIGN OWNED BY operat Tom Lane <tgl@sss.pgh.pa.us>
2021-12-01 18:45 pgsql: Avoid leaking memory during large-scale REASSIGN OWNED BY operat Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox