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 1jaasn-0007Dp-2C for pgsql-general@arkaria.postgresql.org; Mon, 18 May 2020 08:12:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jaask-0007uR-2l for pgsql-general@arkaria.postgresql.org; Mon, 18 May 2020 08:12:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jaasj-0007uK-R0 for pgsql-general@lists.postgresql.org; Mon, 18 May 2020 08:12:17 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jaasg-00081D-EX for pgsql-general@postgresql.org; Mon, 18 May 2020 08:12:16 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 07F90156D; Mon, 18 May 2020 11:12:11 +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 TP1AuxfeRQa9; Mon, 18 May 2020 11:12:08 +0300 (EEST) Received: from mail.hot.ee (hot-relayhost3.estpak.ee [213.180.2.81]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id C02841B88; Mon, 18 May 2020 11:12:08 +0300 (EEST) Received: from dell2 (66-63-196-88.sta.estpak.ee [88.196.63.66]) (Authenticated sender: kobruleht2) by HOT-Relayhost3.estpak.ee (Postfix) with ESMTPSA id 49QWvW05Mhzqs; Mon, 18 May 2020 11:12:05 +0300 (EEST) Message-ID: <5EB4D21935104DC19E271B490CD16BAA@dell2> From: "Andrus" To: "Laurenz Albe" , "pgsql-general" References: <6D4B5482A2F645E6A7D4EF0BF098F3E0@dell2> In-Reply-To: Subject: Re: Hot and PITR backups in same server Date: Mon, 18 May 2020 11:11:44 +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! >This is confused or at least confusing. >- "max_wal_size" of 5TB is clearly insane. >- I don't understand what you mean by "Start backup server for hot standby backups". >Do I get it right that you want to copy a streaming replication standby server's data directory to perform PITR? I want to copy only pg_wal directory contents from this. After pg_basebackup has finished, copy of its data directory is saved for possible PITR. Its pg_wal contents will be replaced with current pg_wal directory contents. After that recovery time will set it postgres.conf and separate server in 5433 is used to preform PITR using this data directory. >That doesn't see like a good plan, because the standby >usually won't be much behind the primary server, and you can only recover to a later >point in time. I will get data from copy taken when hot backup server was created and replace its pg_wal directory contents from pg_wal in current backup server pg_wal directory. Since max pg wal size is big it should contain all WAL segments from time where base backup was taken. >If you care to elaborate, perhaps the question can be answered. Currently binary async hot standby backup server is working OK and replicates main sever database almost immediately. However if important data is deleted in same day, it cannot recovered since hot standby server database has replicated same data as in master server. Master server disk space is limited. It cannot keep large number of wal segments. Standby server has lot of free disk space. I'm looking for a way to collect data for PITR recovery (WAL segments) in standby server. I have initial base backup of data directory created using pg_basebackup. All WAL segments from master server after pg_basebackup should saved in backup server and should be used for PITR recovery when needed. How to use hot standby server for this ? Or should separate cluster in 5433 port created and pg_rewind or something other used for PITR. Andrus.