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 1fdF9H-0005Gu-Ko for pgsql-admin@arkaria.postgresql.org; Wed, 11 Jul 2018 13:27:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fdF9F-0005TH-Lm for pgsql-admin@arkaria.postgresql.org; Wed, 11 Jul 2018 13:27:13 +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 1fdF9F-0005TA-Aw for pgsql-admin@lists.postgresql.org; Wed, 11 Jul 2018 13:27:13 +0000 Received: from hermes.gatewaynet.com ([193.92.121.98]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fdF9B-0002vU-4c for pgsql-admin@lists.postgresql.org; Wed, 11 Jul 2018 13:27:12 +0000 Received: from smadev.internal.net (pc131.internal.net [10.9.200.131]) by hermes.gatewaynet.com (8.14.3/8.14.3/Debian-9.4) with ESMTP id w6BDQwHH016192 for ; Wed, 11 Jul 2018 16:27:03 +0300 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id w6BDQwcK095272 for ; Wed, 11 Jul 2018 16:26:58 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: wal exist in slave but getting err requested WAL segment has already been removed To: pgsql-admin@lists.postgresql.org References: From: Achilleas Mantzios Message-ID: <9f931b88-725f-7020-ebb2-a2446b7ff9e6@matrix.gatewaynet.com> Date: Wed, 11 Jul 2018 16:26:58 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------8591CB29E91B01889A9E0E9A" Content-Language: en-US X-Virus-Scanned: clamav-milter 0.98.7 at hermes X-Virus-Status: Clean X-Spam-Status: No, score=-29.5 required=5.0 tests=ALL_TRUSTED,DYN_HAM_COORD, DYN_HAM_IT,DYN_HAM_NAUTICAL,DYN_HAM_SHORT_BODY,HTML_MESSAGE autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on hermes.gatewaynet.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------8591CB29E91B01889A9E0E9A Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 11/07/2018 16:09, Mariel Cherkassky wrote: > Hi, > I have in my cluster 3 nodes (1 master version 9.6.3+ 2 slaves version 9.6.3). I configured repmgr (with repmgrd active) v 4.0.4. > > Suddenly today after a few good weeks I noticed that there is a lag in one of the slaves and the error in the log indicated that the slave didnt get the wal : > > could not receive data from WAL stream: ERROR: requested WAL segment 0000000900002E61000000BD has already been removed > > However, when I check if the wal was recieveed : > postgres=# select pg_is_in_recovery(),pg_is_xlog_replay_paused(),pg_last_xlog_receive_location(),pg_last_xlog_replay_location(); >  pg_is_in_recovery | pg_is_xlog_replay_paused | pg_last_xlog_receive_location | pg_last_xlog_replay_location > -------------------+--------------------------+-------------------------------+------------------------------ >  t                 | f                        | 2E61/BDF5C000                 | 2E61/BDF5B930 > (1 row) > > and  I checked in pg_xlog directory : > ls -l ../pg_xlog/0000000900002E61000000BD > -rw------- 1 postgres postgres 16777216 Jul 11 11:13 ../pg_xlog/0000000900002E61000000BD > > and the xlog is exist. In which node did you check for the file? If the file in the primary is still available, try to compare their md5sum . If you have a working WAL shipping method in place, then add the appropriate line in the recovery.conf of your standby : restore_command = 'rsync somemachine:/somepath/pitr/%f "%p" ' > Now is my question, why the wal wasnt replayed ? > In my repmgr.conf I dont have any parameters regarding recovery just some basic things.  The recovery.conf file in the data directory : > > standby_mode = 'on' > primary_conninfo = 'host=xxxxxxx user=repmgr application_name=''psgsqldb2'' connect_timeout=2' > recovery_target_timeline = 'latest' > > > any idea ? -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt --------------8591CB29E91B01889A9E0E9A Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 11/07/2018 16:09, Mariel Cherkassky wrote:
Hi,
I have in my cluster 3 nodes (1 master version 9.6.3+ 2 slaves version 9.6.3). I configured repmgr (with repmgrd active) v 4.0.4.

Suddenly today after a few good weeks I noticed that there is a lag in one of the slaves and the error in the log indicated that the slave didnt get the wal : 

could not receive data from WAL stream: ERROR:  requested WAL segment 0000000900002E61000000BD has already been removed

However, when I check if the wal was recieveed : 
postgres=# select pg_is_in_recovery(),pg_is_xlog_replay_paused(),pg_last_xlog_receive_location(),pg_last_xlog_replay_location();
 pg_is_in_recovery | pg_is_xlog_replay_paused | pg_last_xlog_receive_location | pg_last_xlog_replay_location 
-------------------+--------------------------+-------------------------------+------------------------------
 t                 | f                        | 2E61/BDF5C000                 | 2E61/BDF5B930
(1 row)

and  I checked in pg_xlog directory : 
ls -l ../pg_xlog/0000000900002E61000000BD
-rw------- 1 postgres postgres 16777216 Jul 11 11:13 ../pg_xlog/0000000900002E61000000BD

and the xlog is exist.

In which node did you check for the file?
If the file in the primary is still available, try to compare their md5sum .
If you have a working WAL shipping method in place, then add the appropriate line in the recovery.conf of your standby :
restore_command = 'rsync somemachine:/somepath/pitr/%f "%p" '

Now is my question, why the wal wasnt replayed ?
In my repmgr.conf I dont have any parameters regarding recovery just some basic things.  The recovery.conf file in the data directory : 

standby_mode = 'on'
primary_conninfo = 'host=xxxxxxx user=repmgr application_name=''psgsqldb2'' connect_timeout=2'
recovery_target_timeline = 'latest'


any idea ? 


-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt
--------------8591CB29E91B01889A9E0E9A--