Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f14j7-0007Mo-Kl for pgsql-general@arkaria.postgresql.org; Wed, 28 Mar 2018 06:38:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f14j6-0008SZ-LR for pgsql-general@arkaria.postgresql.org; Wed, 28 Mar 2018 06:38:28 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f14j6-0008SP-AX for pgsql-general@lists.postgresql.org; Wed, 28 Mar 2018 06:38:28 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f14j2-0004tm-TN for pgsql-general@postgresql.org; Wed, 28 Mar 2018 06:38:27 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id E630E42BE6; Wed, 28 Mar 2018 08:38:20 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id nRm24oe3h2s2; Wed, 28 Mar 2018 08:38:20 +0200 (CEST) Message-ID: <1522216408.2363.10.camel@cybertec.at> Subject: Re: Issue with PostgreSQL replication and PITR From: Laurenz Albe To: Amee Sankhesara - Quipment India , "pgsql-general@postgresql.org" In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Date: Wed, 28 Mar 2018 07:53:28 +0200 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Amee Sankhesara - Quipment India wrote: > We have setup replication and PITR on this PostgreSQL server and wal files > for replication and PITR we are storing on the another server which is > shared with primary and secondary server. > > For doing some OS migration activity for the PostgreSQL database servers > We created two new replication server and promoted to new master server for the same > > During that activity one .partial file is created on master server and after > that wal files are not copied in shared folder from which secondary server > take it and restore it. All Wal files after .partial file are stored in pg_xlog > folder of master data so it is increasing size of data directory of master server. > > Wal files are not copying in shared location of master and secondary server but > still replication is running and on secondary server data is up to date. > > In logs getting only below warning : > Warning : The failed archive command was: > copy "D:\PostgreSQL\9.6\data\pg_xlog\0000000100000A88000000F8.partial" > "\\10.0.0.35\Archive_Replication\0000000100000A88000000F8.partial" > | copy "D:\PostgreSQL\9.6\data\pg_xlog\0000000100000A88000000F8.partial" > "\\10.0.0.35\Archive_PITR\0000000100000A88000000F8.partial" > > Can’t figure out that in shared folder wal files are not copied but still > secondary server is running in sync with master server. > > What could be reason behind this? If archiving is not working and the standby still can replicat, I would assume that streaming replication is configured. Is "primary_conninfo" defined in "recovery.conf"? Are there WAL sender and WAL receiver processes? > And how to remove this .partial file from pg_xlog safely and how to start > copying wal files from pg_xlog of master server to shared location of master > and secondary server ? You should try to figure out why your "archive_command" fails; perhaps try it by hand. Once you have got that fixed, archiving will continue normally. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com