Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ghW9h-0004bb-7O for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Jan 2019 08:57:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ghW9e-0000Y5-KZ for pgsql-bugs@arkaria.postgresql.org; Thu, 10 Jan 2019 08:57:34 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1ghVbf-0006Qd-OM for pgsql-bugs@lists.postgresql.org; Thu, 10 Jan 2019 08:22:27 +0000 Received: from viclamta13p.bpe.bigpond.com ([203.38.21.77]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ghVbU-00017P-RQ for pgsql-bugs@lists.postgresql.org; Thu, 10 Jan 2019 08:22:25 +0000 Received: from smtp.telstra.com ([10.10.26.4]) by viclafep13p-svc.bpe.nexus.telstra.com.au with ESMTP id <20190110082203.UGQJ23998.viclafep13p-svc.bpe.nexus.telstra.com.au@smtp.telstra.com>; Thu, 10 Jan 2019 19:22:03 +1100 X-RG-Spam: Unknown X-RazorGate-Vade-Verdict: clean 0 X-RazorGate-Vade-Classification: clean X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedtledrfedvgdduudekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuuffpveftpgfvgffnuffvtfetnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvuffkfhggtggujggfsehttdertddtredvnecuhfhrohhmpeetrfcuoegrphesiihiphdrtghomhdrrghuqeenucfkphepheekrddujeefrddvvdejrddugeeknecurfgrrhgrmhephhgvlhhopegsuhhnhihiphdrsghilhhlrggsohhnghdrfigvvggsvggrshhtihgvrdhnvghtpdhinhgvthepheekrddujeefrddvvdejrddugeekpdhmrghilhhfrhhomhepoegrphesiihiphdrtghomhdrrghuqedprhgtphhtthhopeeorghnughrvghssegrnhgrrhgriigvlhdruggvqedprhgtphhtthhopeeophhgshhqlhdqsghughhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgheqnecuvehluhhsthgvrhfuihiivgeptd X-RG-VS-CLASS: clean Received: from bunyip.billabong.weebeastie.net (58.173.227.148) by smtp.telstra.com (9.0.019.26-1) id 5BB3FBB6118CA786; Thu, 10 Jan 2019 19:22:02 +1100 Received: from hogarth by bunyip.billabong.weebeastie.net with local (Exim 4.89) (envelope-from ) id 1ghVbE-0003So-JX; Thu, 10 Jan 2019 19:22:00 +1100 Date: Thu, 10 Jan 2019 19:22:00 +1100 From: AP To: Andres Freund Cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15582: ALTER TABLE/INDEX ... SET TABLESPACE does not free disk space Message-ID: <20190110082200.ftx5id3xafhuoykg@zip.com.au> References: <15582-dae8ba537137883d@postgresql.org> <20190109160728.cmcnkf4x2hnqb4lr@alap3.anarazel.de> <20190110035821.x54pyf4krnri2u4s@zip.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190110035821.x54pyf4krnri2u4s@zip.com.au> User-Agent: NeoMutt/20170113 (1.7.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Jan 10, 2019 at 02:58:21PM +1100, AP wrote: > Hi, > > On Wed, Jan 09, 2019 at 08:07:28AM -0800, Andres Freund wrote: > > Hi, > > > > On 2019-01-09 02:21:48 +0000, PG Bug reporting form wrote: > > > I've added a tablespace recently to help deal with almost running out of > > > disk space. > > > > > > I then tried to use it with: > > > > > > ALTER TABLE schema.table SET TABLESPACE hydro2_tmp; > > > > > > This worked in so far as disk space was used on hydro2_tmp but nothing was > > > ever freed in the default location. > > > > If you restart postgres, is the space freed? > > No. :( > > > I suspect the issue is that we don't properly close the old relation in > > all backends that had it open, but it's hard to know for sure without > > that. If restarting isn't feasible, ensuring all backends older than > > the move are ended, and issuing a CHECKPOINT; might also free the space > > after a few seconds. > > I did a CHECKPOINT (it was fast) and it did not help. Then I did a restart > and space is still used. I tried it again (because I need to write data to the db ASAP) with other tables that are actively being written to (the previous lot were "archived" tables) and I noticed this in the logs: ERROR: [082]: unable to push WAL segment '00000001000117BB00000001' asynchronously after 60 second(s) 2019-01-10 19:06:25.753 AEDT [21662] LOG: archive command failed with exit code 82 2019-01-10 19:06:25.753 AEDT [21662] DETAIL: The failed archive command was: pgbackrest --stanza=zonk archive-push pg_wal/00000001000117BB00000001 Would this interfere and cause issues? AP