Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciZNZ-000722-1W for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Feb 2017 04:27:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ciZNY-0001MD-E7 for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Feb 2017 04:27:12 +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 1ciZNW-0001G3-HG for pgsql-hackers@postgresql.org; Tue, 28 Feb 2017 04:27:10 +0000 Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1ciZNU-000244-6V for pgsql-hackers@postgresql.org; Tue, 28 Feb 2017 04:27:09 +0000 Received: by mail-wr0-x235.google.com with SMTP id g10so541219wrg.2 for ; Mon, 27 Feb 2017 20:27:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=5FLIFFmf8Dv0CgJBUrB7/nRZSnV1u90POMe1rN2HkJ4=; b=l1aSoO/ClL+srFrSLRJ5SaaOIr2sinqj8P829sAnLZBQ3ywXdg7ViBoC63ntCMVa2u 55Oz2qLfJEbvGXCL7r+V4nKQiagwVIFpLdfXTDlWlT0weRq6W8ipAO/noY/Gi00kbxro qCaM4kiTylcJ/1YWmaP39nhV3Gwxjh/z8CFDU3S2+VGEaGbXgEk9CZuAbF3vaKA2ZFth ATMOrxdTcZ8JJqWVITRIIPSWwAcaGeTTl5vOhRMGME/UXLdSJEFpNwvvrPND9cs4mmx2 B/XFlCjtoycyQvw1No6HMiTcAxuLiHdYQ3CWrQ1lD3GeK/NHX37EkFwuINqdtEr0ew6V SSMA== 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:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=5FLIFFmf8Dv0CgJBUrB7/nRZSnV1u90POMe1rN2HkJ4=; b=aVp1s3oWFQdeyNqTPDjzeOMnMZ4VcGj+SkEydgwL7ZPnpCd5gx2Xrw9TWYwV2mbe9w fs0rfokC3HvSCweTSGEGhtwoAxb3vjMwd+dLQOTFcH5Iu+cuZqoj4Yl32fjiAQV5J2fn waI6pNqJcKgL3XLWcVKYcJM5g5htaQTor21lCBFFWxVoIlvZFQULJEILxkOwWy9+2XJv ZhRac1KOuG+gQZU3VeAGa6A7yIDKr3l6LP3PlIUAmNG3ctFzG0qJQYhy/JP4R0VyBrKe 2x05RbNp8BUpEKUALNB/fb6cDExsSAgtGRSKRpD2/Sqph35Iu21TjtbCrK0MFdMu5KBA 1lBQ== X-Gm-Message-State: AMke39mvrukURh7OM+D4IvL0B/rve9j6Zaytb6HJjaOCa4R8SdanssnmX7tkiUi4damLDEyfrlRaAKXuJaX8+xVbKzDCqyXFLonbxtS98T4t+IA4OcE5zvRf+9AtA+XZhjCOPJxISuTNA6IsWa50jpbvDtFHHHJd/eru54ueIgic/KIadnRbilSRKMmrOabtBewTFBOG3Zv6 X-Received: by 10.223.147.162 with SMTP id 31mr200759wrp.133.1488256026681; Mon, 27 Feb 2017 20:27:06 -0800 (PST) Received: from [192.168.0.105] (150.123.broadband11.iol.cz. [90.178.123.150]) by smtp.gmail.com with ESMTPSA id v196sm891272wmv.5.2017.02.27.20.27.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Feb 2017 20:27:05 -0800 (PST) Subject: Re: Restricting maximum keep segments by repslots To: Kyotaro HORIGUCHI , pgsql-hackers@postgresql.org References: <20170228.122736.123383594.horiguchi.kyotaro@lab.ntt.co.jp> From: Petr Jelinek Message-ID: <33bcf803-4aa8-27b6-b6bd-4fb3ae950b19@2ndquadrant.com> Date: Tue, 28 Feb 2017 05:27:05 +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: <20170228.122736.123383594.horiguchi.kyotaro@lab.ntt.co.jp> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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 28/02/17 04:27, Kyotaro HORIGUCHI wrote: > Hello. > > Although replication slot is helpful to avoid unwanted WAL > deletion, on the other hand it can cause a disastrous situation > by keeping WAL segments without a limit. Removing the causal > repslot will save this situation but it is not doable if the > standby is active. We should do a rather complex and forcible > steps to relieve the situation especially in an automatic > manner. (As for me, specifically in an HA cluster.) > I agree that that it should be possible to limit how much WAL slot keeps. > This patch adds a GUC to put a limit to the number of segments > that replication slots can keep. Hitting the limit during > checkpoint shows a warining and the segments older than the limit > are removed. > >> WARNING: restart LSN of replication slots is ignored by checkpoint >> DETAIL: Some replication slots lose required WAL segnents to continue. > However this is dangerous as logical replication slot does not consider it error when too old LSN is requested so we'd continue replication, hiding data loss. -- 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