Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aEeMp-0004z4-CO for pgsql-bugs@arkaria.postgresql.org; Thu, 31 Dec 2015 14:38:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aEeMo-0000gd-VG for pgsql-bugs@arkaria.postgresql.org; Thu, 31 Dec 2015 14:38:15 +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.84) (envelope-from ) id 1aENEL-0006hj-5v for pgsql-bugs@postgresql.org; Wed, 30 Dec 2015 20:20:21 +0000 Received: from ebb09.tieto.com ([131.207.176.19]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aENEG-0004QB-QL for pgsql-bugs@postgresql.org; Wed, 30 Dec 2015 20:20:19 +0000 X-AuditID: 83cfb013-f792c6d000004e8f-d3-56843c7f003a Received: from C105S135VM023.eu.tieto.com ( [10.34.8.119]) by ebb09.tieto.com (SMTP Mailer) with SMTP id C2.16.20111.F7C34865; Wed, 30 Dec 2015 22:20:15 +0200 (EET) Received: from C105S135VM024.eu.tieto.com (10.34.8.120) by C105S135VM023.eu.tieto.com (10.34.8.119) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Wed, 30 Dec 2015 22:20:14 +0200 Received: from C105S135VM024.eu.tieto.com ([fe80::6947:b832:8826:ca2c]) by C105S135VM024.eu.tieto.com ([fe80::6947:b832:8826:ca2c%19]) with mapi id 15.00.1130.005; Wed, 30 Dec 2015 22:20:14 +0200 From: To: CC: , Subject: Re: BUG #13822: Slave terminated - WAL contains references to invalid page Thread-Topic: [BUGS] BUG #13822: Slave terminated - WAL contains references to invalid page Thread-Index: AQHROVGaCvk7hBdZtUWM+Zrh0Km7B57WtPPAgAZ1z4CAAxrzMIAALwAAgAG3fdCAAS/ZAIAAqiGp Date: Wed, 30 Dec 2015 20:20:14 +0000 Message-ID: <1451506840099.98963@tieto.com> References: <20151217125025.6916.26898@wrigleys.postgresql.org> <5f921d78aaa04807b4c809e0ff130b11@C105S135VM024.eu.tieto.com> , <20151230114914.xb5rrsj6yqxzom3v@alap3.anarazel.de> In-Reply-To: <20151230114914.xb5rrsj6yqxzom3v@alap3.anarazel.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [131.207.230.52] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNKsWRmVeSWpSXmKPExsXCpcRRrltv0xJm8PW0kMWxHV0sFhMeZ1lc 6J3L7MDscaSnl81j56y77B4X9k1jD2CO4rJJSc3JLEst0rdL4Mq43dDFVrAtreJJI28D40b/ LkYODgkBE4mrTUxdjJxAppjEhXvr2UBsIYFljBKLJzF2MXIB2TsYJX7cWMIK4RxnlNg65Sgr SBWbgIzEi0VtYLaIgITEy+atYN3MAjYSexbNZAGxhQViJO6t72eDqImV6Fj8hAXCjpI4uXst I8gRLAKqEl9PpoGEeQW0JRa3LWWH2NXBInFz6m92kASngIPEpoOHweYwAl36/dQaJohd4hK3 nsyH+kBAYsme88wQtqjEy8f/WCFsA4mtS/exQNhKEp9+TGOF6NWTuDF1CtTN2hLLFr5mhjhC UOLkzCcsExglZiFZMQtJyywkLbOQtCxgZFnFyJ+alGRgqVeSmVqSr5ecn7uJERhzzec3CO9g 7JjifIhRgINRiYd3tWZLmBBrYllxZe4hRkkOJiVR3pXSQCG+pPyUyozE4oz4otKc1OJDjBIc zEoivA90gHK8KYmVValF+TApaQ4WJXHeTaubw4QE0hNLUrNTUwtSi2CyMhwcShK8ltZAjYJF qempFWmZOSUIaSYOTpDhPEDDj1iBDC8uSMwtzkyHyJ9i1OZYN/fGWiaONbPvr2USYsnLz0uV EudVBBknAFKaUZoHN+0VozjQU8K800CyPMAUCzfnFdAKJqAVP7qaQVaUJCKkpBoYqz5/Xm3Y 63hCWjhxZ9iH3BihVUcKfn979OXzCqva2okVZS3u82WrTbd8U9IvdTf5zyWk+DLiofzpTVXG +36c9FCS9T/9XrJxRVi0+poZtZkVN17dl7geekr6fLjn2oaTM1icUs53WU8Sk4g5bjF3a5Hj V0Ppjc/nFXNp77mflHLy60yzutJFSizFGYmGWsxFxYkAd58QrW4DAAA= X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Hi, I created new replica (original one crashed 2015-12-15 13:05:39 CET) via:=20 $ pg_basebackup -h -D $PGDATA -R -P -U replication --xlog-metho= d=3Dstream $ cat $PGDATA/recovery.conf=20 standby_mode =3D 'on' primary_conninfo =3D 'user=3Dreplication password=3D*** host=3D = port=3D5432 sslmode=3Dprefer sslcompression=3D1 krbsrvname=3Dpostgres' # service postgresql-9.4 start This new replica crashed 2015-12-22 00:25:11 CET. Ordinary base backups are done by: /usr/pgsql-9.4/bin/pg_basebackup -h -D -Ft -z -v -Xf -U postgres Running Master pg_controldata: pg_control version number: 942 Catalog version number: 201409291 Database system identifier: 6225208935473175762 Database cluster state: in production pg_control last modified: Wed 30 Dec 2015 08:00:02 PM CET Latest checkpoint location: 191/2E08DC90 Prior checkpoint location: 191/2E0829E0 Latest checkpoint's REDO location: 191/2E08DC58 Latest checkpoint's REDO WAL file: 00000001000001910000002E Latest checkpoint's TimeLineID: 1 Latest checkpoint's PrevTimeLineID: 1 Latest checkpoint's full_page_writes: on Latest checkpoint's NextXID: 0/370154188 Latest checkpoint's NextOID: 4803404 Latest checkpoint's NextMultiXactId: 161565 Latest checkpoint's NextMultiOffset: 410484 Latest checkpoint's oldestXID: 187316348 Latest checkpoint's oldestXID's DB: 16422 Latest checkpoint's oldestActiveXID: 370154188 Latest checkpoint's oldestMultiXid: 1 Latest checkpoint's oldestMulti's DB: 16422 Time of latest checkpoint: Wed 30 Dec 2015 08:00:01 PM CET Fake LSN counter for unlogged rels: 0/1 Minimum recovery ending location: 0/0 Min recovery ending loc's timeline: 0 Backup start location: 0/0 Backup end location: 0/0 End-of-backup record required: no Current wal_level setting: hot_standby Current wal_log_hints setting: off Current max_connections setting: 600 Current max_worker_processes setting: 8 Current max_prepared_xacts setting: 0 Current max_locks_per_xact setting: 64 Maximum data alignment: 8 Database block size: 8192 Blocks per segment of large relation: 131072 WAL block size: 8192 Bytes per WAL segment: 16777216 Maximum length of identifiers: 64 Maximum columns in an index: 32 Maximum size of a TOAST chunk: 1996 Size of a large-object chunk: 2048 Date/time type storage: 64-bit integers Float4 argument passing: by value Float8 argument passing: by value Data page checksum version: 0 Running Slave pg_controldata: pg_control version number: 942 Catalog version number: 201409291 Database system identifier: 6225208935473175762 Database cluster state: in archive recovery pg_control last modified: Wed 30 Dec 2015 08:00:40 PM CET Latest checkpoint location: 191/2E08DC90 Prior checkpoint location: 191/2E0829E0 Latest checkpoint's REDO location: 191/2E08DC58 Latest checkpoint's REDO WAL file: 00000001000001910000002E Latest checkpoint's TimeLineID: 1 Latest checkpoint's PrevTimeLineID: 1 Latest checkpoint's full_page_writes: on Latest checkpoint's NextXID: 0/370154188 Latest checkpoint's NextOID: 4803404 Latest checkpoint's NextMultiXactId: 161565 Latest checkpoint's NextMultiOffset: 410484 Latest checkpoint's oldestXID: 187316348 Latest checkpoint's oldestXID's DB: 16422 Latest checkpoint's oldestActiveXID: 370154188 Latest checkpoint's oldestMultiXid: 1 Latest checkpoint's oldestMulti's DB: 16422 Time of latest checkpoint: Wed 30 Dec 2015 08:00:01 PM CET Fake LSN counter for unlogged rels: 0/1 Minimum recovery ending location: 191/2E093C68 Min recovery ending loc's timeline: 1 Backup start location: 0/0 Backup end location: 0/0 End-of-backup record required: no Current wal_level setting: hot_standby Current wal_log_hints setting: off Current max_connections setting: 600 Current max_worker_processes setting: 8 Current max_prepared_xacts setting: 0 Current max_locks_per_xact setting: 64 Maximum data alignment: 8 Database block size: 8192 Blocks per segment of large relation: 131072 WAL block size: 8192 Bytes per WAL segment: 16777216 Maximum length of identifiers: 64 Maximum columns in an index: 32 Maximum size of a TOAST chunk: 1996 Size of a large-object chunk: 2048 Date/time type storage: 64-bit integers Float4 argument passing: by value Float8 argument passing: by value Data page checksum version: 0 Slave pg_controldata after second PITR attempt: pg_control version number: 942 Catalog version number: 201409291 Database system identifier: 6225208935473175762 Database cluster state: shut down in recovery pg_control last modified: Wed 30 Dec 2015 08:53:51 PM CET Latest checkpoint location: 187/9DA56658 Prior checkpoint location: 186/D7000060 Latest checkpoint's REDO location: 187/9D647E30 Latest checkpoint's REDO WAL file: 00000001000001870000009D Latest checkpoint's TimeLineID: 1 Latest checkpoint's PrevTimeLineID: 1 Latest checkpoint's full_page_writes: on Latest checkpoint's NextXID: 0/367008737 Latest checkpoint's NextOID: 4721484 Latest checkpoint's NextMultiXactId: 160851 Latest checkpoint's NextMultiOffset: 409011 Latest checkpoint's oldestXID: 187316348 Latest checkpoint's oldestXID's DB: 16422 Latest checkpoint's oldestActiveXID: 367008737 Latest checkpoint's oldestMultiXid: 1 Latest checkpoint's oldestMulti's DB: 16422 Time of latest checkpoint: Tue 22 Dec 2015 12:21:40 AM CET Fake LSN counter for unlogged rels: 0/1 Minimum recovery ending location: 187/9FECB9A0 Min recovery ending loc's timeline: 1 Backup start location: 0/0 Backup end location: 0/0 End-of-backup record required: no Current wal_level setting: hot_standby Current wal_log_hints setting: off Current max_connections setting: 600 Current max_worker_processes setting: 8 Current max_prepared_xacts setting: 0 Current max_locks_per_xact setting: 64 Maximum data alignment: 8 Database block size: 8192 Blocks per segment of large relation: 131072 WAL block size: 8192 Bytes per WAL segment: 16777216 Maximum length of identifiers: 64 Maximum columns in an index: 32 Maximum size of a TOAST chunk: 1996 Size of a large-object chunk: 2048 Date/time type storage: 64-bit integers Float4 argument passing: by value Float8 argument passing: by value Data page checksum version: 0 # cat backup_label.old=20 START WAL LOCATION: 186/D7000028 (file 0000000100000186000000D7) CHECKPOINT LOCATION: 186/D7000060 BACKUP METHOD: streamed BACKUP FROM: master START TIME: 2015-12-21 19:00:03 CET LABEL: pg_basebackup base backup Slave's pg_controldata above after PITR has been created after second recov= ery attempt. To be honest I don't understand why this second PITR finished without PANIC= when previous attempt from the same base backup and archived wals failed. See logs details below: First (crashed) PITR: 2015-12-30 08:31:19 CET @ LOG: database system was interrupted; last know= n up at 2015-12-21 20:15:02 CET 2015-12-30 08:31:19 CET @ LOG: starting point-in-time recovery to 2015-12= -22 00:30:00+01 2015-12-30 08:31:19 CET @ LOG: database system was not properly shut down= ; automatic recovery in progress 2015-12-30 08:31:19 CET @ LOG: redo starts at 186/D7260540 2015-12-30 08:31:19 CET @ LOG: consistent recovery state reached at 186/D= 8000000 2015-12-30 08:31:19 CET @ LOG: database system is ready to accept read on= ly connections 2015-12-30 08:31:19 CET @ LOG: restored log file "0000000100000186000000D= 8" from archive 2015-12-30 08:31:20 CET @ LOG: restored log file "0000000100000186000000D= 9" from archive /.../ 2015-12-30 08:32:48 CET @ LOG: restored log file "00000001000001870000009= D" from archive 2015-12-30 08:32:50 CET @ LOG: restored log file "00000001000001870000009= E" from archive 2015-12-30 08:32:51 CET @ WARNING: page 73172 of relation base/16422/2325= 3 is uninitialized 2015-12-30 08:32:51 CET @ CONTEXT: xlog redo visible: rel 1663/16422/2325= 3; blk 73172 2015-12-30 08:32:51 CET @ PANIC: WAL contains references to invalid pages 2015-12-30 08:32:51 CET @ CONTEXT: xlog redo visible: rel 1663/16422/2325= 3; blk 73172 2015-12-30 08:32:51 CET @ LOG: startup process (PID 29324) was terminated= by signal 6: Aborted 2015-12-30 08:32:51 CET @ LOG: terminating any other active server proces= ses For this one unfortunatelly I don't have pg_controldata. Second one: 2015-12-30 20:42:39 CET @ LOG: database system was interrupted; last know= n up at 2015-12-21 20:15:02 CET 2015-12-30 20:42:39 CET @ LOG: starting point-in-time recovery to 2015-12= -22 00:30:00+01 2015-12-30 20:42:39 CET @ LOG: restored log file "0000000100000186000000D= 7" from archive 2015-12-30 20:42:39 CET @ LOG: redo starts at 186/D7000028 2015-12-30 20:42:39 CET @ LOG: consistent recovery state reached at 186/D= 7265F80 2015-12-30 20:42:39 CET @ LOG: database system is ready to accept read on= ly connections 2015-12-30 20:42:40 CET @ LOG: restored log file "0000000100000186000000D= 8" from archive 2015-12-30 20:42:40 CET @ LOG: restored log file "0000000100000186000000D= 9" from archive /.../ 2015-12-30 20:44:03 CET @ LOG: restored log file "00000001000001870000009= D" from archive 2015-12-30 20:44:05 CET @ LOG: restored log file "00000001000001870000009= E" from archive 2015-12-30 20:44:08 CET @ LOG: restored log file "00000001000001870000009= F" from archive 2015-12-30 20:44:10 CET @ LOG: recovery stopping before commit of transac= tion 367008747, time 2015-12-22 00:30:01.876776+01 2015-12-30 20:44:10 CET @ LOG: recovery has paused 2015-12-30 20:44:10 CET @ HINT: Execute pg_xlog_replay_resume() to contin= ue. Regards Marek ________________________________________ From: Andres Freund Sent: Wednesday, December 30, 2015 12:49 PM To: Petr Marek Cc: michael.paquier@gmail.com; pgsql-bugs@postgresql.org Subject: Re: [BUGS] BUG #13822: Slave terminated - WAL contains references = to invalid page Hi, On 2015-12-29 15:51:32 +0000, Marek.Petr@tieto.com wrote: > I used fresh base backup for slave after both crashes. > Also tried to scan archived wals several hours before last crash and foun= d only the following for string 71566: > > rmgr: Heap2 len (rec/tot): 20/ 52, tx: 0, lsn: 187/= 987859D8, prev 187/987859A0, bkp: 0000, desc: visible: rel 1663/16422/17216= ; blk 71566 > rmgr: Heap2 len (rec/tot): 20/ 52, tx: 0, lsn: 187/= 9CC59020, prev 187/9CC58FE8, bkp: 0000, desc: visible: rel 1663/16422/17220= ; blk 71566 > rmgr: Heap2 len (rec/tot): 20/ 52, tx: 0, lsn: 187/= 9E356D98, prev 187/9E356D60, bkp: 0000, desc: visible: rel 1663/16422/23253= ; blk 71566 Could you detail how you take base backups and how you set them up as new replicas? Master's pg_controldata, the crashed standby's and the standby's backup_label.old would be helpful. Greetings, Andres Freund --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs