Re: conchuela timeouts since 2021-10-09 system upgrade
Noah Misch <noah@leadboat.com>
From: Noah Misch <noah@leadboat.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrey Borodin <x4mmm@yandex-team.ru>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>, Michael Paquier <michael@paquier.xyz>, Peter Geoghegan <pg@bowt.ie>, Andres Freund <andres@anarazel.de>
Date: 2021-10-26T13:45:00Z
Lists: pgsql-bugs
On Tue, Oct 26, 2021 at 02:03:54AM -0400, Tom Lane wrote:
> Noah Misch <noah@leadboat.com> writes:
> > On Mon, Oct 25, 2021 at 04:59:42PM -0400, Tom Lane wrote:
> >> What I think we should do in these two tests is nuke the use of
> >> background_pgbench entirely; that looks like a solution in search
> >> of a problem, and it seems unnecessary here. Why not run
> >> the DROP/CREATE/bt_index_check transaction as one of three script
> >> options in the main pgbench run?
>
> > The author tried that and got deadlocks:
> > https://postgr.es/m/5E041A70-4946-489C-9B6D-764DF627A92D@yandex-team.ru
>
> Hmm, I guess that's because two concurrent CICs can deadlock against each
> other. I wonder if we could fix that ... or maybe we could teach pgbench
> that it mustn't launch more than one instance of that script?
Both sound doable, but I don't expect either to fix prairiedog's trouble.
> Or more
> practically, use advisory locks in that script to enforce that only one
> runs at once.
The author did try that.
> So what we have is that libpq thinks it's sent the next DROP INDEX,
> but the backend hasn't seen it.
Thanks for isolating that.
> It's fairly hard to blame that state of affairs on the IPC::Run harness.
> I'm wondering if we might be looking at some timing-dependent corner-case
> bug in the new libpq pipelining code. Pipelining isn't enabled:
>
> pipelineStatus = PQ_PIPELINE_OFF,
>
> but that doesn't mean that the pipelining code hasn't been anywhere
> near this command. I can see
>
> cmd_queue_head = 0x300d40,
> cmd_queue_tail = 0x300d40,
> cmd_queue_recycle = 0x0,
>
> (gdb) p *state->con->cmd_queue_head
> $4 = {
> queryclass = PGQUERY_SIMPLE,
> query = 0x3004e0 "DROP INDEX CONCURRENTLY idx;",
> next = 0x0
> }
>
> The trouble with this theory, of course, is "if libpq is busted, why is
> only this test case showing it?".
Agreed, it's not clear how the new tests would reveal a libpq bug that
src/bin/pgbench/t/001_pgbench_with_server.pl has been unable to reveal. Does
the problem reproduce on v13?
Grasping at straws, background_pgbench does differ by specifying stdin as a
ref to an empty scalar. I think that makes IPC::Run open a pipe and never
write to it. The older pgbench tests don't override stdin, so I think that
makes pgbench inherit the original stdin. Given your pgbench stack trace,
this seems awfully unlikely to be the relevant difference. If we run out of
ideas, you could try some runs with that difference removed:
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -2110,7 +2110,7 @@ sub background_pgbench
# IPC::Run would otherwise append to existing contents:
$$stdout = "" if ref($stdout);
- my $harness = IPC::Run::start \@cmd, '<', \$stdin, '>', $stdout, '2>&1',
+ my $harness = IPC::Run::start \@cmd, '>', $stdout, '2>&1',
$timer;
return $harness;
> But AFAICS it would take some pretty
> spooky action-at-a-distance for the Perl harness to have caused this.
Agreed. We'll have to consider the harness innocent for the moment.
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Improve contrib/amcheck's tests for CREATE INDEX CONCURRENTLY.
- b1f943d2aa7e 14.1 landed
- 7f580aa5d88a 15.0 landed
- 5a4b8a8a720c 13.5 landed
- 141cd0ef0b0b 12.9 landed
-
Fix minor memory leaks in pg_dump.
- 70bef494000e 15.0 cited
-
Avoid race in RelationBuildDesc() affecting CREATE INDEX CONCURRENTLY.
- e428699cb3be 9.6.24 landed
- db86746fd11e 10.19 landed
- 5141e471b36a 11.14 landed
- dde966efb286 14.1 landed
- 2e33b43599ad 13.5 landed
- 0869e53d3a07 12.9 landed
- fdd965d074d4 15.0 landed
-
Fix CREATE INDEX CONCURRENTLY for the newest prepared transactions.
- df6158139f64 11.14 landed
- 560124a37c2f 10.19 landed
- 5184932432b4 9.6.24 landed
- fe5d44a1d38f 12.9 landed
- a9d0a5409415 13.5 landed
- a5b9a0000e14 14.1 landed
- 3cd9c3b92197 15.0 landed
-
Add -w back to the flags for pg_ctl (re)start in PostgresNode
- b33259e261ae 15.0 cited
-
Fix CREATE INDEX CONCURRENTLY for simultaneous prepared transactions.
- 77a0e14f0b21 9.5.25 landed
- d683d6528dba 9.6.21 landed
- 179775135b41 10.16 landed
- d1ab4bf6ed2d 11.11 landed
- be843ce29737 12.6 landed
- 86a5b309c933 13.2 landed
- 8a54e12a38d1 14.0 landed