我正在使用Centos 6和PostgresSQL 9.4。在我的配置文件中,启用了fsync和full_page_writes选项。有一点,我的机器崩溃并重新启动。之后,我检查了我的数据库,所有条目都被错误更新。我的整个数据库都完全改变了。我读到了关于fsync的信息,它将自动恢复一致的数据。但为什么我的数据库被错误地更新了???。
而且我还需要哪个时间我的postgres服务器关闭并重新启动? 然后使用哪个检查点来更新Postgres数据库。 如何使用fsync使数据库免受机器崩溃或电源故障的影响?
此命令的输出
sudo -u postgres /usr/pgsql-9.4/bin/pg_controldata /var/lib/pgsql/9.4/data/
pg_control version number: 942
Catalog version number: 201409291
Database system identifier: 6229523677101845380
Database cluster state: in production
pg_control last modified: Thu 05 May 2016 05:52:04 AM EST
Latest checkpoint location: 0/2B7A1518
Prior checkpoint location: 0/2B79D5C0
Latest checkpoint's REDO location: 0/2B7A1518
Latest checkpoint's REDO WAL file: 00000001000000000000002B
Latest checkpoint's TimeLineID: 1
Latest checkpoint's PrevTimeLineID: 1
Latest checkpoint's full_page_writes: on
Latest checkpoint's NextXID: 0/1141605
Latest checkpoint's NextOID: 78367
Latest checkpoint's NextMultiXactId: 1
Latest checkpoint's NextMultiOffset: 0
Latest checkpoint's oldestXID: 1800
Latest checkpoint's oldestXID's DB: 1
Latest checkpoint's oldestActiveXID: 0
Latest checkpoint's oldestMultiXid: 1
Latest checkpoint's oldestMulti's DB: 1
Time of latest checkpoint: Thu 05 May 2016 05:52:04 AM EST
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: minimal
Current wal_log_hints setting: off
Current max_connections setting: 100
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