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 1mfBdG-0002d4-6p for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Oct 2021 01:52:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mfBdF-0005Wl-46 for pgsql-bugs@arkaria.postgresql.org; Tue, 26 Oct 2021 01:52:05 +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 1mfBdE-0005WO-Kt for pgsql-bugs@lists.postgresql.org; Tue, 26 Oct 2021 01:52:04 +0000 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mfBdC-000643-3i for pgsql-bugs@lists.postgresql.org; Tue, 26 Oct 2021 01:52:03 +0000 Received: by mail-qv1-xf2a.google.com with SMTP id a4so384231qva.12 for ; Mon, 25 Oct 2021 18:52:01 -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=K8+CKJrEZhcN4ZMga9xrpXSvfSztAnYc61HclTCjDf0=; b=D/UKQFW9IGdOZAicXfFMf96lCPtg17s2P4zY2aKmK4jNhTDKZWVT+VPqDf1KZE3miQ rp5cg3FoypZ3yyGnCXyupbi3iMkgJa51kDWFBhiJDXILbWCTt6vtHV9u7UCjR+LbUJQu xF7F9UMmVOjmVvG2xgKIzpQE3HdJaEE+3dvrI= 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=K8+CKJrEZhcN4ZMga9xrpXSvfSztAnYc61HclTCjDf0=; b=noHW792Gqg3smz5I80CuSYVf6owmdWvHi17acyJdJFF50vRTucw9CBJQtArQDCcQAG aG1QenPZBdi1HQIJY/I3P2Fph3FlfeoutfAnxmhBWyivTa7cubhOY+vfH4c3GkYFqUtC f6IGclkQjafQDxvMj0TDmi9XEV2OBIpmAD44sT/6LaAMpEcKRexXkyWQuqWuKP5eEPU8 7lBnRVtv585JYgDuZo3XxZHjTfj7+mHLGjsjd7iwW76QfrsuvSNTV1wtxQJlsUZq43MM fsi95Rhc+EsOruDtGhtDLwTNXijNaSc3BJT0Pl9gm4oLDi4s502p5UJ4A+qCN0sdLTLS Ye3g== X-Gm-Message-State: AOAM5334sugecuh+mGtYwF/VE61WcrZ14T9AOabm3XTUz4mZcK/Nc5fK 29wWEzxB1VZNZAysmmHuOyC9sw== X-Google-Smtp-Source: ABdhPJyWiUn/WgRi/l88xjWC9QhUajuPa14q1T81h3uyOXvk8tWxp/9Gl6IM8Y8RKBVUH9Dj/SU6Xw== X-Received: by 2002:a05:6214:229:: with SMTP id j9mr19371260qvt.27.1635213121221; Mon, 25 Oct 2021 18:52:01 -0700 (PDT) Received: from rfd.leadboat.com ([2600:1702:a20:5750::46]) by smtp.gmail.com with ESMTPSA id n123sm9804942qke.36.2021.10.25.18.51.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Oct 2021 18:52:00 -0700 (PDT) Date: Mon, 25 Oct 2021 18:51:57 -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: <20211026015157.GA113335@rfd.leadboat.com> References: <20211017151205.GA2384251@rfd.leadboat.com> <9BA43784-E4A7-4638-900C-FC9868C388FA@yandex-team.ru> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4170532.1635195582@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 Mon, Oct 25, 2021 at 04:59:42PM -0400, Tom Lane wrote: > Andrey Borodin writes: > > FWIW it's easy to make the issue reproduce faster with following diff > > - '--no-vacuum --client=1 --transactions=100', > > + '--no-vacuum --client=1 --transactions=1', > > Hmm, didn't help here. It seems that even though prairiedog managed to > fail on its first attempt, it's not terribly reproducible there; I've > seen only one failure in about 30 manual attempts. In the one failure, > the non-background pgbench completed fine (as determined by counting > statements in the postmaster's log); but the background one had only > finished about 90 transactions before seemingly getting stuck. No new > SQL commands had been issued after about 10 seconds. Interesting. https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prairiedog&dt=2021-10-24%2016%3A05%3A58 also shows a short command count, just 131/200 completed. However, https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=conchuela&dt=2021-10-25%2000%3A35%3A27 shows the full 200/200. I'm starting to think the prairiedog failures have only superficial similarity to the conchuela failures. > Nonetheless, I have a theory and a proposal. This coding pattern > seems pretty silly: > > $pgbench_h->pump_nb; > $pgbench_h->finish(); > > ISTM that if you need to call pump at all, you need a loop not just > one call. So I'm guessing that when it fails, it's for lack of > pumping. The pump_nb() is just unnecessary. We've not added anything destined for stdin, and finish() takes care of pumping outputs. > The other thing I noticed is that at least on prairiedog's host, the > number of invocations of the DROP/CREATE/bt_index_check transaction > is ridiculously out of proportion to the number of invocations of the > other transactions. It can only get through seven or eight iterations > of the index transaction before the other transactions are all done, > which means the last 190 iterations of that transaction are a complete > waste of cycles. That makes sense. > 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 On prairiedog, the proximate trouble is pgbench getting stuck. IPC::Run is behaving normally given a stuck pgbench. When pgbench stops sending queries, does pg_stat_activity show anything at all running? If so, are those backends waiting on locks? If not, what's the pgbench stack trace at that time?