could not locate required checkpoint record
いつものCentOS4.6+PostgreSQL8.3.1+VMwarePlayerを2つ使って、スタンバイDBを構築したところ、スタンバイ側が起動しない。。。pg_logにあるログを見てみると、
LOG: database system was interrupted; last known up at 2008-05-14 10:53:49 JST LOG: starting archive recovery LOG: restore_command = 'pg_standby -l -d -s 2 -t /tmp/pgsql.trigger /var/lib/pgsql/backups %f %p %r 2>>/var/lib/pgsql/s tandby.log' LOG: restored log file "000000010000000000000001.00000020.backup" from archive LOG: restored log file "000000010000000000000001" from archive LOG: WAL file is from different system DETAIL: WAL file SYSID is 5200054916662099573, pg_control SYSID is 5200044492776461819 LOG: invalid checkpoint record PANIC: could not locate required checkpoint record HINT: If you are not restoring from a backup, try removing the file "/var/lib/pgsql/data/backup_label". LOG: startup process (PID 7403) was terminated by signal 6: Aborted LOG: aborting startup due to startup process failure
なんですか、「invalid checkpoint record」って。。。
で、ログをよく見てみると
HINT: If you are not restoring from a backup, try removing the file "/var/lib/pgsql/data/backup_label".
とあるので、確認してみると、
$ ls /var/lib/pgsql/data/backup_label /var/lib/pgsql/data/backup_label $ cat backup_label START WAL LOCATION: 0/1000020 (file 000000010000000000000001) CHECKPOINT LOCATION: 0/1000020 START TIME: 2008-05-14 11:29:33 JST LABEL: Label $
ベースバックアップを取ったときに作られるファイルでした。で、これを
$ rm /var/lib/pgsql/data/backup_label
$
してやると、問題なく起動。あー、びっくりした。