pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Have DISCARD ALL/TEMP remove leftover temp tables
4+ messages / 1 participants
[nested] [flat]

* pgsql: Have DISCARD ALL/TEMP remove leftover temp tables
@ 2018-12-27 19:20 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Alvaro Herrera @ 2018-12-27 19:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Have DISCARD ALL/TEMP remove leftover temp tables

Previously, it would only remove temp tables created in the same
session; but if the session uses the BackendId of a previously crashed
backend that left temp tables around, those would not get removed.
Since autovacuum would not drop them either (because it sees that the
BackendId is in use by the current session) these can cause annoying
xid-wraparound warnings.

Apply to branches 9.4 to 10.  This is not a problem since version 11,
because commit 943576bddcb5 added state tracking that makes autovacuum
realize that those temp tables are not ours, so it removes them.

This is useful to handle in DISCARD, because even though it does not
handle all situations, it does handle the common one where a connection
pooler keeps the same session open for an indefinitely long time.

Discussion: https://postgr.es/m/20181226190834.wsk2wzott5yzrjiq@alvherre.pgsql
Reviewed-by: Takayuki Tsunakawa, Michaël Paquier

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3c4ca21093b5d0662389777df853f6f3a36ee476

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



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

* pgsql: Have DISCARD ALL/TEMP remove leftover temp tables
@ 2018-12-27 19:20 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Alvaro Herrera @ 2018-12-27 19:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Have DISCARD ALL/TEMP remove leftover temp tables

Previously, it would only remove temp tables created in the same
session; but if the session uses the BackendId of a previously crashed
backend that left temp tables around, those would not get removed.
Since autovacuum would not drop them either (because it sees that the
BackendId is in use by the current session) these can cause annoying
xid-wraparound warnings.

Apply to branches 9.4 to 10.  This is not a problem since version 11,
because commit 943576bddcb5 added state tracking that makes autovacuum
realize that those temp tables are not ours, so it removes them.

This is useful to handle in DISCARD, because even though it does not
handle all situations, it does handle the common one where a connection
pooler keeps the same session open for an indefinitely long time.

Discussion: https://postgr.es/m/20181226190834.wsk2wzott5yzrjiq@alvherre.pgsql
Reviewed-by: Takayuki Tsunakawa, Michaël Paquier

Branch
------
REL9_6_STABLE

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

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



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

* pgsql: Have DISCARD ALL/TEMP remove leftover temp tables
@ 2018-12-27 19:20 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Alvaro Herrera @ 2018-12-27 19:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Have DISCARD ALL/TEMP remove leftover temp tables

Previously, it would only remove temp tables created in the same
session; but if the session uses the BackendId of a previously crashed
backend that left temp tables around, those would not get removed.
Since autovacuum would not drop them either (because it sees that the
BackendId is in use by the current session) these can cause annoying
xid-wraparound warnings.

Apply to branches 9.4 to 10.  This is not a problem since version 11,
because commit 943576bddcb5 added state tracking that makes autovacuum
realize that those temp tables are not ours, so it removes them.

This is useful to handle in DISCARD, because even though it does not
handle all situations, it does handle the common one where a connection
pooler keeps the same session open for an indefinitely long time.

Discussion: https://postgr.es/m/20181226190834.wsk2wzott5yzrjiq@alvherre.pgsql
Reviewed-by: Takayuki Tsunakawa, Michaël Paquier

Branch
------
REL9_5_STABLE

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

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



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

* pgsql: Have DISCARD ALL/TEMP remove leftover temp tables
@ 2018-12-27 19:20 Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 4+ messages in thread

From: Alvaro Herrera @ 2018-12-27 19:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Have DISCARD ALL/TEMP remove leftover temp tables

Previously, it would only remove temp tables created in the same
session; but if the session uses the BackendId of a previously crashed
backend that left temp tables around, those would not get removed.
Since autovacuum would not drop them either (because it sees that the
BackendId is in use by the current session) these can cause annoying
xid-wraparound warnings.

Apply to branches 9.4 to 10.  This is not a problem since version 11,
because commit 943576bddcb5 added state tracking that makes autovacuum
realize that those temp tables are not ours, so it removes them.

This is useful to handle in DISCARD, because even though it does not
handle all situations, it does handle the common one where a connection
pooler keeps the same session open for an indefinitely long time.

Discussion: https://postgr.es/m/20181226190834.wsk2wzott5yzrjiq@alvherre.pgsql
Reviewed-by: Takayuki Tsunakawa, Michaël Paquier

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2602838fa33824a0803f3b1f3814889ac7e93192

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



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


end of thread, other threads:[~2018-12-27 19:20 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-12-27 19:20 pgsql: Have DISCARD ALL/TEMP remove leftover temp tables Alvaro Herrera <alvherre@alvh.no-ip.org>
2018-12-27 19:20 pgsql: Have DISCARD ALL/TEMP remove leftover temp tables Alvaro Herrera <alvherre@alvh.no-ip.org>
2018-12-27 19:20 pgsql: Have DISCARD ALL/TEMP remove leftover temp tables Alvaro Herrera <alvherre@alvh.no-ip.org>
2018-12-27 19:20 pgsql: Have DISCARD ALL/TEMP remove leftover temp tables Alvaro Herrera <alvherre@alvh.no-ip.org>

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