pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix more issues with dependency handling at swap phase of REINDE 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix more issues with dependency handling at swap phase of REINDE @ 2020-03-05 03:51 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 2+ messages in thread From: Michael Paquier @ 2020-03-05 03:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix more issues with dependency handling at swap phase of REINDEX CONCURRENTLY When canceling a REINDEX CONCURRENTLY operation after swapping is done, a drop of the parent table would leave behind old indexes. This is a consequence of 68ac9cf, which fixed the case of pg_depend bloat when repeating REINDEX CONCURRENTLY on the same relation. In order to take care of the problem without breaking the previous fix, this uses a different strategy, possible even with the exiting set of routines to handle dependency changes. The dependencies of/on the new index are additionally switched to the old one, allowing an old invalid index remaining around because of a cancellation or a failure to use the dependency links of the concurrently-created index. This ensures that dropping any objects the old invalid index depends on also drops the old index automatically. Reported-by: Julien Rouhaud Author: Michael Paquier Reviewed-by: Julien Rouhaud Discussion: https://postgr.es/m/20200227080735.l32fqcauy73lon7o@nol Backpatch-through: 12 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/fbcf0871123b464fef7f957301dcc57377cde9c5 Modified Files -------------- src/backend/catalog/index.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix more issues with dependency handling at swap phase of REINDE @ 2020-03-05 03:51 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 2+ messages in thread From: Michael Paquier @ 2020-03-05 03:51 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix more issues with dependency handling at swap phase of REINDEX CONCURRENTLY When canceling a REINDEX CONCURRENTLY operation after swapping is done, a drop of the parent table would leave behind old indexes. This is a consequence of 68ac9cf, which fixed the case of pg_depend bloat when repeating REINDEX CONCURRENTLY on the same relation. In order to take care of the problem without breaking the previous fix, this uses a different strategy, possible even with the exiting set of routines to handle dependency changes. The dependencies of/on the new index are additionally switched to the old one, allowing an old invalid index remaining around because of a cancellation or a failure to use the dependency links of the concurrently-created index. This ensures that dropping any objects the old invalid index depends on also drops the old index automatically. Reported-by: Julien Rouhaud Author: Michael Paquier Reviewed-by: Julien Rouhaud Discussion: https://postgr.es/m/20200227080735.l32fqcauy73lon7o@nol Backpatch-through: 12 Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/26876127be2cbbb3ecb18bf75c0670bfb1a3d289 Modified Files -------------- src/backend/catalog/index.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-03-05 03:51 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-03-05 03:51 pgsql: Fix more issues with dependency handling at swap phase of REINDE Michael Paquier <michael@paquier.xyz> 2020-03-05 03:51 pgsql: Fix more issues with dependency handling at swap phase of REINDE Michael Paquier <michael@paquier.xyz>
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