Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWpPu-0007i3-Uv for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jan 2018 20:13:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eWpPu-0003IE-60 for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jan 2018 20:13:38 +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 1eWpPt-0003I3-Vj for pgsql-hackers@lists.postgresql.org; Wed, 03 Jan 2018 20:13:38 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eWpPq-0006nF-OM for pgsql-hackers@postgresql.org; Wed, 03 Jan 2018 20:13:37 +0000 Received: by mail-wm0-x231.google.com with SMTP id r78so4695616wme.5 for ; Wed, 03 Jan 2018 12:13:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:from:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=ZT8nxtpqiJxwQOMtGGXyEgd8rthCTRl41HYZ+qZoyEU=; b=EHN4/puSp+Xuah9tCljAzJOu524o8VVfL4oN+hEdzqVk9bAejdoSwvYU+QAX33+Mnc Lnb3/+o/lCAE8VbOrm+gB4jJKBqs1pbOm1adZto7/6OKOd1F9iH2UX5+SOY8wXss5QYw +XQVPL+6f2YcSb3zko6T6uEzU/VwWl7Zt55Q6/fKF22NR/dnhk5IOYC1ZU/go8L4AA0q WmonaIR0T+/RQbSpksudLMul2MagH8amSTO02wfgYZVGVbxPVz+ar+/keLnDmlbgDWz7 hQ8hnbTcXgqt7k/VGmaC94jiIKvVC9CBFtcWbWXoS1a7yRYXeQXLZzJvXK96goq1DP4P qU8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZT8nxtpqiJxwQOMtGGXyEgd8rthCTRl41HYZ+qZoyEU=; b=tcZqr5Nb2Vxep62kcEvOZpi7gL4Bn4Aah58r0H8xtTcgI+ITGxybXw9xUlQSyTLtm/ Y4wpiGrVYaYtxanASoRd60s9bZMduOCp7hPJ/5ejmgPG2nVg0xaQqCGIwofKHM6O16Dx Qy4jlN8J+GwtqRuBL/hdsVjtN1T+8nVYbD6WfMDYbX92xB0UOZO51RpWVRbQzzgXmt+a mUO8pMwOZHuKhMU1QV9juQhHW58CRHXcbds5DU1Cxi7Ml9E0Cms8pktiN0+rrB/Q7oep Ttkl9rLlum0UgiJcnyMhDTMErlocf9Hf0cz/kRM+YYBMK3dPkWBXWnkqfpegQuRKVJvQ m2vA== X-Gm-Message-State: AKGB3mLiALqJSM0b6mUOtnJY4f+jJgA8GXmsmJjApEH+rX9zM9hrCdZR JY+YmLjBOOzVghm2GZmoleyrtfpNnC46nXEiL6wgNoaLhlmikctIfFxecYEVb4c037mVEr9npzz lix7tXys8mvBY4M7tn/W4WmMECJ5DB4bIXi7HUJGkiz2Wr1vekY4vv+4hCdJqLsw0W4biNukhJa Zt9TRD8jgv X-Google-Smtp-Source: ACJfBovBlgCNK/ilCDw0XPAY4Sh8M45JUmZ+26BpgmZMeUxmFiIOAyCZDaEGm3aVi5RWPOrWc3uBqQ== X-Received: by 10.28.139.144 with SMTP id n138mr2286766wmd.43.1515010412557; Wed, 03 Jan 2018 12:13:32 -0800 (PST) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id 127sm2114599wmk.14.2018.01.03.12.13.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2018 12:13:31 -0800 (PST) Subject: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions From: Tomas Vondra To: PostgreSQL Hackers References: <688b0b7f-2f6c-d827-c27b-216a8e3ea700@2ndquadrant.com> Message-ID: Date: Wed, 3 Jan 2018 21:13:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 01/03/2018 09:06 PM, Tomas Vondra wrote: > Hi, > > attached is v4 of the patch series, with a couple of changes: > > 1) Fixes a bunch of bugs I discovered during stress testing. > > I'm not going to go into details, but the main fixes are related to > properly updating progress from the worker, and not streaming when > creating the logical replication slot. > > 2) Introduces columns into pg_stat_replication. > > The new columns track various kinds of statistics (number of xacts, > bytes, ...) about spill-to-disk/streaming. This will be useful when > tuning the GUC memory limit. > > 3) Two temporary bugfixes that make the patch series work. > Forgot to mention that the v4 also extends the CREATE SUBSCRIPTION to allow customizing the streaming and memory limit. So you can do CREATE SUBSCRIPTION ... WITH (streaming=on, work_mem=1024) and this subscription will allow streaming, and the logica_work_mem (on provider) will be set to 1MB. -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services