Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJDFh-0005oZ-J5 for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jun 2017 06:18:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dJDFh-0002B6-5W for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Jun 2017 06:18:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dJDEy-00088U-H9 for pgsql-bugs@postgresql.org; Fri, 09 Jun 2017 06:17:48 +0000 Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dJDEu-0001ap-LH for pgsql-bugs@postgresql.org; Fri, 09 Jun 2017 06:17:48 +0000 Received: by mail-pf0-x22b.google.com with SMTP id l89so25017253pfi.2 for ; Thu, 08 Jun 2017 23:17:44 -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=jd5kry62g3T4fYiaDGNUOajU9ycy2HSC8veBpYUS7aQ=; b=CKcelPktvNcP6yfI26/+RMT2d36xSlWJ7bjxbmOM3z16HO6sb+lPxKE2LVHx9Fx1sF 6xbbq2mVPpcshrA+0ZAOAZwK493UZjCJJq7Ty4c2dHjt0Y1sEoC8rDxyIIaohrt2li00 BoF6A6UmuIek+gng+kMffo9OsmkDlL2RlyErQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jd5kry62g3T4fYiaDGNUOajU9ycy2HSC8veBpYUS7aQ=; b=jL0vtk7M8mUDgp2OV8M06dzF0WtxxxYSdBbr7J+iTOu1kHr7ygSPqRk2Ao8WN/q9sf MWHR7QQpLWbjkEedyWfRUYEt+dzUGcGxJpJhUpVhINsuKpYCeq6hv7+upYKckc3djFrN 9p8coqPyRfkq73MRusQKMe//+aEW3GYKeI6llf++9YhpU4JpzlPc9ryi99OHPGmTmrQy ko7Ao2rdUsMl5QwLs6rJOizBUjhS6KoGx7d8Let6Oup50tM/wk6ucvrcyUD4+iy2S8Kb hjZL7tSN8Qj/gT9XoD4kt83AVeQ/iui63oqhXc/DxqINyqYEGSsyReWSqi5CPHKaEnFr 23Lw== X-Gm-Message-State: AODbwcDXqIe8xylH1L0hg3J7V0/LTk+++wwT8CBZeNUF3PYRkQgj6l3Q qGA/eYgTygL9OA4a X-Received: by 10.98.2.151 with SMTP id 145mr198329pfc.52.1496989062250; Thu, 08 Jun 2017 23:17:42 -0700 (PDT) Received: from rfd.leadboat.com (c-73-158-248-138.hsd1.ca.comcast.net. [73.158.248.138]) by smtp.gmail.com with ESMTPSA id k192sm728590pgc.31.2017.06.08.23.17.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 23:17:40 -0700 (PDT) Date: Thu, 8 Jun 2017 23:17:38 -0700 From: Noah Misch To: simon@2ndquadrant.com Cc: Michael Paquier , wangchuanting@huawei.com, PostgreSQL mailing lists , Tom Lane , pgsql-hackers@postgresql.org Subject: Re: BUG #14680: startup process on standby encounter a deadlock of TwoPhaseStateLock when redo 2PC xlog Message-ID: <20170609061738.GB1612355@rfd.leadboat.com> References: <20170531033228.1487.10124@wrigleys.postgresql.org> <28851.1496239047@sss.pgh.pa.us> <20170604222430.GA1547727@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170604222430.GA1547727@rfd.leadboat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Sun, Jun 04, 2017 at 10:24:30PM +0000, Noah Misch wrote: > On Thu, Jun 01, 2017 at 01:07:53AM -0700, Michael Paquier wrote: > > On Wed, May 31, 2017 at 12:30 PM, Michael Paquier > > wrote: > > > On Wed, May 31, 2017 at 6:57 AM, Tom Lane wrote: > > >> wangchuanting@huawei.com writes: > > >>> startup process on standby encounter a deadlock of TwoPhaseStateLock when > > >>> redo 2PC xlog. > > >> > > >> Please provide an example of how to get into this state. > > > > > > That would help. Are you seeing in the logs something like "removing > > > future two-phase state from memory for XXX" or "removing stale > > > two-phase state from shared memory for XXX"? > > > > > > Even with that, the light-weight lock sequence taken in those code > > > paths look definitely wrong to me, we should not take twice > > > TwoPhaseStateLock in the same code path. I think that we should remove > > > the lock acquisitions in RemoveGXact() and PrepareRedoRemove, and then > > > upgrade the locks of PrescanPreparedTransactions() and > > > StandbyRecoverPreparedTransactions() to be exclusive. We still need to > > > keep a lock as CheckPointTwoPhase() may still be triggered by the > > > checkpoint. Tom, what do you think? > > > > Attached is what I was thinking about for reference. I just came back > > from a long flight and I am pretty tired, so my brain may have missed > > something. I'll take again a look at this issue on Monday, an open > > item has been added for now. > > [Action required within three days. This is a generic notification.] > > The above-described topic is currently a PostgreSQL 10 open item. Simon, > since you committed the patch believed to have created it, you own this open > item. If some other commit is more relevant or if this does not belong as a > v10 open item, please let us know. Otherwise, please observe the policy on > open item ownership[1] and send a status update within three calendar days of > this message. Include a date for your subsequent status update. Testers may > discover new open items at any time, and I want to plan to get them all fixed > well in advance of shipping v10. Consequently, I will appreciate your efforts > toward speedy resolution. Thanks. > > [1] https://www.postgresql.org/message-id/20170404140717.GA2675809%40tornado.leadboat.com This PostgreSQL 10 open item is past due for your status update. Kindly send a status update within 24 hours, and include a date for your subsequent status update. Refer to the policy on open item ownership: https://www.postgresql.org/message-id/20170404140717.GA2675809%40tornado.leadboat.com -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs