Could not read from file "pg_clog/0003" at offset 163840: Success
来源:互联网 发布:积分商城系统源码 编辑:程序博客网 时间:2024/05/22 18:55
最近做postgresql+drbd+heartbeat,在primary机突然断电后,slave机切换为primary正常,但数据库无法启动,错误如下:
frank@node1:~/cas/bin$ sudo /etc/init.d/postgresql start
* Starting PostgreSQL 9.3 database server
* The PostgreSQL server failed to start. Please check the log output:
2017-11-29 17:12:01 CST LOG: database system was interrupted; last known up at 2017-11-29 16:55:13 CST
2017-11-29 17:12:01 CST LOG: database system was not properly shut down; automatic recovery in progress
2017-11-29 17:12:01 CST LOG: record with zero length at 6/1C8E33B0
2017-11-29 17:12:01 CST LOG: redo is not required
2017-11-29 17:12:01 CST FATAL: could not access status of transaction 3805721
2017-11-29 17:12:01 CST DETAIL: Could not read from file "pg_clog/0003" at offset 163840: Success.
2017-11-29 17:12:01 CST LOG: startup process (PID 3452) exited with exit code 1
2017-11-29 17:12:01 CST LOG: aborting startup due to startup process failure
经查询资料,参考网友对类似问题的回复(url: https://www.postgresql.org/message-id/29313.1222261821@sss.pgh.pa.us):
You need to make the files the right size (256K of zeroes).A suitable "dd" from /dev/zero will accomplish this on modernUnixen (ie, anything that has /dev/zero).Note that this is by no means a fix, it simply allows pg_dump tocomplete. What you are really doing by filling those files withzeroes is saying "assume all these old transactions aborted".You *will* have data loss. It will only affect rows that haven'tbeen accessed in a very long time (since at least June, looks like)but gone is gone.Another possibility that might be better is to fill the files with0x55, though this is harder since /dev/zero won't help. That wouldforce all the old transactions to be considered committed rather thanaborted. This isn't really better from a consistency standpoint, butif you feel that most of your data-altering commands succeed thenthis might give you a closer approximation to the state you want.The whole thing is pretty troubling because 8.2.x is supposed tocontain defenses against this type of problem. Could we seethe contents of "select datname, datfrozenxid from pg_database"?Also, have you tried dumping individual databases instead ofpg_dumpall? (It would be good to experiment with that beforeyou start making bogus pg_clog files; once you do that there'sno going back in terms of recovering the true state of your data.)执行如下命令后问题解决(虽然可能丢失部分数据,但对我来说可以接受):
sudo dd if=/dev/zero of=/rep/postgresql/data/pg_clog/0003 bs=1k count=256
- Could not read from file "pg_clog/0003" at offset 163840: Success
- Could not read input channel file descriptors from parcel
- Could not read input channel file descriptors from parcel.
- 解决Could not read input channel file descriptors from parcel
- RunTimeException-Could not read input channel file descriptors from parcel
- Could not read input channel file descriptors from parcel
- cscope: cannot read trailer offset from file cscope.out
- java.lang.RuntimeException: Could not read input channel file descriptors from parcel.
- OSG could not find plugin to read objects from file xxx.xxx
- OSG中could not find plugin to read objects from file
- fatal: Could not read from remote repository
- Could not read from remote repository.
- Could not read from remote repository
- could not read data from '/Users/iamme/Documents/XCode/myapp/myapp/myapp-Info.plist': The file “myap
- could not read data from '/Users/xxxx/xxxx/Info.plist': The file “Info.plist” couldn’t be opened
- could not read data from 'Configurat'/Info.plist': The file “plist” couldn’t be opened because there
- could not read data from '/Users/xxxx/xxxx/Info.plist': The file “Info.plist” couldn’t be opened
- could not read data from '/Users/xxxx/xxxx/Info.plist': The file “Info.plist” couldn’t be opened
- 自定义控件(一) Activity的构成(PhoneWindow、DecorView)
- 统计字符个数
- 【已解决】surface 触控笔pen 笔帽可以用,笔头触控不能用了了
- Android6.0指纹识别详解
- 第二次学习总结
- Could not read from file "pg_clog/0003" at offset 163840: Success
- java线程概念区别
- 分答项目_知识点:微信h5支付1
- to_date() 与 to_char() 日期和字符串转换
- 金海佳学C++primer 练习9.14
- innodb和myISAM 1075
- 32位汇编语法总结
- 3D造型引擎3D ACIS Modeling 发布2018.1.0版本
- 1009. 说反话 (20)