Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WQK1p-0001Yb-B5 for pgsql-performance@arkaria.postgresql.org; Wed, 19 Mar 2014 17:11:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WQK1o-0001gT-5x for pgsql-performance@arkaria.postgresql.org; Wed, 19 Mar 2014 17:11:44 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WQK1m-0001dw-8f for pgsql-performance@postgresql.org; Wed, 19 Mar 2014 17:11:42 +0000 Received: from mail-ee0-x235.google.com ([2a00:1450:4013:c00::235]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WQK1i-0007KI-TK for pgsql-performance@postgresql.org; Wed, 19 Mar 2014 17:11:41 +0000 Received: by mail-ee0-f53.google.com with SMTP id b57so6143609eek.26 for ; Wed, 19 Mar 2014 10:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=OCT0qYDMOTZJqy2v9BOeW/8ijLkCN2QgnJBrKqZA9Ps=; b=JSaQVLGYRl3RCvzixIJfEMZ9iuKLwF87Y9wF8js3sobksY4Jm7FkFbBiG5PfTNA6K1 bgRNNh7hUvgKFC4OL2SWpuxI4Z6mkg5SEaZVlSamHfUYF5ojy01+woEbQV5Qlz6+w5Ln mf7/tu1xBBo+0MQQddVf4vEniZsjyo9mLzSqBtN+HW21URZbYQn/aiNyzgmiqfDe4HZ7 jlqrhllEfgYOe0d36ZqkWyTJgM5zwINBT8ALiURC7WociCKsO3fBTQfN7Bfzy8ObuWtk UPNeMphlHDB2d1PJ33FJJj7JbM4LrbdA39lT5kIU1qDI9rnmUDOC3TiRnYZdayUVb0K1 SnbA== X-Received: by 10.15.64.75 with SMTP id n51mr28569922eex.33.1395249097621; Wed, 19 Mar 2014 10:11:37 -0700 (PDT) Received: from wgaybook.corp.wargaming.local (by1-office.wargaming.net. [178.172.239.241]) by mx.google.com with ESMTPSA id m1sm55906865een.7.2014.03.19.10.11.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Mar 2014 10:11:36 -0700 (PDT) From: Evgeniy Shishkin Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: slave wal is ahead of master Message-Id: <561E3FF0-C1B4-448A-AB33-176540E72D16@gmail.com> Date: Wed, 19 Mar 2014 20:10:22 +0300 To: "pgsql-performance@postgresql.org list" Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) X-Mailer: Apple Mail (2.1874) X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Hello,=20 we have 3 servers with postgresql 9.3.3. One is master and two slaves. We run synchronous_replication and fsync, synchronous_commit and full_page_= writes are on. Suddenly master hang up with hardware failure, it is a strange bug in iLo w= hich we investigate with HP. Before master was rebooted, i ran ps aux on slave postgres: wal receiver process streaming 12/F1031DF8 Last messages in slaves logs was 2014-03-19 02:41:29.005 GMT,,,7389,,53108c69.1cdd,16029,,2014-02-28 13:17:2= 9 GMT,,0,LOG,00000,"recovery restart point at 12/DFFBB3E8","last completed = transaction was at log time 2014-03-19 02:41:28.886869+00",,,,,,,,"" and then there was silence, because master hang. Then master was rebooted and slave wrote in log 2014-03-19 15:36:39.176 GMT,,,7392,,53108c69.1ce0,2,,2014-02-28 13:17:29 GM= T,,0,FATAL,XX000,"terminating walreceiver due to timeout",,,,,,,,,"" 2014-03-19 15:36:39.177 GMT,,,7388,,53108c69.1cdc,6,,2014-02-28 13:17:29 GM= T,1/0,0,LOG,00000,"record with zero length at 12/F1031DF8",,,,,,,,,"" 2014-03-19 15:36:57.181 GMT,,,12100,,5329b996.2f44,1,,2014-03-19 15:36:54 G= MT,,0,FATAL,XX000,"could not connect to the primary server: could not conne= ct to server: No route to host Is the server running on host ""10.162.2.50"" and accepting TCP/IP connections on port 5432? ",,,,,,,,,"" Then master finally came back, slave wrote 2014-03-19 15:40:09.389 GMT,,,13121,,5329ba59.3341,1,,2014-03-19 15:40:09 G= MT,,0,FATAL,XX000,"could not connect to the primary server: FATAL: the dat= abase system is starting up ",,,,,,,,,"" 2014-03-19 15:40:16.468 GMT,,,13136,,5329ba5e.3350,1,,2014-03-19 15:40:14 G= MT,,0,LOG,00000,"started streaming WAL from primary at 12/F1000000 on timel= ine 1",,,,,,,,,"" 2014-03-19 15:40:16.468 GMT,,,13136,,5329ba5e.3350,2,,2014-03-19 15:40:14 G= MT,,0,FATAL,XX000,"could not receive data from WAL stream: ERROR: requeste= d starting point 12/F1000000 is ahead of the WAL flush position of this ser= ver 12/F0FFFCE8 ",,,,,,,,,"" last message was repeated several times and then this happened 2014-03-19 15:42:04.623 GMT,,,13722,,5329bacc.359a,1,,2014-03-19 15:42:04 G= MT,,0,LOG,00000,"started streaming WAL from primary at 12/F1000000 on timel= ine 1",,,,,,,,,"" 2014-03-19 15:42:04.628 GMT,,,7388,,53108c69.1cdc,7,,2014-02-28 13:17:29 GM= T,1/0,0,LOG,00000,"invalid record length at 12/F1031DF8",,,,,,,,,"" 2014-03-19 15:42:04.628 GMT,,,13722,,5329bacc.359a,2,,2014-03-19 15:42:04 G= MT,,0,FATAL,57P01,"terminating walreceiver process due to administrator com= mand",,,,,,,,,"" 2014-03-19 15:42:09.628 GMT,,,7388,,53108c69.1cdc,8,,2014-02-28 13:17:29 GM= T,1/0,0,LOG,00000,"invalid record length at 12/F1031DF8",,,,,,,,,"" 2014-03-19 15:42:14.628 GMT,,,7388,,53108c69.1cdc,9,,2014-02-28 13:17:29 GM= T,1/0,0,LOG,00000,"invalid record length at 12/F1031DF8",,,,,,,,,"" 2014-03-19 15:42:19.628 GMT,,,7388,,53108c69.1cdc,10,,2014-02-28 13:17:29 G= MT,1/0,0,LOG,00000,"invalid record length at 12/F1031DF8",,,,,,,,,=94"=20 and it just repeats forever. Meanwhile on master 2014-03-19 15:39:30.957 GMT,,,7115,,5329ba32.1bcb,2,,2014-03-19 15:39:30 GM= T,,0,LOG,00000,"database system was not properly shut down; automatic recov= ery in progress",,,,,,,,,"" 2014-03-19 15:39:30.989 GMT,,,7115,,5329ba32.1bcb,3,,2014-03-19 15:39:30 GM= T,,0,LOG,00000,"redo starts at 12/DFFBB3E8",,,,,,,,,"" 2014-03-19 15:39:47.114 GMT,,,7115,,5329ba32.1bcb,4,,2014-03-19 15:39:30 GM= T,,0,LOG,00000,"redo done at 12/F0FFFC38",,,,,,,,,"" 2014-03-19 15:39:47.114 GMT,,,7115,,5329ba32.1bcb,5,,2014-03-19 15:39:30 GM= T,,0,LOG,00000,"last completed transaction was at log time 2014-03-19 05:02= :29.273138+00",,,,,,,,,"" 2014-03-19 15:39:47.115 GMT,,,7115,,5329ba32.1bcb,6,,2014-03-19 15:39:30 GM= T,,0,LOG,00000,"checkpoint starting: end-of-recovery immediate",,,,,,,,,"" 2014-03-19 15:40:16.466 GMT,"replicator","",7986,"10.162.2.52:44336",5329ba= 5e.1f32,1,"idle",2014-03-19 15:40:14 GMT,2/0,0,ERROR,XX000,"requested start= ing point 12/F1000000 is ahead of the WAL flush position of this server 12/= F0FFFCE8",,,,,,,,,"walreceiver" So, all two slaves are disconnected from master, which somehow is past his = slaves. I decided to promote one of the slaves, so we can have some snapshot of the= data. relevant logs from this are=20 2014-03-19 16:50:43.118 GMT,,,4444,,5329cae3.115c,3,,2014-03-19 16:50:43 GM= T,,0,LOG,00000,"redo starts at 12/DFFBB3E8",,,,,,,,,"" 2014-03-19 16:50:50.028 GMT,"dboperator","postgres",4452,"[local]",5329caea= .1164,1,"",2014-03-19 16:50:50 GMT,,0,FATAL,57P03,"the database system is s= tarting up",,,,,,,,,"" 2014-03-19 16:50:51.128 GMT,,,4444,,5329cae3.115c,4,,2014-03-19 16:50:43 GM= T,,0,LOG,00000,"invalid contrecord length 5736 at 12/F0FFFC80",,,,,,,,,"" 2014-03-19 16:50:51.128 GMT,,,4444,,5329cae3.115c,5,,2014-03-19 16:50:43 GM= T,,0,LOG,00000,"redo done at 12/F0FFFC38",,,,,,,,,=94=94 It is interesting that redo done at 12/F0FFFC38 both on master and promoted= slave. The main question is there is actual latest data, and how is it possible th= at master is behind his slave in synchronous replication. Thanks for the help. --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance