pgsql: Re-adjust drop-index-concurrently-1 isolation test - Mailing list pgsql-committers

From David Rowley
Subject pgsql: Re-adjust drop-index-concurrently-1 isolation test
Date
Msg-id E1p5wug-003mHt-Fb@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Re-adjust drop-index-concurrently-1 isolation test

It seems that drop-index-concurrently-1 has started to forget what it was
originally meant to be testing.  d2d8a229b, which added incremental sorts
changed the expected plan to be an Index Scan plan instead of a Seq Scan
plan.  This occurred as the primary key index of the table in question
provided presorted input and, because that index happened to be the
cheapest input path due to enable_seqscan being disabled, the incremental
sort changes just added a Sort on top of that.  It seems based on the name
of the PREPAREd statement that the intention here is that the query
produces a seqscan plan.

The reason this test has become broken seems to be due to how the test was
originally coded.  The test was trying to force a seqscan plan by
performing some casting to make it so the test_dc index couldn't be used
to perform the required filtering.  Trying to coax the planner into using
a plan which has costed in a disable_cost seems like it's always going to
be flakey as small changes in costs are drowned out by the large
disable_cost combined with add_path's STD_FUZZ_FACTOR.  Here we get rid of
the casts that we're using to try to trick the planner into a seqscan and
instead toggle enable_seqscan as and when required to get the desired
plan.

Additionally, rename a few things in the test and add some additional
wording to the comments to try and make it more clear in the future what
we expect this test to be doing.

Discussion: https://postgr.es/m/CAApHDvrbDhObhLV+=U_K_-t+2Av2av1aL9d+2j_3AO-XndaviA@mail.gmail.com
Backpatch-through: 13, where d2d8a229b changed the expected test output

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/171d7746a21dfb0e19c008b7a398e1ee1ad7f74e

Modified Files
--------------
.../expected/drop-index-concurrently-1.out         | 31 +++++++++++-----------
.../expected/drop-index-concurrently-1_2.out       | 31 +++++++++++-----------
.../isolation/specs/drop-index-concurrently-1.spec | 22 ++++++++-------
3 files changed, 44 insertions(+), 40 deletions(-)


pgsql-committers by date:

Previous
From: David Rowley
Date:
Subject: pgsql: Re-adjust drop-index-concurrently-1 isolation test
Next
From: David Rowley
Date:
Subject: pgsql: Re-adjust drop-index-concurrently-1 isolation test