Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cptex-00023W-Ni for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Mar 2017 09:31:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cptew-00084p-MB for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Mar 2017 09:31:26 +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 1cptdR-0005O9-Qd for pgsql-hackers@postgresql.org; Mon, 20 Mar 2017 09:29:54 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cptdN-0002RO-Ll for pgsql-hackers@postgresql.org; Mon, 20 Mar 2017 09:29:53 +0000 Received: by mail-wm0-x22d.google.com with SMTP id u132so58246988wmg.0 for ; Mon, 20 Mar 2017 02:29:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=H6sdFPcR7FV1cEM4gQmLBhb+ucya+eNYyfbSTlshh54=; b=XNE5zopgCycLqTbLEfSJQ9wwcK4qPO46NRPFNEM54ssVkjtW0BNs62bhshItd7+Aee 0WFiep9lk2/Q9XD3eUy6MmeCsYk5tZx9vy9qLYVzsMog+QsS6ba6Nu69g3w7iXa2OUg9 XPL0C3kzDwsmgEOkczCxg9a1t3UtEXfRf2Dcvg3BE8nTMLftvmDeP+zJiQ4886n7tP5+ SWW+RrdjvRgJPtCRmhN4dTzxp7iAME/d4W9/aSvxOLL5w6WiEWLdmZaPl2xsthOp/9l0 et3dXHLqtJoHnJlFb9w9sZH4ZRWR/cLw0dOkI1NQzQLtxmxzFYq98uOR8TO4HtOSWAhm XjiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=H6sdFPcR7FV1cEM4gQmLBhb+ucya+eNYyfbSTlshh54=; b=m9DFcEKdpIIPMZpZDC1e2ErW/s2npYBPP9QBrobbIAMsid//Ek51466Z+1k8mVbIJm BxXPX6KwqKnrT5M+ueyffXmTMIYWp8lfHqkZbASd3RZs48tX2QOEMvVGgs+lbS20XOx9 bwsLyA5xEPCRQSSJ/IAmQrpPT8No2ohHRDTM0dV5FZO+fpKIAZkh6OQHQH44kjcnxv+i 7FzbOoA528Qau7HKgqQYv0YtGS1jeURQ+1B7m01PNgaUJlczQqkgg3lKKeThzI7CkHnd 46nNKYzQa+bepN8249MgtL3iUMFjX62FgyGJ18Dgj1/6UMAYfo9Ua8vQ4aA0Kzulhra2 Aj4w== X-Gm-Message-State: AFeK/H2Wwx0X/HpOvK4ARSuqVIiQfQj3sNQ25LbqGP6k7XOxlNHhC0qj76YMgSgncuXAAX3B X-Received: by 10.28.236.209 with SMTP id h78mr9591189wmi.97.1490002187095; Mon, 20 Mar 2017 02:29:47 -0700 (PDT) Received: from [192.168.0.105] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id z88sm20144450wrb.26.2017.03.20.02.29.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Mar 2017 02:29:45 -0700 (PDT) Subject: Re: logical decoding of two-phase transactions To: Craig Ringer References: <02DA5F5E-CECE-4D9C-8B4B-418077E2C010@postgrespro.ru> <3477E635-F590-4432-BD20-C59142B65CD3@postgrespro.ru> <1FE466EA-7058-484D-B0DB-42CD81FA59F0@postgrespro.ru> <46ebc39d-82a0-e59f-2552-2ea8911a64e7@2ndquadrant.com> <25A09FA8-5B0E-447D-97FB-F37F3B0E34E9@postgrespro.ru> <8217d096-3641-8022-09e4-4e625633b278@2ndquadrant.com> Cc: Stas Kelvich , PostgreSQL Hackers , Robert Haas From: Petr Jelinek Message-ID: Date: Mon, 20 Mar 2017 10:29:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 20/03/17 09:32, Craig Ringer wrote: > On 19 March 2017 at 21:26, Petr Jelinek wrote: > >> I think only genam would need changes to do two-phase scan for this as >> the catalog scans should ultimately go there. It's going to slow down >> things but we could limit the impact by doing the two-phase scan only >> when historical snapshot is in use and the tx being decoded changed >> catalogs (we already have global knowledge of the first one, and it >> would be trivial to add the second one as we have local knowledge of >> that as well). > > We'll also have to clobber caches after we finish decoding a 2pc xact, > since we don't know those changes are visible to other xacts and can't > guarantee they'll ever be (if it aborts). > AFAIK reorder buffer already does that. > That's going to be "interesting" when trying to decode interleaved > transaction streams since we can't afford to clobber caches whenever > we see an xlog record from a different xact. We'll probably have to > switch to linear decoding with reordering when someone makes catalog > changes. We may need something that allows for representing multiple parallel transactions in single process and a cheap way of switching between them (ie, similar things we need for autonomous transactions). But that's not something current patch has to deal with. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers