Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5mIv-0004FW-9d for pgsql-general@arkaria.postgresql.org; Fri, 28 Sep 2018 06:31:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5mIt-0002Tj-Fq for pgsql-general@arkaria.postgresql.org; Fri, 28 Sep 2018 06:31:07 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5mIt-0002Tb-7v for pgsql-general@lists.postgresql.org; Fri, 28 Sep 2018 06:31:07 +0000 Received: from mx1.mailbox.org ([2001:67c:2050:104:0:1:25:1]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g5mIq-0004wN-0e for pgsql-general@lists.postgresql.org; Fri, 28 Sep 2018 06:31:06 +0000 Received: from smtp1.mailbox.org (unknown [IPv6:2001:67c:2050:105:465:1:1:0]) (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 43B00494D7; Fri, 28 Sep 2018 08:31:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id 8_pOv7eVdxp2; Fri, 28 Sep 2018 08:30:58 +0200 (CEST) Message-ID: Subject: Re: Replication Issues From: Laurenz Albe To: bhargav kamineni , pgsql-general@lists.postgresql.org Date: Fri, 28 Sep 2018 08:30:57 +0200 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk bhargav kamineni wrote: > Hi Team, > > I have configured replication using slot ,But it failed by throwing the > ERROR pg_basebackup: could not get transaction log end position from server: > ERROR: requested WAL segment 0000000100002C9D00000085 has already been removed , > which is unexpected because i have created the slot on master first > and then issued the base backup command from slave's end > the command is > usr/lib/postgresql/9.5/bin/pg_basebackup -U user --max-rate='150 M' --progress --verbose --write-recovery-conf --status-interval='10 s' -D data_dir -h host_ip -p 5433 > These are the settings on my master > archive_mode=on > archive_command='/bin/true' > wal_keep_segments=512 > max_wal_senders=4 > Series of steps i have followed : > 1) Enabled password less authentication between master and slave > 2)created slot on master (assuming it will store wal's regardless of other settings) > 3)started basebackup from slave's end > 4)Issued checkpoint at master's end > > Here my concern is , slave should recover WAL from replication slot but why i > got the above ERROR , Why slot removed the requested wal file , Could you please > let me know the reason why it happened or did i miss something ? I guess your base backup took long enough for the required WAL segments to be removed by the time it was done. To prevent that, create a replication slot *before* you perform pg_basebackup and use the options "-S -X stream" of pg_basebackup. You then use the same slot in "recovery.conf". That way you cannot lose any WAL. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com