Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jLZhN-00059o-An for pgsql-general@arkaria.postgresql.org; Mon, 06 Apr 2020 21:54:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jLZhK-0001Eb-DU for pgsql-general@arkaria.postgresql.org; Mon, 06 Apr 2020 21:54:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jLZhK-0001EU-62 for pgsql-general@lists.postgresql.org; Mon, 06 Apr 2020 21:54:26 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jLZhH-0005ip-Q2 for pgsql-general@postgresql.org; Mon, 06 Apr 2020 21:54:25 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id A717C1D44; Tue, 7 Apr 2020 00:54:22 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sRnaUQ81g0Fm; Tue, 7 Apr 2020 00:54:20 +0300 (EEST) Received: from mail.hot.ee (hot-relayhost1.estpak.ee [213.180.2.79]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 6B82E1D41; Tue, 7 Apr 2020 00:54:20 +0300 (EEST) Received: from dell2 (66-63-196-88.sta.estpak.ee [88.196.63.66]) (Authenticated sender: kobruleht2) by HOT-Relayhost1.estpak.ee (Postfix) with ESMTPSA id 48x47b08qMz2kt; Tue, 7 Apr 2020 00:54:17 +0300 (EEST) Message-ID: <0E181F52FD6449568F620E9C84427D10@dell2> From: "Andrus" To: "Laurenz Albe" , "pgsql-general" References: <5E2C91B46CEF42078CC7BEE1EDC10F0E@dell2> <0A8FE679886142EBABB0AC8102477904@dell2> In-Reply-To: Subject: Re: How to prevent master server crash if hot standby stops Date: Tue, 7 Apr 2020 00:50:27 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi! >If you prefer replication to fail silently, don't use replication >slots. Use "wal_keep_segments" instead. I desided to give 1 GB to wal. So I added wal_keep_segments=60 After some time Postgres created 80 files with total size 1.3GB. How to fix this so that no more than 1 GB of disk space is used ? How to get information how may wal files are yet not processed by slave ? How to delete processed wal files so that 1 GB of disk space can used for some other purposes ? /var/lib/postgresql/12/main/pg_wal# ls 00000001000002A200000072 00000001000002A200000083 00000001000002A200000094 00000001000002A2000000A5 00000001000002A2000000B6 00000001000002A200000073 00000001000002A200000084 00000001000002A200000095 00000001000002A2000000A6 00000001000002A2000000B7 00000001000002A200000074 00000001000002A200000085 00000001000002A200000096 00000001000002A2000000A7 00000001000002A2000000B8 00000001000002A200000075 00000001000002A200000086 00000001000002A200000097 00000001000002A2000000A8 00000001000002A2000000B9 00000001000002A200000076 00000001000002A200000087 00000001000002A200000098 00000001000002A2000000A9 00000001000002A2000000BA 00000001000002A200000077 00000001000002A200000088 00000001000002A200000099 00000001000002A2000000AA 00000001000002A2000000BB 00000001000002A200000078 00000001000002A200000089 00000001000002A20000009A 00000001000002A2000000AB 00000001000002A2000000BC 00000001000002A200000079 00000001000002A20000008A 00000001000002A20000009B 00000001000002A2000000AC 00000001000002A2000000BD 00000001000002A20000007A 00000001000002A20000008B 00000001000002A20000009C 00000001000002A2000000AD 00000001000002A2000000BE 00000001000002A20000007B 00000001000002A20000008C 00000001000002A20000009D 00000001000002A2000000AE 00000001000002A2000000BF 00000001000002A20000007C 00000001000002A20000008D 00000001000002A20000009E 00000001000002A2000000AF 00000001000002A2000000C0 00000001000002A20000007D 00000001000002A20000008E 00000001000002A20000009F 00000001000002A2000000B0 00000001000002A2000000C1 00000001000002A20000007E 00000001000002A20000008F 00000001000002A2000000A0 00000001000002A2000000B1 archive_status 00000001000002A20000007F 00000001000002A200000090 00000001000002A2000000A1 00000001000002A2000000B2 00000001000002A200000080 00000001000002A200000091 00000001000002A2000000A2 00000001000002A2000000B3 00000001000002A200000081 00000001000002A200000092 00000001000002A2000000A3 00000001000002A2000000B4 00000001000002A200000082 00000001000002A200000093 00000001000002A2000000A4 00000001000002A2000000B5 Andrus.