Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKSkO-0004Td-HM for pgsql-admin@arkaria.postgresql.org; Thu, 30 Nov 2017 17:35:40 +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 1eKSkN-0006Eh-LO for pgsql-admin@arkaria.postgresql.org; Thu, 30 Nov 2017 17:35:39 +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 1eKSkN-0006EY-Eu for pgsql-admin@lists.postgresql.org; Thu, 30 Nov 2017 17:35:39 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eKSkK-0005S1-VR for pgsql-admin@lists.postgresql.org; Thu, 30 Nov 2017 17:35:39 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 1643F4CCF2; Thu, 30 Nov 2017 18:35:34 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id TQsoVc-laUNj; Thu, 30 Nov 2017 18:35:33 +0100 (CET) Message-ID: <1512063321.2328.20.camel@cybertec.at> Subject: Re: PG 10 streaming replication pg_wal question From: Laurenz Albe To: ghiureai , pgsql-admin@lists.postgresql.org In-Reply-To: <5A203DC7.40509@nrc-cnrc.gc.ca> References: <5A203DC7.40509@nrc-cnrc.gc.ca> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Date: Thu, 30 Nov 2017 18:35:21 +0100 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ghiureai wrote: > I am testing PG10 streaming replication , with archiving off, I have > pg_wal on separate directory to monitor the growth , I had the slave > offline yesterday for more than 20h while I was restoring one of db > (60GB) with pg_restore from a backup taken with pg_dump, today I brought > the slave PG host online and replication catch up nicely , master and > slave are in sync now, but on master host the pg_wal is still same > large size ( as yesterday) even after all the wal files had been > applied to salve, would replication process not suppose to removed the > wal files on master after being applied to salve ? > ( do I need to manually implement a cleanup job of this wal files, as > mentioned archiving is off on both servers) Never remove WAL files yourself. pg_wal will shrink eventually. At the next checkpoint, PostgreSQL will remove all WAL files that were completed and archived successfully since the previous checkpoint, thus reducing WAL size a little. If there is activity on the databases, pg_wal will eventually shrink back to max_wal_size. Yours, Laurenz Albe