Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJZwO-0004O4-2W for pgsql-bugs@arkaria.postgresql.org; Sat, 10 Jun 2017 06:32:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dJZwM-0004H2-Ov for pgsql-bugs@arkaria.postgresql.org; Sat, 10 Jun 2017 06:32:06 +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 1dJZwK-0004GC-O0 for pgsql-bugs@postgresql.org; Sat, 10 Jun 2017 06:32:04 +0000 Received: from mail-pf0-x229.google.com ([2607:f8b0:400e:c00::229]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dJZwF-0004B4-W6 for pgsql-bugs@postgresql.org; Sat, 10 Jun 2017 06:32:03 +0000 Received: by mail-pf0-x229.google.com with SMTP id 15so7577831pfc.1 for ; Fri, 09 Jun 2017 23:31:59 -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=xBSMs7R+UlKDEKzRO82bQh/D5O5um1EkjFwF3XEcggM=; b=RHKzcYH79Uto0O0hZ/H8K5SpEybdhCuVW0ZvIK6g5sS7biDAZKhRIBX+CNcuQqC+NP 5naZN7dUuSVu2aC+1IbG+kqM89S1jFVa31UtybFh4ymeOrM5sZh9QDAF9MRTkEtFwbUj PUWEwRwRHuiTdvVcEJ5l7Uq8JZWslAVnxWGZo= 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=xBSMs7R+UlKDEKzRO82bQh/D5O5um1EkjFwF3XEcggM=; b=Y6HuK5npNftDT1HDmD1RVhtownDJIYKx18SL8PoodliAYZBYtzkzC1DTxRlNbnrpvi cUo0u1iSjIlLodZKpFNnSmYT8KxIPlXtkcHUEKuj3N2kxYckZ5PtVonfO/o2rRGzirvw IrNuM2RETfWqSbkp74CdWoHSXyoIPS8InkEEChvv2bHdss57m1iuBwEYB3IZeru8FhOy HObaoWa59MNdZ9pCwVP+ZGKQ1DSiB9RpvTfR4ol4lytpIj83yi/MktJYNZZgUuy1LcPv 9H6LZvhQm/vcybBRKJImJ8lFF4EGs7g5zoYzce01S13JPk/RzsuQXFS6CqB51c4t9Pbq iwKQ== X-Gm-Message-State: AODbwcDFz1tceW6e82WVrC5h2kcaQjw8qqtreewi0pGaKJacQheBoF2c quQbohRcsfcgHDVb X-Received: by 10.84.218.72 with SMTP id f8mr46210894plm.33.1497076316726; Fri, 09 Jun 2017 23:31:56 -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 u78sm5947299pfd.109.2017.06.09.23.31.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jun 2017 23:31:55 -0700 (PDT) Date: Fri, 9 Jun 2017 23:31:53 -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: <20170610063153.GA1619984@rfd.leadboat.com> References: <20170531033228.1487.10124@wrigleys.postgresql.org> <28851.1496239047@sss.pgh.pa.us> <20170604222430.GA1547727@rfd.leadboat.com> <20170609061738.GB1612355@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170609061738.GB1612355@rfd.leadboat.com> User-Agent: Mutt/1.5.24 (2015-08-30) 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 Thu, Jun 08, 2017 at 11:17:38PM -0700, Noah Misch wrote: > 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 IMMEDIATE ATTENTION REQUIRED. This PostgreSQL 10 open item is long past due for your status update. Please reacquaint yourself with the policy on open item ownership[1] and then reply immediately. If I do not hear from you by 2017-06-11 07:00 UTC, I will transfer this item to release management team ownership without further notice. [1] 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