0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【PostgreSQL】【障害】WAL破損

Posted at

◆破損
echo "test">000000070000000000000017

◆ログ
cp: cannot create regular file ‘/tmp/pg_bkup_data/archdir/000000070000000000000017’: No such file or directory
LOG: archive command failed with exit code 1
DETAIL: The failed archive command was: cp pg_xlog/000000070000000000000017 /tmp/pg_bkup_data/archdir/000000070000000000000017

※DB操作は更新処理含め、普通に継続できる。
 上記ログが定期的に出力される。

◆DB停止
pg_ctl stop

◆ログリセット
・トランザクションID調査
-bash-4.2$ cd pg_clog/
-bash-4.2$ ls -lrt
total 8
-rw-------. 1 postgres postgres 8192 Oct 30 05:05 0000
-bash-4.2$

・リセット
IDに1を足して後ろにゼロを5つ
pg_resetxlog -x 0x100000 ${PGDATA}

◆DB起動
pg_ctl start

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?