pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. 4+ messages / 1 participants [nested] [flat]
* pgsql: Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. @ 2021-10-28 15:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2021-10-28 15:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. Commits fdd965d07 and 3cd9c3b92 tested CREATE INDEX CONCURRENTLY by launching two separate pgbench runs concurrently. This was needed so that only a single client thread would run CREATE INDEX CONCURRENTLY, avoiding deadlock between two CICs. However, there's a better way, which is to use an advisory lock to prevent concurrent CICs. That's better in part because the test code is shorter and more readable, but mostly because it automatically scales things to launch an appropriate number of CICs relative to the number of INSERT transactions. As committed, typically half to three-quarters of the CIC transactions were pointless because the INSERT transactions had already stopped. In passing, remove background_pgbench, which was added to support these tests and isn't needed anymore. We can always put it back if we find a use for it later. Back-patch to v12; older pgbench versions lack the conditional-execution features needed for this method. Tom Lane and Andrey Borodin Discussion: https://postgr.es/m/139687.1635277318@sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/7f580aa5d88a9b03d66fcb9a1d7c4fcd69d9e126 Modified Files -------------- contrib/amcheck/t/002_cic.pl | 48 ++++++++++------------------- contrib/amcheck/t/003_cic_2pc.pl | 53 +++++++++++++++----------------- src/test/perl/PostgreSQL/Test/Cluster.pm | 48 ----------------------------- 3 files changed, 41 insertions(+), 108 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. @ 2021-10-28 15:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2021-10-28 15:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. Commits fdd965d07 and 3cd9c3b92 tested CREATE INDEX CONCURRENTLY by launching two separate pgbench runs concurrently. This was needed so that only a single client thread would run CREATE INDEX CONCURRENTLY, avoiding deadlock between two CICs. However, there's a better way, which is to use an advisory lock to prevent concurrent CICs. That's better in part because the test code is shorter and more readable, but mostly because it automatically scales things to launch an appropriate number of CICs relative to the number of INSERT transactions. As committed, typically half to three-quarters of the CIC transactions were pointless because the INSERT transactions had already stopped. In passing, remove background_pgbench, which was added to support these tests and isn't needed anymore. We can always put it back if we find a use for it later. Back-patch to v12; older pgbench versions lack the conditional-execution features needed for this method. Tom Lane and Andrey Borodin Discussion: https://postgr.es/m/139687.1635277318@sss.pgh.pa.us Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/141cd0ef0b0b462a8c6e1ee5ae29c7ae4221b90e Modified Files -------------- contrib/amcheck/t/002_cic.pl | 48 +++++++++++++----------------------- contrib/amcheck/t/003_cic_2pc.pl | 53 ++++++++++++++++++---------------------- src/test/perl/PostgresNode.pm | 49 ------------------------------------- 3 files changed, 41 insertions(+), 109 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. @ 2021-10-28 15:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2021-10-28 15:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. Commits fdd965d07 and 3cd9c3b92 tested CREATE INDEX CONCURRENTLY by launching two separate pgbench runs concurrently. This was needed so that only a single client thread would run CREATE INDEX CONCURRENTLY, avoiding deadlock between two CICs. However, there's a better way, which is to use an advisory lock to prevent concurrent CICs. That's better in part because the test code is shorter and more readable, but mostly because it automatically scales things to launch an appropriate number of CICs relative to the number of INSERT transactions. As committed, typically half to three-quarters of the CIC transactions were pointless because the INSERT transactions had already stopped. In passing, remove background_pgbench, which was added to support these tests and isn't needed anymore. We can always put it back if we find a use for it later. Back-patch to v12; older pgbench versions lack the conditional-execution features needed for this method. Tom Lane and Andrey Borodin Discussion: https://postgr.es/m/139687.1635277318@sss.pgh.pa.us Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5a4b8a8a720ca699c5cbcfc04069dfe089f218c8 Modified Files -------------- contrib/amcheck/t/002_cic.pl | 48 +++++++++++++----------------------- contrib/amcheck/t/003_cic_2pc.pl | 53 ++++++++++++++++++---------------------- src/test/perl/PostgresNode.pm | 49 ------------------------------------- 3 files changed, 41 insertions(+), 109 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
* pgsql: Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. @ 2021-10-28 15:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 4+ messages in thread From: Tom Lane @ 2021-10-28 15:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. Commits fdd965d07 and 3cd9c3b92 tested CREATE INDEX CONCURRENTLY by launching two separate pgbench runs concurrently. This was needed so that only a single client thread would run CREATE INDEX CONCURRENTLY, avoiding deadlock between two CICs. However, there's a better way, which is to use an advisory lock to prevent concurrent CICs. That's better in part because the test code is shorter and more readable, but mostly because it automatically scales things to launch an appropriate number of CICs relative to the number of INSERT transactions. As committed, typically half to three-quarters of the CIC transactions were pointless because the INSERT transactions had already stopped. In passing, remove background_pgbench, which was added to support these tests and isn't needed anymore. We can always put it back if we find a use for it later. Back-patch to v12; older pgbench versions lack the conditional-execution features needed for this method. Tom Lane and Andrey Borodin Discussion: https://postgr.es/m/139687.1635277318@sss.pgh.pa.us Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b1f943d2aa7eba9d7f0f11d3ba66c92f814cca78 Modified Files -------------- contrib/amcheck/t/002_cic.pl | 48 +++++++++++++----------------------- contrib/amcheck/t/003_cic_2pc.pl | 53 ++++++++++++++++++---------------------- src/test/perl/PostgresNode.pm | 48 ------------------------------------ 3 files changed, 41 insertions(+), 108 deletions(-) ^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2021-10-28 15:45 UTC | newest] Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-10-28 15:45 pgsql: Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. Tom Lane <tgl@sss.pgh.pa.us> 2021-10-28 15:45 pgsql: Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. Tom Lane <tgl@sss.pgh.pa.us> 2021-10-28 15:45 pgsql: Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. Tom Lane <tgl@sss.pgh.pa.us> 2021-10-28 15:45 pgsql: Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY. 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