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 1mfMlK-000464-5x for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Oct 2021 13:45:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mfMlI-0007oc-Ue for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Oct 2021 13:45:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mfMlI-0007oS-Ff for pgsql-bugs@lists.postgresql.org; Tue, 26 Oct 2021 13:45:08 +0000 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mfMlF-0003KQ-9e for pgsql-bugs@lists.postgresql.org; Tue, 26 Oct 2021 13:45:07 +0000 Received: by mail-ot1-x335.google.com with SMTP id d21-20020a9d4f15000000b0054e677e0ac5so19791966otl.11 for ; Tue, 26 Oct 2021 06:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=c0AQKWc/B++GTiv4sfN9tHRVpirlJYNssmWM5oOo18Y=; b=TBvvzI5bHsLLzLb5mtKnXrmowUDKGQzxJSSIPa90D/UQCJINhDmfA5LSONcmndiDVs a3iCWOfkJyl6NWITnWYFQB2983wySbofZ7G9kdxTKMZOVKHphvvbqP2gY8MP6fhk5B0S wdP+Tjr3WLlKVd1WmjkZU4e8mb5pkkZ7jgUFE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=c0AQKWc/B++GTiv4sfN9tHRVpirlJYNssmWM5oOo18Y=; b=jfuCQXUyxPG8dlsFDdM1ZMI7SHGv5UZinZvDV0mBQAgaqXuUEQf4Qf8pgdMGnZ6dDe /LYW8BDWGMpqKvc6V1NLEfS1TV68pSRq2JHiCcv6SDWptIbjtYTD3KJUHCPkxZDlTUuR /05cpLamgYgr3gcOmF7sQO9o9tgT5VYNwy9DlMnDcQTlGcL+kDPA65o6unyo0wXQVg6L DyXvugtqnD4RuQX5o1KFBKvSE66G5DUtHLYjrMte/gspbJi22CSrF3HVCTAF5R8Zgeqr hQ5ohZhvEwrllo9glfLzwOtfbD9f7HKLGd4qSIqeKKu2qusB3Jp38sMgeOyoEbKWXIQ8 F+LA== X-Gm-Message-State: AOAM530lJD2Akc/KlHmCyloYhmlCo/dmg9G+Ckkx90Ggio+UYQR/o0eA Q/sfxq0tT1rtTTVJjP52nofAXQ== X-Google-Smtp-Source: ABdhPJwqc008cKWOItRHl/P4eyjt12w011Y0UXHHBpLaNQDxT8H7RCnyn0RLq6d5eRcXFR0yQdcmsA== X-Received: by 2002:a05:6830:225c:: with SMTP id t28mr19447101otd.295.1635255904531; Tue, 26 Oct 2021 06:45:04 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::46]) by smtp.gmail.com with ESMTPSA id l2sm4497170otl.61.2021.10.26.06.45.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Oct 2021 06:45:03 -0700 (PDT) Date: Tue, 26 Oct 2021 06:45:00 -0700 From: Noah Misch To: Tom Lane Cc: Andrey Borodin , PostgreSQL mailing lists , Michael Paquier , Peter Geoghegan , Andres Freund Subject: Re: conchuela timeouts since 2021-10-09 system upgrade Message-ID: <20211026134500.GA128912@rfd.leadboat.com> References: <20211019030212.GB3403374@rfd.leadboat.com> <20211024050028.GA3310519@rfd.leadboat.com> <64835CF9-D9AA-49BF-A685-01C23B1023C1@yandex-team.ru> <20211024161942.GB3945842@rfd.leadboat.com> <640FA6DC-A998-4499-B3B4-2773685B8C56@yandex-team.ru> <3792312.1635119599@sss.pgh.pa.us> <4170532.1635195582@sss.pgh.pa.us> <20211026015157.GA113335@rfd.leadboat.com> <52098.1635228234@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52098.1635228234@sss.pgh.pa.us> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Oct 26, 2021 at 02:03:54AM -0400, Tom Lane wrote: > Noah Misch 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.