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 1iB2Gf-0003Va-Ai for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 19:39:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iB2Gd-0004Ll-FO for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 19:39:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iB2Gb-0004LX-Nq for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 19:39:03 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iB2GY-0000k6-Kq for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 19:39:00 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6A04E20C69; Thu, 19 Sep 2019 15:38:57 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 19 Sep 2019 15:38:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=N 4bmaptH7+INlOr6m3UFN5fgot1M7eUWFkj9HNak65E=; b=0FyRLaD3xnRSDiMbL rY5eZqLNdGDG9iQ30UTXnUplNdyDdr4vHkK1STqsGq/ew1NBc6Vx5z34kfUCiuzV Z0RqYr1xYf6GLoEsd/U2vIeKj4V2OE2/Y4WoGFigxyFkaM3gmd26d7DZSB4MEgY3 Ee8h36yxWgZgDrEBuAYU1u5M6c/OD3PtMh8/pPr7KRYpQY5FZxoQ305pOrkqMmI8 ZiA+wVLleEhHbN/zsWjqmiz9xvBe9TehSTLWAe7TW5+jVLnthv0gmAsmRXrL9gnq rFUBgKm8onKeHnJY8lkQWG0bYxlgir28mEcKMCL2Q9xc9oQBYtcTPMuEfflMeBPt mMONg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=N4bmaptH7+INlOr6m3UFN5fgot1M7eUWFkj9HNak6 5E=; b=UUfoSlOP7EarjgaY7lNe1W3Q4xVRDRoYvjfmOHph5GHj3SiSoU0TE14MT LdXmX8OJ0JACOlP/YMYxKBnY8ymHz7Lo9d4waKS+3c2xmMGf2o0VLxy6o7XtU4GI 2XCp3/+wpS9PYTq0vBcIq9IwDMGBc/QpJxgFO+QFI0XnQXkdongm1T35yYLy0NHZ xz2Up1iB7+rXy+wyQNeITjy3S/C05oMMg269NlLFuLhL3Tg+jAL2DcUeKj2e0Vxu mIc9DI1Xt/jq414JP7wtSrJdjlUQuU5xSGv2/Zba7JaPJtnW1Mi7QO/1yvegdseB th7lLeFRpMOWBzy/6JdzJxwazEB7g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddtgddugeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtke ertddtfeehnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuffhomhgrihhnpehpohhsthhgrhgvsh hqlhdrohhrghenucfkphepudejgedrvddurdeihedrieefnecurfgrrhgrmhepmhgrihhl fhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluh hsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.3] (174-21-65-63.tukw.qwest.net [174.21.65.63]) by mail.messagingengine.com (Postfix) with ESMTPA id 85871D60065; Thu, 19 Sep 2019 15:38:56 -0400 (EDT) Subject: Re: is it safe to drop 25 tb schema with cascade option? To: Julie Nishimura , "pgsql-general@lists.postgresql.org" , pgsql-general References: From: Adrian Klaver Message-ID: <71b7be3f-6f7f-cce4-ce76-87febd8295b0@aklaver.com> Date: Thu, 19 Sep 2019 12:38:55 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 9/19/19 12:06 PM, Julie Nishimura wrote: > Hello, we've recently inherited large Greenplum system (master with > standby and 8 segment nodes), which is running old version of GP: > > 20190919:15:22:01:122002 gpstate:hitw-mck-gp1-mdw-1:gpadmin-[INFO]:- > Greenplum initsystem version   = 4.3.4.0 build 1 > 20190919:15:22:01:122002 gpstate:hitw-mck-gp1-mdw-1:gpadmin-[INFO]:- > Greenplum current version      = PostgreSQL 8.2.15 (Greenplum >  Database 4.3.8.1 build 1) on x86_64-unknown-linux-gnu, compiled by GCC > gcc (GCC) 4.4.2 compiled on Apr 20 2016 08:08:56 > 20190919:15:22:01:122002 gpstate:hitw-mck-gp1-mdw-1:gpadmin-[INFO]:- > Postgres version               = 8.2.15 > > If I scan logs, for the last 6 months I see the following warning after > every transaction: > 04 UTC,0,con9059926,cmd1,seg-1,,,,sx1,"WARNING","01000","database > ""my_db_name"" must be vacuumed within 1607900488 transactions",,"To > avoid a database shutdown, execute a full-database VACUUM in > ""my_db_name"".",,,,"set client_encoding to 'SQL_ASCII'",0,,"varsup.c",109, > > The database "my_db_name" is 32 TB. According to the crontab logs, we > run VACUUM on pg_catalog every day (while the system is online). Should > I try to run VACUUM FULL on pg_catalog first, or I need to run VACUUM on > the entire "my_db_name"? I am not sure what I should try first. The vacuum warning is about transaction id wrap around: https://www.postgresql.org/docs/8.2/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND You will need to vacuum more then just pg_catalog. You will need to do what the message says, vacuum the entire database. > > For the full picture: the largest schema on "my_db_name" was "temp", it > was consuming about 25 tb. So what we did - we renamed this schema to > "temp_orig", and created brand new schema "temp" (to make drop objects > from temp_orig easier and isolated). However, I was hesitating to drop > the entire schema that big in one transaction, and started dropping > tables from "temp_orig", however, there are millions of objects in that > schema, and as a result, number of "drop table" transactions are very > high. How safe is it to run "DROPSCHEMAtemp_orig CASCADE" if the schema > is almost 25 tb? Not sure. > > We are running out of space very quickly. we have only 5% left on a device > > Last time when we dropped millions of objects from that old schema, we > were able to free up some space, but this time around even though I am > running a lot of "drop tables", the space temporarily goes down > (according to df -h), then it goes back again, even faster than I am > freeing it up. Which makes me believe the system catalog is bloated now. Probably due to all the other operations hitting the database. Have you tried vacuuming the system catalogs? > > Any advice is appreciated. > > Thanks a lot! > -- Adrian Klaver adrian.klaver@aklaver.com