Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mu3DC-0002xs-13 for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Dec 2021 01:54:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mu3Ce-0005pw-KZ for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Dec 2021 01:54:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mu3Cd-0005pn-ND for pgsql-bugs@lists.postgresql.org; Mon, 06 Dec 2021 01:54:04 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mu3CU-0003wz-6p for pgsql-bugs@lists.postgresql.org; Mon, 06 Dec 2021 01:54:03 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id CA2E55C00AE; Sun, 5 Dec 2021 20:53:51 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 05 Dec 2021 20:53:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=AF03x4xdj+2EY8gyQg/VWIHZlzq D/44AfeociMqxiQs=; b=RvQ5iNZOTRRpaLg/ntpMhCBScF6FO9sD1Z/+hFCbjZZ NsgLa5nyjPozSEI/rvVVqOfJeKoysQkiSI+GXE3oBOxtJTk0SDJjGo54bG8iLBth qqGlb0ziw4Y9mZoIiyo83aX6nCLfG3nJYAQv7OXX0eLVkGzux6z8e/1bk0twe12E jnRbV2PCVdfiw22j/I8qaJ296QNeD3prjNwFbWbBl/Rekl9XUpfTxlDHrdr7+XxD JySCcxdwjgXohZsgT8yYNk3vakBdhRAhM8vGekOqZMiXDEBUkgRNMLtd202Q1fAi hpqHLc9wt32SqH/WLAEk+jpBOVRNP8mEfNpb0+zc9Hw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=AF03x4 xdj+2EY8gyQg/VWIHZlzqD/44AfeociMqxiQs=; b=BjbAp6l1mV/5exEfJc2oiQ u/rEhNUGbCIYmGiVcZqrjjwS/JIs1HZKvFLwbAzwXmpowgd1LF2CKwPdyvRRENnE wAD/e2WS6GBz/LFO9PIpmt0CqBB8wyBIyDSlmrQQ6azysUYC4Yb2WHhciP8rZ2ip Ue1M+gwC9UgDGqsWejWJ9SeIx7J69b+0/ApOvePhASDlAfTa3JZ0IQ038NjFvG/5 ZlntIz09KlTz54bBQR0s55LvzveBaQonKWYeJuqA3seDN6Tj2X36Jahn0StC+git yQA8+woUxKFyppwqRaPcZotqHGZ0UxYWwmyZU1m5hEo/p2ii3n6OF0QHzXvs3ohQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrjedvgdeflecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvdegudeuhfdtueeltedtveejheeh ieevueeigeelteegleejleeiueeiheegvefhnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 5 Dec 2021 20:53:48 -0500 (EST) Date: Mon, 6 Dec 2021 10:53:45 +0900 From: Michael Paquier To: Noah Misch Cc: Andres Freund , Alexey Ermakov , Robert Haas , Maxim Boguk , PostgreSQL mailing lists , Peter Geoghegan Subject: Re: BUG #17268: Possible corruption in toast index after reindex index concurrently Message-ID: References: <20211108203641.whpia3pzjofellf4@alap3.anarazel.de> <20211109035624.GA940092@rfd.leadboat.com> <20211109050848.oe3u6mhtomkaoxrx@alap3.anarazel.de> <20211109054625.GB940092@rfd.leadboat.com> <20211109063119.ukcvdk7uvz7ks3pa@alap3.anarazel.de> <20211109064217.GC940092@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iurcbQF1jI1boZtN" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --iurcbQF1jI1boZtN Content-Type: multipart/mixed; boundary="DJ+Ud3u8cyeBifzr" Content-Disposition: inline --DJ+Ud3u8cyeBifzr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 15, 2021 at 08:03:04PM +0900, Michael Paquier wrote: > After more testing, I have been able to extract and write an isolation > test that is able to reproduce the failure. It relies on a trick as > the toast relation names are not deterministic, and we cannot use > REINDEX CONCURRENTLY in a function context. So I have used an ALTER > TABLE/INDEX RENAME with a DO block to change the toast relation > names with allow_system_table_mods instead. There is no need either > for amcheck with this method. >=20 > 2) is enough to fix the problem, and I'd like to think that we had > better stick with only this method for simplicity's sake. I have been working on this one again for the last couple of days, and I would still go with the simple solution, releasing the row-level toast locks only at the end of the transaction when saving and deleting a toast value. While testing, I have noticed that the deletion part is also important, as a REINDEX CONCURRENTLY run in parallel of a transaction removing a toast value would go through without that, rather than waiting for the transaction doing the deletion to commit first. I have expanded the tests with everything I could think about, so I'd like to commit the attached. The test is fancy with its use of allow_system_table_mods to make the toast relation names reliable, but it has been really useful. -- Michael --DJ+Ud3u8cyeBifzr Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v2-0001-Fix-locking-of-toast-relations-with-REINDEX-CONC.patch" Content-Transfer-Encoding: quoted-printable =46rom b157e1bcc43a615c02b6e6fe23ae75da58a777b4 Mon Sep 17 00:00:00 2001 =46rom: Michael Paquier Date: Mon, 6 Dec 2021 10:52:01 +0900 Subject: [PATCH v2] Fix locking of toast relations with REINDEX CONC --- src/backend/access/common/toast_internals.c | 8 +- .../expected/reindex-concurrently-toast.out | 775 ++++++++++++++++++ src/test/isolation/isolation_schedule | 1 + .../specs/reindex-concurrently-toast.spec | 119 +++ 4 files changed, 899 insertions(+), 4 deletions(-) create mode 100644 src/test/isolation/expected/reindex-concurrently-toast.= out create mode 100644 src/test/isolation/specs/reindex-concurrently-toast.spec diff --git a/src/backend/access/common/toast_internals.c b/src/backend/acce= ss/common/toast_internals.c index c7b9ade574..000d490a53 100644 --- a/src/backend/access/common/toast_internals.c +++ b/src/backend/access/common/toast_internals.c @@ -361,8 +361,8 @@ toast_save_datum(Relation rel, Datum value, /* * Done - close toast relation and its indexes */ - toast_close_indexes(toastidxs, num_indexes, RowExclusiveLock); - table_close(toastrel, RowExclusiveLock); + toast_close_indexes(toastidxs, num_indexes, NoLock); + table_close(toastrel, NoLock); =20 /* * Create the TOAST pointer value that we'll return @@ -442,8 +442,8 @@ toast_delete_datum(Relation rel, Datum value, bool is_s= peculative) * End scan and close relations */ systable_endscan_ordered(toastscan); - toast_close_indexes(toastidxs, num_indexes, RowExclusiveLock); - table_close(toastrel, RowExclusiveLock); + toast_close_indexes(toastidxs, num_indexes, NoLock); + table_close(toastrel, NoLock); } =20 /* ---------- diff --git a/src/test/isolation/expected/reindex-concurrently-toast.out b/s= rc/test/isolation/expected/reindex-concurrently-toast.out new file mode 100644 index 0000000000..a6f1edc0ed --- /dev/null +++ b/src/test/isolation/expected/reindex-concurrently-toast.out @@ -0,0 +1,775 @@ +Parsed test spec with 2 sessions + +starting permutation: lrex1 ins1 retab2 end1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step ins1: INSERT INTO reind_con_wide SELECT 3, repeat('3', 11) || string_= agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i); +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step end1: COMMIT; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 + 3|3333333333 +(3 rows) + + +starting permutation: lrex1 ins1 reind2 end1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step ins1: INSERT INTO reind_con_wide SELECT 3, repeat('3', 11) || string_= agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i); +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step end1: COMMIT; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 + 3|3333333333 +(3 rows) + + +starting permutation: lrex1 upd1 retab2 end1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step upd1: UPDATE reind_con_wide SET data =3D (SELECT repeat('4', 11) || s= tring_agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i= )) WHERE id =3D 1; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step end1: COMMIT; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|4444444444 + 2|2222222222 +(2 rows) + + +starting permutation: lrex1 upd1 reind2 end1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step upd1: UPDATE reind_con_wide SET data =3D (SELECT repeat('4', 11) || s= tring_agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i= )) WHERE id =3D 1; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step end1: COMMIT; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|4444444444 + 2|2222222222 +(2 rows) + + +starting permutation: lrex1 del1 retab2 end1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step del1: DELETE FROM reind_con_wide WHERE id =3D 2; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step end1: COMMIT; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 +(1 row) + + +starting permutation: lrex1 del1 reind2 end1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step del1: DELETE FROM reind_con_wide WHERE id =3D 2; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step end1: COMMIT; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 +(1 row) + + +starting permutation: lrex1 dro1 retab2 end1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step dro1: DROP TABLE reind_con_wide; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step end1: COMMIT; +step retab2: <... completed> +ERROR: relation "pg_toast.reind_con_toast" does not exist +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +ERROR: relation "reind_con_wide" does not exist + +starting permutation: lrex1 dro1 reind2 end1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step dro1: DROP TABLE reind_con_wide; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step end1: COMMIT; +step reind2: <... completed> +ERROR: relation "pg_toast.reind_con_toast_idx" does not exist +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +ERROR: relation "reind_con_wide" does not exist + +starting permutation: lrex1 retab2 dro1 end1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step dro1: DROP TABLE reind_con_wide; +step end1: COMMIT; +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +ERROR: relation "reind_con_wide" does not exist + +starting permutation: lrex1 reind2 dro1 end1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step dro1: DROP TABLE reind_con_wide; +step end1: COMMIT; +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +ERROR: relation "reind_con_wide" does not exist + +starting permutation: lsha1 ins1 retab2 end1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step ins1: INSERT INTO reind_con_wide SELECT 3, repeat('3', 11) || string_= agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i); +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step end1: COMMIT; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 + 3|3333333333 +(3 rows) + + +starting permutation: lsha1 ins1 reind2 end1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step ins1: INSERT INTO reind_con_wide SELECT 3, repeat('3', 11) || string_= agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i); +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step end1: COMMIT; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 + 3|3333333333 +(3 rows) + + +starting permutation: lsha1 upd1 retab2 end1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step upd1: UPDATE reind_con_wide SET data =3D (SELECT repeat('4', 11) || s= tring_agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i= )) WHERE id =3D 1; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step end1: COMMIT; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|4444444444 + 2|2222222222 +(2 rows) + + +starting permutation: lsha1 upd1 reind2 end1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step upd1: UPDATE reind_con_wide SET data =3D (SELECT repeat('4', 11) || s= tring_agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i= )) WHERE id =3D 1; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step end1: COMMIT; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|4444444444 + 2|2222222222 +(2 rows) + + +starting permutation: lsha1 del1 retab2 end1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step del1: DELETE FROM reind_con_wide WHERE id =3D 2; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step end1: COMMIT; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 +(1 row) + + +starting permutation: lsha1 del1 reind2 end1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step del1: DELETE FROM reind_con_wide WHERE id =3D 2; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step end1: COMMIT; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 +(1 row) + + +starting permutation: lsha1 dro1 retab2 end1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step dro1: DROP TABLE reind_con_wide; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step end1: COMMIT; +step retab2: <... completed> +ERROR: relation "pg_toast.reind_con_toast" does not exist +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +ERROR: relation "reind_con_wide" does not exist + +starting permutation: lsha1 dro1 reind2 end1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step dro1: DROP TABLE reind_con_wide; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step end1: COMMIT; +step reind2: <... completed> +ERROR: relation "pg_toast.reind_con_toast_idx" does not exist +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +ERROR: relation "reind_con_wide" does not exist + +starting permutation: lsha1 retab2 dro1 end1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step dro1: DROP TABLE reind_con_wide; +step end1: COMMIT; +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +ERROR: relation "reind_con_wide" does not exist + +starting permutation: lsha1 reind2 dro1 end1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step dro1: DROP TABLE reind_con_wide; +step end1: COMMIT; +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +ERROR: relation "reind_con_wide" does not exist + +starting permutation: lexc1 ins1 retab2 end1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step ins1: INSERT INTO reind_con_wide SELECT 3, repeat('3', 11) || string_= agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i); +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step end1: COMMIT; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 + 3|3333333333 +(3 rows) + + +starting permutation: lexc1 ins1 reind2 end1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step ins1: INSERT INTO reind_con_wide SELECT 3, repeat('3', 11) || string_= agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i); +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step end1: COMMIT; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 + 3|3333333333 +(3 rows) + + +starting permutation: lexc1 upd1 retab2 end1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step upd1: UPDATE reind_con_wide SET data =3D (SELECT repeat('4', 11) || s= tring_agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i= )) WHERE id =3D 1; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step end1: COMMIT; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|4444444444 + 2|2222222222 +(2 rows) + + +starting permutation: lexc1 upd1 reind2 end1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step upd1: UPDATE reind_con_wide SET data =3D (SELECT repeat('4', 11) || s= tring_agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i= )) WHERE id =3D 1; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step end1: COMMIT; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|4444444444 + 2|2222222222 +(2 rows) + + +starting permutation: lexc1 del1 retab2 end1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step del1: DELETE FROM reind_con_wide WHERE id =3D 2; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step end1: COMMIT; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 +(1 row) + + +starting permutation: lexc1 del1 reind2 end1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step del1: DELETE FROM reind_con_wide WHERE id =3D 2; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step end1: COMMIT; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 +(1 row) + + +starting permutation: lexc1 dro1 retab2 end1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step dro1: DROP TABLE reind_con_wide; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step end1: COMMIT; +step retab2: <... completed> +ERROR: relation "pg_toast.reind_con_toast" does not exist +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +ERROR: relation "reind_con_wide" does not exist + +starting permutation: lexc1 dro1 reind2 end1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step dro1: DROP TABLE reind_con_wide; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step end1: COMMIT; +step reind2: <... completed> +ERROR: relation "pg_toast.reind_con_toast_idx" does not exist +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +ERROR: relation "reind_con_wide" does not exist + +starting permutation: lexc1 retab2 dro1 end1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step dro1: DROP TABLE reind_con_wide; +step end1: COMMIT; +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +ERROR: relation "reind_con_wide" does not exist + +starting permutation: lexc1 reind2 dro1 end1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step dro1: DROP TABLE reind_con_wide; +step end1: COMMIT; +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +ERROR: relation "reind_con_wide" does not exist + +starting permutation: lrex1 ins1 retab2 rol1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step ins1: INSERT INTO reind_con_wide SELECT 3, repeat('3', 11) || string_= agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i); +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step rol1: ROLLBACK; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lrex1 ins1 reind2 rol1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step ins1: INSERT INTO reind_con_wide SELECT 3, repeat('3', 11) || string_= agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i); +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step rol1: ROLLBACK; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lrex1 upd1 retab2 rol1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step upd1: UPDATE reind_con_wide SET data =3D (SELECT repeat('4', 11) || s= tring_agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i= )) WHERE id =3D 1; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step rol1: ROLLBACK; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lrex1 upd1 reind2 rol1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step upd1: UPDATE reind_con_wide SET data =3D (SELECT repeat('4', 11) || s= tring_agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i= )) WHERE id =3D 1; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step rol1: ROLLBACK; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lrex1 del1 retab2 rol1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step del1: DELETE FROM reind_con_wide WHERE id =3D 2; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step rol1: ROLLBACK; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lrex1 del1 reind2 rol1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step del1: DELETE FROM reind_con_wide WHERE id =3D 2; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step rol1: ROLLBACK; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lrex1 dro1 retab2 rol1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step dro1: DROP TABLE reind_con_wide; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step rol1: ROLLBACK; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lrex1 dro1 reind2 rol1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step dro1: DROP TABLE reind_con_wide; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step rol1: ROLLBACK; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lrex1 retab2 dro1 rol1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step dro1: DROP TABLE reind_con_wide; +step rol1: ROLLBACK; +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lrex1 reind2 dro1 rol1 sel2 +step lrex1: lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step dro1: DROP TABLE reind_con_wide; +step rol1: ROLLBACK; +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lsha1 ins1 retab2 rol1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step ins1: INSERT INTO reind_con_wide SELECT 3, repeat('3', 11) || string_= agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i); +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step rol1: ROLLBACK; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lsha1 ins1 reind2 rol1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step ins1: INSERT INTO reind_con_wide SELECT 3, repeat('3', 11) || string_= agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i); +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step rol1: ROLLBACK; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lsha1 upd1 retab2 rol1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step upd1: UPDATE reind_con_wide SET data =3D (SELECT repeat('4', 11) || s= tring_agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i= )) WHERE id =3D 1; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step rol1: ROLLBACK; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lsha1 upd1 reind2 rol1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step upd1: UPDATE reind_con_wide SET data =3D (SELECT repeat('4', 11) || s= tring_agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i= )) WHERE id =3D 1; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step rol1: ROLLBACK; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lsha1 del1 retab2 rol1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step del1: DELETE FROM reind_con_wide WHERE id =3D 2; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step rol1: ROLLBACK; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lsha1 del1 reind2 rol1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step del1: DELETE FROM reind_con_wide WHERE id =3D 2; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step rol1: ROLLBACK; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lsha1 dro1 retab2 rol1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step dro1: DROP TABLE reind_con_wide; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step rol1: ROLLBACK; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lsha1 dro1 reind2 rol1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step dro1: DROP TABLE reind_con_wide; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step rol1: ROLLBACK; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lsha1 retab2 dro1 rol1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step dro1: DROP TABLE reind_con_wide; +step rol1: ROLLBACK; +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lsha1 reind2 dro1 rol1 sel2 +step lsha1: lock TABLE reind_con_wide in SHARE MODE; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step dro1: DROP TABLE reind_con_wide; +step rol1: ROLLBACK; +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lexc1 ins1 retab2 rol1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step ins1: INSERT INTO reind_con_wide SELECT 3, repeat('3', 11) || string_= agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i); +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step rol1: ROLLBACK; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lexc1 ins1 reind2 rol1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step ins1: INSERT INTO reind_con_wide SELECT 3, repeat('3', 11) || string_= agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i); +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step rol1: ROLLBACK; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lexc1 upd1 retab2 rol1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step upd1: UPDATE reind_con_wide SET data =3D (SELECT repeat('4', 11) || s= tring_agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i= )) WHERE id =3D 1; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step rol1: ROLLBACK; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lexc1 upd1 reind2 rol1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step upd1: UPDATE reind_con_wide SET data =3D (SELECT repeat('4', 11) || s= tring_agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i= )) WHERE id =3D 1; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step rol1: ROLLBACK; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lexc1 del1 retab2 rol1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step del1: DELETE FROM reind_con_wide WHERE id =3D 2; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step rol1: ROLLBACK; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lexc1 del1 reind2 rol1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step del1: DELETE FROM reind_con_wide WHERE id =3D 2; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step rol1: ROLLBACK; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lexc1 dro1 retab2 rol1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step dro1: DROP TABLE reind_con_wide; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step rol1: ROLLBACK; +step retab2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lexc1 dro1 reind2 rol1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step dro1: DROP TABLE reind_con_wide; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step rol1: ROLLBACK; +step reind2: <... completed> +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lexc1 retab2 dro1 rol1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step retab2: REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; +step dro1: DROP TABLE reind_con_wide; +step rol1: ROLLBACK; +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + + +starting permutation: lexc1 reind2 dro1 rol1 sel2 +step lexc1: lock TABLE reind_con_wide in EXCLUSIVE MODE; +step reind2: REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; +step dro1: DROP TABLE reind_con_wide; +step rol1: ROLLBACK; +step sel2: SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id; +id| substr +--+---------- + 1|1111111111 + 2|2222222222 +(2 rows) + diff --git a/src/test/isolation/isolation_schedule b/src/test/isolation/iso= lation_schedule index f4c01006fc..99c23b16ff 100644 --- a/src/test/isolation/isolation_schedule +++ b/src/test/isolation/isolation_schedule @@ -53,6 +53,7 @@ test: lock-committed-update test: lock-committed-keyupdate test: update-locked-tuple test: reindex-concurrently +test: reindex-concurrently-toast test: reindex-schema test: propagate-lock-delete test: tuplelock-conflict diff --git a/src/test/isolation/specs/reindex-concurrently-toast.spec b/src= /test/isolation/specs/reindex-concurrently-toast.spec new file mode 100644 index 0000000000..81887922d2 --- /dev/null +++ b/src/test/isolation/specs/reindex-concurrently-toast.spec @@ -0,0 +1,119 @@ +# REINDEX CONCURRENTLY with toast relations +# +# Ensure that concurrent operations work correctly when a REINDEX is perfo= rmed +# concurrently on toast relations. Toast relation names are not determini= stic, +# so this abuses of allow_system_table_mods to change the names of toast +# tables and its indexes so as they can be executed with REINDEX CONCURREN= TLY, +# which cannot be launched in a transaction context. + +# Create a table, with deterministic names for its toast relation and inde= xes. +# Fortunately ALTER TABLE is transactional, making the renaming of toast +# relations possible with allow_system_table_mods. +setup +{ + CREATE TABLE reind_con_wide(id int primary key, data text); + INSERT INTO reind_con_wide + SELECT 1, repeat('1', 11) || string_agg(g.i::text || random()::text,= '') FROM generate_series(1, 500) g(i); + INSERT INTO reind_con_wide + SELECT 2, repeat('2', 11) || string_agg(g.i::text || random()::text,= '') FROM generate_series(1, 500) g(i); + SET allow_system_table_mods TO true; + DO $$DECLARE r record; + BEGIN + SELECT INTO r reltoastrelid::regclass::text AS table_name FROM pg_cl= ass + WHERE oid =3D 'reind_con_wide'::regclass; + EXECUTE 'ALTER TABLE ' || r.table_name || ' RENAME TO reind_con_toas= t;'; + SELECT INTO r indexrelid::regclass::text AS index_name FROM pg_index + WHERE indrelid =3D (SELECT oid FROM pg_class where relname =3D 're= ind_con_toast'); + EXECUTE 'ALTER INDEX ' || r.index_name || ' RENAME TO reind_con_toas= t_idx;'; + END$$; +} + +teardown +{ + DROP TABLE IF EXISTS reind_con_wide; +} + +session s1 +setup { BEGIN; } +step lrex1 { lock TABLE reind_con_wide in ROW EXCLUSIVE MODE; } +step lsha1 { lock TABLE reind_con_wide in SHARE MODE; } +step lexc1 { lock TABLE reind_con_wide in EXCLUSIVE MODE; } +step ins1 { INSERT INTO reind_con_wide SELECT 3, repeat('3', 11) || string= _agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(i); } +step upd1 { UPDATE reind_con_wide SET data =3D (SELECT repeat('4', 11) || = string_agg(g.i::text || random()::text, '') FROM generate_series(1, 500) g(= i)) WHERE id =3D 1; } +step del1 { DELETE FROM reind_con_wide WHERE id =3D 2; } +step dro1 { DROP TABLE reind_con_wide; } +step end1 { COMMIT; } +step rol1 { ROLLBACK; } + +session s2 +step retab2 { REINDEX TABLE CONCURRENTLY pg_toast.reind_con_toast; } +step reind2 { REINDEX INDEX CONCURRENTLY pg_toast.reind_con_toast_idx; } +step sel2 { SELECT id, substr(data, 1, 10) FROM reind_con_wide ORDER BY id= ; } + +# Transaction commit with ROW EXCLUSIVE MODE +permutation lrex1 ins1 retab2 end1 sel2 +permutation lrex1 ins1 reind2 end1 sel2 +permutation lrex1 upd1 retab2 end1 sel2 +permutation lrex1 upd1 reind2 end1 sel2 +permutation lrex1 del1 retab2 end1 sel2 +permutation lrex1 del1 reind2 end1 sel2 +permutation lrex1 dro1 retab2 end1 sel2 +permutation lrex1 dro1 reind2 end1 sel2 +permutation lrex1 retab2 dro1 end1 sel2 +permutation lrex1 reind2 dro1 end1 sel2 +# Transaction commit with SHARE MODE +permutation lsha1 ins1 retab2 end1 sel2 +permutation lsha1 ins1 reind2 end1 sel2 +permutation lsha1 upd1 retab2 end1 sel2 +permutation lsha1 upd1 reind2 end1 sel2 +permutation lsha1 del1 retab2 end1 sel2 +permutation lsha1 del1 reind2 end1 sel2 +permutation lsha1 dro1 retab2 end1 sel2 +permutation lsha1 dro1 reind2 end1 sel2 +permutation lsha1 retab2 dro1 end1 sel2 +permutation lsha1 reind2 dro1 end1 sel2 +# Transaction commit with EXCLUSIVE MODE +permutation lexc1 ins1 retab2 end1 sel2 +permutation lexc1 ins1 reind2 end1 sel2 +permutation lexc1 upd1 retab2 end1 sel2 +permutation lexc1 upd1 reind2 end1 sel2 +permutation lexc1 del1 retab2 end1 sel2 +permutation lexc1 del1 reind2 end1 sel2 +permutation lexc1 dro1 retab2 end1 sel2 +permutation lexc1 dro1 reind2 end1 sel2 +permutation lexc1 retab2 dro1 end1 sel2 +permutation lexc1 reind2 dro1 end1 sel2 + +# Transaction rollback with ROW EXCLUSIVE MODE +permutation lrex1 ins1 retab2 rol1 sel2 +permutation lrex1 ins1 reind2 rol1 sel2 +permutation lrex1 upd1 retab2 rol1 sel2 +permutation lrex1 upd1 reind2 rol1 sel2 +permutation lrex1 del1 retab2 rol1 sel2 +permutation lrex1 del1 reind2 rol1 sel2 +permutation lrex1 dro1 retab2 rol1 sel2 +permutation lrex1 dro1 reind2 rol1 sel2 +permutation lrex1 retab2 dro1 rol1 sel2 +permutation lrex1 reind2 dro1 rol1 sel2 +# Transaction rollback with SHARE MODE +permutation lsha1 ins1 retab2 rol1 sel2 +permutation lsha1 ins1 reind2 rol1 sel2 +permutation lsha1 upd1 retab2 rol1 sel2 +permutation lsha1 upd1 reind2 rol1 sel2 +permutation lsha1 del1 retab2 rol1 sel2 +permutation lsha1 del1 reind2 rol1 sel2 +permutation lsha1 dro1 retab2 rol1 sel2 +permutation lsha1 dro1 reind2 rol1 sel2 +permutation lsha1 retab2 dro1 rol1 sel2 +permutation lsha1 reind2 dro1 rol1 sel2 +# Transaction rollback with EXCLUSIVE MODE +permutation lexc1 ins1 retab2 rol1 sel2 +permutation lexc1 ins1 reind2 rol1 sel2 +permutation lexc1 upd1 retab2 rol1 sel2 +permutation lexc1 upd1 reind2 rol1 sel2 +permutation lexc1 del1 retab2 rol1 sel2 +permutation lexc1 del1 reind2 rol1 sel2 +permutation lexc1 dro1 retab2 rol1 sel2 +permutation lexc1 dro1 reind2 rol1 sel2 +permutation lexc1 retab2 dro1 rol1 sel2 +permutation lexc1 reind2 dro1 rol1 sel2 --=20 2.34.1 --DJ+Ud3u8cyeBifzr-- --iurcbQF1jI1boZtN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmGtbSkACgkQnvQgOdby QH0oOg/+MR/iW6Y4weoMHgylQzjktRK7PQwzn+jpzjjcYHCjuuF/9YbycHUdUSkJ uFne8JgfQ7BkP7D1Dt0nRX6hht6zP44SrliKufgDqD1PpYtkbflU7gqqIw4IJwsQ VelzWMWOewlWuY69jeMfm+p3g2j44OCHbYSVgBxVOGgqWoD+dU0uAxex3F4KtxNI CXmNsX2Tezrgct/VLcSMNM9NIueSfW9alRpQ9FO/K3VrkF4mw7q9V2KzLHwZhShQ 2WROqjl3Taedqls6dKgELc4qoseS1hb5q8amNWClvTHswPNoJXrRLD/rhipUEq5B HQqvYTLMqVsisTOJcZFWmoLI4VIebRrHOsAbKqMURVBqNeI3CdALtJR9rby59Ekm FYrivID7f+ehi46r/cS0F7xBd0oMiGUiHksotB7QLANj2qQN5mXmzHRvEr309qpX 3vmuWx2EGa89nBwwGW1+SRh0h96JN7XglPVgiV3prmycYxpaKWeTnvQiuUzkQ/6A 0lRZTfUunmyxiZbXUC90lAKaxs7bt1r6mUk8fsCZGXHy4phK9Kpp3isOEf7jcBHk MdGIuh0D5QLIwTuED0+jUN0ry25DP6DgaIEncA7GzjcYyxH7rUhd1I7oqlRgWC2f cgs6MqV1rcwKjPvanxcJ6L4wI7Pfso3aJdt4SL64JhoYv9ilzvI= =THpr -----END PGP SIGNATURE----- --iurcbQF1jI1boZtN--