Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d56Kr-0002dz-CF for pgsql-hackers@arkaria.postgresql.org; Mon, 01 May 2017 08:05: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 1d56Kq-0005B9-EZ for pgsql-hackers@arkaria.postgresql.org; Mon, 01 May 2017 08:05:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d56JK-0002SO-QK for pgsql-hackers@postgresql.org; Mon, 01 May 2017 08:03:59 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d56JD-0003mR-Kx for pgsql-hackers@postgresql.org; Mon, 01 May 2017 08:03:57 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 16D2E20A64; Mon, 1 May 2017 04:03:50 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Mon, 01 May 2017 04:03:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=CLbd8DFhpfEIqwe5Q5 yNobQVtsJS45yzSpuXMkDWnzw=; b=Dy2HPkjtgxbXqxV0A4eWZXCtSTzWlICMaE 4fW5WNkN6rSoShLYX1wBtdLT0DV8y28ty/RqseSkafe3x9JktXEA0aXeaCdQj4Q3 3miyyC30vMNnqIq6cxgvDqY2G5Y3BrviDCSOQljG7U21nQUEhb8hqMife0Of/fLQ sZbifL61Yg875yX5QcmBnXZgsYYf3/Lt03UAKU7i+CJYSikaJ6Z4Xerb5HWnrkNA SaAzouj+55bEVLGy9EoHwaL9zcopXpaUFDCcb3vTf5Qufe70N+YnrCxpXhoNb9Zz AE9xaadqBCpX2EF2ZmlcGYfGp5fRm6DzxvEja17XW7kIpK26HfxA== X-ME-Sender: X-Sasl-enc: ja8Abbu+f3bbXrTXtOvfiIeF9pleiv3xDrFFdtEpwMsy 1493625829 Received: from intern.anarazel.de (unknown [136.24.76.72]) by mail.messagingengine.com (Postfix) with ESMTPA id C31D22473A; Mon, 1 May 2017 04:03:49 -0400 (EDT) Date: Mon, 1 May 2017 01:03:48 -0700 From: Andres Freund To: Petr Jelinek Cc: PostgreSQL-development , Erik Rijkers , Robert Haas , Craig Ringer Subject: Re: snapbuild woes Message-ID: <20170501080348.vb6mj5whdex3f7l7@alap3.anarazel.de> References: <7286ebe9-cb1b-cf1a-f85b-fbe3402ea0bf@2ndquadrant.com> <9a897b86-46e1-9915-ee4c-da02e4ff6a95@2ndquadrant.com> <51f65289-54f8-2256-d107-937d662d69f1@2ndquadrant.com> <20170413002959.apytyi5lkknauauj@alap3.anarazel.de> <0d06dfc1-0bc5-c3ab-3555-24e2f275d7fa@2ndquadrant.com> <30242bc6-eca4-b7bb-670e-8d0458753a8c@2ndquadrant.com> <20170501005921.qcqd7w2njpv3av6s@alap3.anarazel.de> <20170501013529.sejtgo2acxbvq26q@alap3.anarazel.de> <209861fc-718f-0a7b-3a1d-36512865c209@2ndquadrant.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <209861fc-718f-0a7b-3a1d-36512865c209@2ndquadrant.com> X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2017-05-01 03:54:49 +0200, Petr Jelinek wrote: > I agree with adding running, I think that's good thing even for the per > transaction tracking and snapshot exports - we could use the newly added > field to get rid of the issue we have with 'snapshot too large' when > there were many aborted transactions while we waited for running ones to > finish. I'm not sure of that - what I was proposing would only track this for the ->running substructure. How'd that help? > But, I still think we need to restart the tracking after new > xl_running_xacts. Reason for that is afaics any of the catalog snapshots > that we assigned to transactions at the end of SnapBuildCommitTxn might > be corrupted otherwise as they were built before we knew one of the > supposedly running txes was actually already committed and that > transaction might have done catalog changes. I'm afraid you're right. But I think this is even more complicated: The argument in your version that this can only happen once, seems to also be holey: Just imagine a pg_usleep(3000 * 1000000) right before ProcArrayEndTransaction() and enjoy the picture. Wonder if we should just (re-)add a stage between SNAPBUILD_START and SNAPBUILD_FULL_SNAPSHOT. Enter SNAPBUILD_BUILD_INITIAL_SNAPSHOT at the first xl_running_xacts, wait for all transactions to end with my approach, while populating SnapBuild->committed, only then start collecting changes for transactions (i.e. return true from SnapBuildProcessChange()), return true once all xacts have finished again. That'd presumably be a bit easier to understand, more robust - and slower. - Andres -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers