Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d96QD-0001O8-IB for pgsql-hackers@arkaria.postgresql.org; Fri, 12 May 2017 08:59:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d96QC-0001Cu-SH for pgsql-hackers@arkaria.postgresql.org; Fri, 12 May 2017 08:59:36 +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 1d96Of-0006wj-JK for pgsql-hackers@postgresql.org; Fri, 12 May 2017 08:58:01 +0000 Received: from mail-wr0-x234.google.com ([2a00:1450:400c:c0c::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1d96Oc-0002hK-5T for pgsql-hackers@postgresql.org; Fri, 12 May 2017 08:58:00 +0000 Received: by mail-wr0-x234.google.com with SMTP id z52so39610289wrc.2 for ; Fri, 12 May 2017 01:57:57 -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=V/v9KscqdZeReU9pc+9IA6IWR2pb94+MmjU6qVpPX5I=; b=YyjgmKW6xQxAab4Lo6fSp0OdRohdV5q9ZXBNIJgMTLO7vqNMxcN4kdS+074ZmSYBIl Q38JFHb98GT3q0/ePGTASXGBFuHKPX9lHlr0VmgVBo1qPr1HFLFW1+Z6SEE15HrKiK1h wKpWulW4NYPosNmBM6+INzv0yRg6zMkpRc79rZX2P+Pkvpnc41r4DT18V27+OjOp0IJM dHFHmq2Vb3UBT+y2D2HZrRPoBDJF1zrsLD5ItTE6e0oQu5nBX5D9r7UUV1NR/YRQExq0 DjxH94xG1IxtvV1yFZ9hPPGLMg1wIsVVCrfgtyqePQRIqPh5QgfwG/eIftCGor1uducR HFtA== 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=V/v9KscqdZeReU9pc+9IA6IWR2pb94+MmjU6qVpPX5I=; b=Pm6/8w98xtXdt5NIAJcr7oPoISTL2HEWoPQHeuzB8D6xHLwoeVbIEgVHaiFx4MQrG9 vn0+dRUqDEG/lNvUBFq+9E/LiKfa18xTstmI+2A5lBCK36/YePSmLV/uwHueo/TFBMFD bQmycDMuLPzsSrYUJ1aoSbNF8JVYqMxW11YdWXWylz67DBxXr0HHFIeeNphWX3btrAvz CJE2v1s2bRH61hfwwWa/vjfX3X/grVyE2dP/nVryd7XiSffF4Zdb6/TVsx0TePnAQk6r 2zLK1EGzg6/AX3B2jWyaZfLIO5iPhUmDDER4ZXb5pUZpMphJutAenqGUwmQKRXin9i/A RX5g== X-Gm-Message-State: AODbwcADx/g5/tvP32+Nr4Ls5IfYogWP5Rnm60t7VnT2mOZ2pdCwy8fv KXQj9hb10XR05NY2 X-Received: by 10.223.148.165 with SMTP id 34mr2255073wrr.75.1494579477045; Fri, 12 May 2017 01:57:57 -0700 (PDT) Received: from [192.168.0.105] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id g25sm4594513wra.1.2017.05.12.01.57.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 May 2017 01:57:56 -0700 (PDT) Subject: Re: snapbuild woes To: Andres Freund , Noah Misch References: <20170413045812.GA2917375@tornado.leadboat.com> <20170417020404.GB2988768@tornado.leadboat.com> <20170418041657.hvwss6hz73ghozp5@alap3.anarazel.de> <20170422053621.2qtvurecfatet2ei@alap3.anarazel.de> <20170428043444.GD787347@rfd.leadboat.com> <20170504054516.GA850485@rfd.leadboat.com> <20170511215155.bnigoevqoe4hejmg@alap3.anarazel.de> <20170511215426.5u2itcy5mruo65on@alap3.anarazel.de> <20170512013127.ytncnqvlluheandz@alap3.anarazel.de> Cc: pgsql-hackers@postgresql.org, Peter Eisentraut , Erik Rijkers , David Steele , Robert Haas , Craig Ringer , pgsql-hackers-owner@postgresql.org From: Petr Jelinek Message-ID: Date: Fri, 12 May 2017 10:57:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170512013127.ytncnqvlluheandz@alap3.anarazel.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -1.9 (-) 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 12/05/17 03:31, Andres Freund wrote: > On 2017-05-11 14:54:26 -0700, Andres Freund wrote: >> On 2017-05-11 14:51:55 -0700, wrote: >>> On 2017-05-08 00:10:12 -0700, Andres Freund wrote: >>>> I plan to commit the next pending patch after the back branch releases >>>> are cut - it's an invasive fix and the issue doesn't cause corruption >>>> "just" slow slot creation. So it seems better to wait for a few days, >>>> rather than hurry it into the release. >>> >>> Now that that's done, here's an updated version of that patch. Note the >>> new logic to trigger xl_running_xact's to be logged at the right spot. >>> Works well in my testing. >>> >>> I plan to commit this fairly soon, unless somebody wants a bit more time >>> to look into it. >>> >>> Unless somebody protests, I'd like to slightly revise how the on-disk >>> snapshots are stored on master - given the issues this bug/commit showed >>> with the current method - but I can see one could argue that that should >>> rather be done next release. >> >> As usual I forgot my attachement. > > This patch also seems to offer a way to do your 0005 in, possibly, more > efficient manner. We don't ever need to assume a transaction is > timetravelling anymore. Could you check whether the attached, hasty, > patch resolves the performance problems you measured? Also, do you have > a "reference" workload for that? > Hmm, well it helps but actually now that we don't track individual running transactions anymore it got much less effective (my version of 0005 does as well). The example workload I test with is: session 1: open transaction, do a write, keep it open session 2: pgbench -M simple -N -c 10 -P 1 -T 5 session 3: run CREATE_REPLICATION_SLOT LOGICAL in walsender session 2: pgbench -M simple -N -c 10 -P 1 -T 20 session 1: commit And wait for session 3 to finish slot creation, takes about 20 mins on my laptop without patches, minute and half with your patches for 0004 and 0005 (or with your 0004 and my 0005) and about 2s with my original 0004 and 0005. What makes it slow is the constant qsorting IIRC. -- 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