pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Lock table in DROP STATISTICS
6+ messages / 1 participants
[nested] [flat]

* pgsql: Lock table in DROP STATISTICS
@ 2023-11-19 20:05 Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tomas Vondra @ 2023-11-19 20:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Lock table in DROP STATISTICS

The DROP STATISTICS code failed to properly lock the table, leading to

  ERROR:  tuple concurrently deleted

when executed concurrently with ANALYZE.

Fixed by modifying RemoveStatisticsById() to acquire the same lock as
ANALYZE. This function is called only by DROP STATISTICS, as ANALYZE
calls RemoveStatisticsDataById() directly.

Reported by Justin Pryzby, fix by me. Backpatch through 12. The code was
like this since it was introduced in 10, but older releases are EOL.

Reported-by: Justin Pryzby
Reviewed-by: Tom Lane
Backpatch-through: 12

Discussion: https://postgr.es/m/ZUuk-8CfbYeq6g_u@pryzbyj2023

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/28f84f72fbafe3bef675d3a176eb53177f4a9433

Modified Files
--------------
src/backend/commands/statscmds.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)



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

* pgsql: Lock table in DROP STATISTICS
@ 2023-11-19 20:06 Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tomas Vondra @ 2023-11-19 20:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Lock table in DROP STATISTICS

The DROP STATISTICS code failed to properly lock the table, leading to

  ERROR:  tuple concurrently deleted

when executed concurrently with ANALYZE.

Fixed by modifying RemoveStatisticsById() to acquire the same lock as
ANALYZE. This function is called only by DROP STATISTICS, as ANALYZE
calls RemoveStatisticsDataById() directly.

Reported by Justin Pryzby, fix by me. Backpatch through 12. The code was
like this since it was introduced in 10, but older releases are EOL.

Reported-by: Justin Pryzby
Reviewed-by: Tom Lane
Backpatch-through: 12

Discussion: https://postgr.es/m/ZUuk-8CfbYeq6g_u@pryzbyj2023

Branch
------
REL_16_STABLE

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

Modified Files
--------------
src/backend/commands/statscmds.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)



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

* pgsql: Lock table in DROP STATISTICS
@ 2023-11-19 20:06 Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tomas Vondra @ 2023-11-19 20:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Lock table in DROP STATISTICS

The DROP STATISTICS code failed to properly lock the table, leading to

  ERROR:  tuple concurrently deleted

when executed concurrently with ANALYZE.

Fixed by modifying RemoveStatisticsById() to acquire the same lock as
ANALYZE. This function is called only by DROP STATISTICS, as ANALYZE
calls RemoveStatisticsDataById() directly.

Reported by Justin Pryzby, fix by me. Backpatch through 12. The code was
like this since it was introduced in 10, but older releases are EOL.

Reported-by: Justin Pryzby
Reviewed-by: Tom Lane
Backpatch-through: 12

Discussion: https://postgr.es/m/ZUuk-8CfbYeq6g_u@pryzbyj2023

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0177fc773e3c6cfafbcfc8e447c013bd2dfe3672

Modified Files
--------------
src/backend/commands/statscmds.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)



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

* pgsql: Lock table in DROP STATISTICS
@ 2023-11-19 20:06 Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tomas Vondra @ 2023-11-19 20:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Lock table in DROP STATISTICS

The DROP STATISTICS code failed to properly lock the table, leading to

  ERROR:  tuple concurrently deleted

when executed concurrently with ANALYZE.

Fixed by modifying RemoveStatisticsById() to acquire the same lock as
ANALYZE. This function is called only by DROP STATISTICS, as ANALYZE
calls RemoveStatisticsDataById() directly.

Reported by Justin Pryzby, fix by me. Backpatch through 12. The code was
like this since it was introduced in 10, but older releases are EOL.

Reported-by: Justin Pryzby
Reviewed-by: Tom Lane
Backpatch-through: 12

Discussion: https://postgr.es/m/ZUuk-8CfbYeq6g_u@pryzbyj2023

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9dd50e92ed239bc4643c1df7e9e0bcc03b05bfef

Modified Files
--------------
src/backend/commands/statscmds.c | 39 +++++++++++++++++++++++++++++----------
1 file changed, 29 insertions(+), 10 deletions(-)



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

* pgsql: Lock table in DROP STATISTICS
@ 2023-11-19 20:06 Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tomas Vondra @ 2023-11-19 20:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Lock table in DROP STATISTICS

The DROP STATISTICS code failed to properly lock the table, leading to

  ERROR:  tuple concurrently deleted

when executed concurrently with ANALYZE.

Fixed by modifying RemoveStatisticsById() to acquire the same lock as
ANALYZE. This function is called only by DROP STATISTICS, as ANALYZE
calls RemoveStatisticsDataById() directly.

Reported by Justin Pryzby, fix by me. Backpatch through 12. The code was
like this since it was introduced in 10, but older releases are EOL.

Reported-by: Justin Pryzby
Reviewed-by: Tom Lane
Backpatch-through: 12

Discussion: https://postgr.es/m/ZUuk-8CfbYeq6g_u@pryzbyj2023

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/backend/commands/statscmds.c | 39 +++++++++++++++++++++++++++++----------
1 file changed, 29 insertions(+), 10 deletions(-)



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

* pgsql: Lock table in DROP STATISTICS
@ 2023-11-19 20:06 Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Tomas Vondra @ 2023-11-19 20:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Lock table in DROP STATISTICS

The DROP STATISTICS code failed to properly lock the table, leading to

  ERROR:  tuple concurrently deleted

when executed concurrently with ANALYZE.

Fixed by modifying RemoveStatisticsById() to acquire the same lock as
ANALYZE. This function is called only by DROP STATISTICS, as ANALYZE
calls RemoveStatisticsDataById() directly.

Reported by Justin Pryzby, fix by me. Backpatch through 12. The code was
like this since it was introduced in 10, but older releases are EOL.

Reported-by: Justin Pryzby
Reviewed-by: Tom Lane
Backpatch-through: 12

Discussion: https://postgr.es/m/ZUuk-8CfbYeq6g_u@pryzbyj2023

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4f8d3c5b5adeb0bdaf7e8d58678725c58b51dcff

Modified Files
--------------
src/backend/commands/statscmds.c | 35 +++++++++++++++++++++++++++--------
1 file changed, 27 insertions(+), 8 deletions(-)



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


end of thread, other threads:[~2023-11-19 20:06 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-11-19 20:05 pgsql: Lock table in DROP STATISTICS Tomas Vondra <tomas.vondra@postgresql.org>
2023-11-19 20:06 pgsql: Lock table in DROP STATISTICS Tomas Vondra <tomas.vondra@postgresql.org>
2023-11-19 20:06 pgsql: Lock table in DROP STATISTICS Tomas Vondra <tomas.vondra@postgresql.org>
2023-11-19 20:06 pgsql: Lock table in DROP STATISTICS Tomas Vondra <tomas.vondra@postgresql.org>
2023-11-19 20:06 pgsql: Lock table in DROP STATISTICS Tomas Vondra <tomas.vondra@postgresql.org>
2023-11-19 20:06 pgsql: Lock table in DROP STATISTICS Tomas Vondra <tomas.vondra@postgresql.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