Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUdqS-004bCD-1s for pgsql-admin@arkaria.postgresql.org; Fri, 19 Jul 2024 02:59:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sUdqQ-007sph-3T for pgsql-admin@arkaria.postgresql.org; Fri, 19 Jul 2024 02:59:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUdqP-007spV-Lv for pgsql-admin@lists.postgresql.org; Fri, 19 Jul 2024 02:59:42 +0000 Received: from mailout.easymail.ca ([64.68.200.34]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sUdqM-000JDU-RB for pgsql-admin@lists.postgresql.org; Fri, 19 Jul 2024 02:59:41 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 04BAC6179E; Fri, 19 Jul 2024 02:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1721357975; bh=98o9dniBi4NFJ4CN38BwW0PQ57EOJ/+Ms0tLIahG5yo=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=rz/i9bMkycr47g7kpN9AvSyyQtu/gaOMK6Hz02STE4vawVDvKOvWjm7LZIyT0eVw2 UCVFD4FNayO+PQZButi0W9gbqzRJKSHcrynLvhCFvYyCjgcgUO4v7q2hopg0rCVTOH R7xWVI7JQf0cWRlDb8aKJeeM1W+6cwOQFbSVQanPXMN59Dqi/4YENn9II0ADqJTOgb GoxlniJlNCU+UcvaoWixoyi5EqXKWxxHa60x/Mc4O5iwwmW+GaHadXQq3hxj6aT0Yn eUGQvPJGrDwaTfIhNLhyO8+I4ty1TgFcVGO1UAmOIi0r2LFwVVG8WpmaXts1fK/E3K doeXlP5BhemXA== X-Virus-Scanned: Debian amavisd-new at emo07-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo07-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id henVmQ2nW9Kl; Fri, 19 Jul 2024 02:59:34 +0000 (UTC) Received: from smtpclient.apple (unknown [165.140.184.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 6B37561945; Fri, 19 Jul 2024 02:59:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=elevated-dev.com; s=easymail; t=1721357974; bh=98o9dniBi4NFJ4CN38BwW0PQ57EOJ/+Ms0tLIahG5yo=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=Zzo92k7NL5KpATO1TVnYOFlwCUQZKZ9UKCINfB1ug2YuF10Qv0KCyLeC8+JaeshvJ TWZJYwgxtpcrHeMiitfimCK19SLJb+stFvq48m+/Ta8mXN90d3/9urSyYQa2W9+gPU iWsL1ABsvjWxyGbExLnBWnLvQNrv25VTJPC1/HZVoWvD4RJQTGEh6phyPaBISEpLZq Ki0ODk5qUXEArhyxOPohP22vGZeLDfwcyOKxudRPxGVUATMc50BoOUc9do+Ju/9n5I izb1R1x2lZaZkzJLSiVBxiIveuix4Tp6Z6nyXe1x9g0njdZ2e8OABdY5fi840bUdm1 Z/ghEcZj8HMCg== Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: filesystem full during vacuum - space recovery issues From: Scott Ribe In-Reply-To: Date: Thu, 18 Jul 2024 20:59:23 -0600 Cc: Pgsql-admin Content-Transfer-Encoding: quoted-printable Message-Id: References: <7dee2c00-6184-49c5-b303-58113c1d04c6@talentstack.to> To: Thomas Simpson X-Mailer: Apple Mail (2.3774.600.62) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 1) Add new disk, use a new tablespace to move some big tables to it, to = get back up and running 2) Replica server provisioned sufficiently for the db, pg_basebackup to = it 3) Get streaming replication working 4) Switch over to new server In other words, if you don't want terrible downtime, you need yet = another server fully provisioned to be able to run your db. -- Scott Ribe scott_ribe@elevated-dev.com https://www.linkedin.com/in/scottribe/ > On Jul 18, 2024, at 4:41=E2=80=AFPM, Ron Johnson = wrote: >=20 > Multi-threaded writing to the same giant text file won't work too = well, when all the data for one table needs to be together. >=20 > Just temporarily add another disk for backups. >=20 > On Thu, Jul 18, 2024 at 4:55=E2=80=AFPM Thomas Simpson = wrote: >=20 > On 18-Jul-2024 16:32, Ron Johnson wrote: >> On Thu, Jul 18, 2024 at 3:01=E2=80=AFPM Thomas Simpson = wrote: >> [snip] >> [BTW, v9.6 which I know is old but this server is stuck there] >> [snip]=20 >> I know I'm stuck with the slow rebuild at this point. However, I = doubt I am the only person in the world that needs to dump and reload a = large database. My thought is this is a weak point for PostgreSQL so it = makes sense to consider ways to improve the dump reload process, = especially as it's the last-resort upgrade path recommended in the = upgrade guide and the general fail-safe route to get out of trouble. >> No database does fast single-threaded backups. > Agreed. My thought is that is should be possible for a 'new dumpall' = to be multi-threaded. > Something like : > * Set number of threads on 'source' (perhaps by querying a listening = destination for how many threads it is prepared to accept via a control = port) > * Select each database in turn > * Organize the tables which do not have references themselves > * Send each table separately in each thread (or queue them until a = thread is available) ('Stage 1') > * Rendezvous stage 1 completion (pause sending, wait until feedback = from destination confirming all completed) so we have a known consistent = state that is safe to proceed to subsequent tables > * Work through tables that do refer to the previously sent in the same = way (since the tables they reference exist and have their data) ('Stage = 2') > * Repeat progressively until all tables are done ('Stage 3', 4 etc. as = necessary) > The current dumpall is essentially doing this table organization = currently [minus stage checkpoints/multi-thread] otherwise the dump/load = would not work. It may even be doing a lot of this for 'directory' = mode? The change here is organizing n threads to process them = concurrently where possible and coordinating the pipes so they only send = data which can be accepted. > The destination would need to have a multi-thread listen and = co-ordinate with the sender on some control channel so feed back = completion of each stage. > Something like a destination host and control channel port to = establish the pipes and create additional netcat pipes on incremental = ports above the control port for each thread used. > Dumpall seems like it could be a reasonable start point since it is = already doing the complicated bits of serializing the dump data so it = can be consistently loaded. > Probably not really an admin question at this point, more a feature = enhancement. > Is there anything fundamentally wrong that someone with more intimate = knowledge of dumpall could point out? > Thanks > Tom >=20