pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Prevent long-term memory leakage in autovacuum launcher.
7+ messages / 1 participants
[nested] [flat]

* pgsql: Prevent long-term memory leakage in autovacuum launcher.
@ 2022-08-31 20:23 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-31 20:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Prevent long-term memory leakage in autovacuum launcher.

get_database_list() failed to restore the caller's memory context,
instead leaving current context set to TopMemoryContext which is
how CommitTransactionCommand() leaves it.  The callers both think
they are using short-lived contexts, for the express purpose of
not having to worry about cleaning up individual allocations.
The net effect therefore is that supposedly short-lived allocations
could accumulate indefinitely in the launcher's TopMemoryContext.

Although this has been broken for a long time, it seems we didn't
have any obvious memory leak here until v15's rearrangement of the
stats logic.  I (tgl) am not entirely convinced that there's no
other leak at all, though, and we're surely at risk of adding one
in future back-patched fixes.  So back-patch to all supported
branches, even though this may be only a latent bug in pre-v15.

Reid Thompson

Discussion: https://postgr.es/m/972a4e12b68b0f96db514777a150ceef7dcd2e0f.camel@crunchydata.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1c1294be716d96e804aadafc249fcbfa8367621d

Modified Files
--------------
src/backend/postmaster/autovacuum.c | 3 +++
1 file changed, 3 insertions(+)



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

* pgsql: Prevent long-term memory leakage in autovacuum launcher.
@ 2022-08-31 20:23 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-31 20:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Prevent long-term memory leakage in autovacuum launcher.

get_database_list() failed to restore the caller's memory context,
instead leaving current context set to TopMemoryContext which is
how CommitTransactionCommand() leaves it.  The callers both think
they are using short-lived contexts, for the express purpose of
not having to worry about cleaning up individual allocations.
The net effect therefore is that supposedly short-lived allocations
could accumulate indefinitely in the launcher's TopMemoryContext.

Although this has been broken for a long time, it seems we didn't
have any obvious memory leak here until v15's rearrangement of the
stats logic.  I (tgl) am not entirely convinced that there's no
other leak at all, though, and we're surely at risk of adding one
in future back-patched fixes.  So back-patch to all supported
branches, even though this may be only a latent bug in pre-v15.

Reid Thompson

Discussion: https://postgr.es/m/972a4e12b68b0f96db514777a150ceef7dcd2e0f.camel@crunchydata.com

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0c599e748f2c81e415bb39567c4fd40a6bc64815

Modified Files
--------------
src/backend/postmaster/autovacuum.c | 3 +++
1 file changed, 3 insertions(+)



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

* pgsql: Prevent long-term memory leakage in autovacuum launcher.
@ 2022-08-31 20:23 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-31 20:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Prevent long-term memory leakage in autovacuum launcher.

get_database_list() failed to restore the caller's memory context,
instead leaving current context set to TopMemoryContext which is
how CommitTransactionCommand() leaves it.  The callers both think
they are using short-lived contexts, for the express purpose of
not having to worry about cleaning up individual allocations.
The net effect therefore is that supposedly short-lived allocations
could accumulate indefinitely in the launcher's TopMemoryContext.

Although this has been broken for a long time, it seems we didn't
have any obvious memory leak here until v15's rearrangement of the
stats logic.  I (tgl) am not entirely convinced that there's no
other leak at all, though, and we're surely at risk of adding one
in future back-patched fixes.  So back-patch to all supported
branches, even though this may be only a latent bug in pre-v15.

Reid Thompson

Discussion: https://postgr.es/m/972a4e12b68b0f96db514777a150ceef7dcd2e0f.camel@crunchydata.com

Branch
------
REL_14_STABLE

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

Modified Files
--------------
src/backend/postmaster/autovacuum.c | 3 +++
1 file changed, 3 insertions(+)



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

* pgsql: Prevent long-term memory leakage in autovacuum launcher.
@ 2022-08-31 20:23 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-31 20:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Prevent long-term memory leakage in autovacuum launcher.

get_database_list() failed to restore the caller's memory context,
instead leaving current context set to TopMemoryContext which is
how CommitTransactionCommand() leaves it.  The callers both think
they are using short-lived contexts, for the express purpose of
not having to worry about cleaning up individual allocations.
The net effect therefore is that supposedly short-lived allocations
could accumulate indefinitely in the launcher's TopMemoryContext.

Although this has been broken for a long time, it seems we didn't
have any obvious memory leak here until v15's rearrangement of the
stats logic.  I (tgl) am not entirely convinced that there's no
other leak at all, though, and we're surely at risk of adding one
in future back-patched fixes.  So back-patch to all supported
branches, even though this may be only a latent bug in pre-v15.

Reid Thompson

Discussion: https://postgr.es/m/972a4e12b68b0f96db514777a150ceef7dcd2e0f.camel@crunchydata.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/45f7152b9b382424431bdd65e57f9b8c75676aa2

Modified Files
--------------
src/backend/postmaster/autovacuum.c | 3 +++
1 file changed, 3 insertions(+)



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

* pgsql: Prevent long-term memory leakage in autovacuum launcher.
@ 2022-08-31 20:23 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-31 20:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Prevent long-term memory leakage in autovacuum launcher.

get_database_list() failed to restore the caller's memory context,
instead leaving current context set to TopMemoryContext which is
how CommitTransactionCommand() leaves it.  The callers both think
they are using short-lived contexts, for the express purpose of
not having to worry about cleaning up individual allocations.
The net effect therefore is that supposedly short-lived allocations
could accumulate indefinitely in the launcher's TopMemoryContext.

Although this has been broken for a long time, it seems we didn't
have any obvious memory leak here until v15's rearrangement of the
stats logic.  I (tgl) am not entirely convinced that there's no
other leak at all, though, and we're surely at risk of adding one
in future back-patched fixes.  So back-patch to all supported
branches, even though this may be only a latent bug in pre-v15.

Reid Thompson

Discussion: https://postgr.es/m/972a4e12b68b0f96db514777a150ceef7dcd2e0f.camel@crunchydata.com

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/postmaster/autovacuum.c | 3 +++
1 file changed, 3 insertions(+)



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

* pgsql: Prevent long-term memory leakage in autovacuum launcher.
@ 2022-08-31 20:23 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-31 20:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Prevent long-term memory leakage in autovacuum launcher.

get_database_list() failed to restore the caller's memory context,
instead leaving current context set to TopMemoryContext which is
how CommitTransactionCommand() leaves it.  The callers both think
they are using short-lived contexts, for the express purpose of
not having to worry about cleaning up individual allocations.
The net effect therefore is that supposedly short-lived allocations
could accumulate indefinitely in the launcher's TopMemoryContext.

Although this has been broken for a long time, it seems we didn't
have any obvious memory leak here until v15's rearrangement of the
stats logic.  I (tgl) am not entirely convinced that there's no
other leak at all, though, and we're surely at risk of adding one
in future back-patched fixes.  So back-patch to all supported
branches, even though this may be only a latent bug in pre-v15.

Reid Thompson

Discussion: https://postgr.es/m/972a4e12b68b0f96db514777a150ceef7dcd2e0f.camel@crunchydata.com

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/postmaster/autovacuum.c | 3 +++
1 file changed, 3 insertions(+)



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

* pgsql: Prevent long-term memory leakage in autovacuum launcher.
@ 2022-08-31 20:23 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-31 20:23 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Prevent long-term memory leakage in autovacuum launcher.

get_database_list() failed to restore the caller's memory context,
instead leaving current context set to TopMemoryContext which is
how CommitTransactionCommand() leaves it.  The callers both think
they are using short-lived contexts, for the express purpose of
not having to worry about cleaning up individual allocations.
The net effect therefore is that supposedly short-lived allocations
could accumulate indefinitely in the launcher's TopMemoryContext.

Although this has been broken for a long time, it seems we didn't
have any obvious memory leak here until v15's rearrangement of the
stats logic.  I (tgl) am not entirely convinced that there's no
other leak at all, though, and we're surely at risk of adding one
in future back-patched fixes.  So back-patch to all supported
branches, even though this may be only a latent bug in pre-v15.

Reid Thompson

Discussion: https://postgr.es/m/972a4e12b68b0f96db514777a150ceef7dcd2e0f.camel@crunchydata.com

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/postmaster/autovacuum.c | 3 +++
1 file changed, 3 insertions(+)



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


end of thread, other threads:[~2022-08-31 20:23 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31 20:23 pgsql: Prevent long-term memory leakage in autovacuum launcher. Tom Lane <tgl@sss.pgh.pa.us>
2022-08-31 20:23 pgsql: Prevent long-term memory leakage in autovacuum launcher. Tom Lane <tgl@sss.pgh.pa.us>
2022-08-31 20:23 pgsql: Prevent long-term memory leakage in autovacuum launcher. Tom Lane <tgl@sss.pgh.pa.us>
2022-08-31 20:23 pgsql: Prevent long-term memory leakage in autovacuum launcher. Tom Lane <tgl@sss.pgh.pa.us>
2022-08-31 20:23 pgsql: Prevent long-term memory leakage in autovacuum launcher. Tom Lane <tgl@sss.pgh.pa.us>
2022-08-31 20:23 pgsql: Prevent long-term memory leakage in autovacuum launcher. Tom Lane <tgl@sss.pgh.pa.us>
2022-08-31 20:23 pgsql: Prevent long-term memory leakage in autovacuum launcher. 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