博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PostgreSQL 9.3 beta2 stream replication primary standby switchover bug?
阅读量:6981 次
发布时间:2019-06-27

本文共 13327 字,大约阅读时间需要 44 分钟。

[更新]
已有patch. 请参见.

PostgreSQL 9.1,9.2,9.3 clean switchover Primary and Standby Patch. 


打补丁前的测试 : 
PostgreSQL 9.3 beta2 无法完成正常的主备角色切换.
Primary :
psqlcheckpont;
pg_controldata 
pg_control version number:            937Catalog version number:               201306121Database system identifier:           5899156703623933927Database cluster state:               in productionpg_control last modified:             Thu 11 Jul 2013 11:05:38 AM CSTLatest checkpoint location:           0/C000060Prior checkpoint location:            0/B000060Latest checkpoint's REDO location:    0/C000028Latest checkpoint's REDO WAL file:    00000004000000000000000CLatest checkpoint's TimeLineID:       4Latest checkpoint's PrevTimeLineID:   4Latest checkpoint's full_page_writes: onLatest checkpoint's NextXID:          0/1850Latest checkpoint's NextOID:          32768Latest checkpoint's NextMultiXactId:  1Latest checkpoint's NextMultiOffset:  0Latest checkpoint's oldestXID:        1674Latest checkpoint's oldestXID's DB:   1Latest checkpoint's oldestActiveXID:  1850Latest checkpoint's oldestMultiXid:   1Latest checkpoint's oldestMulti's DB: 1Time of latest checkpoint:            Thu 11 Jul 2013 11:05:38 AM CSTFake LSN counter for unlogged rels:   0/1Minimum recovery ending location:     0/0Min recovery ending loc's timeline:   0Backup start location:                0/0Backup end location:                  0/0End-of-backup record required:        noCurrent wal_level setting:            hot_standbyCurrent max_connections setting:      10000Current max_prepared_xacts setting:   0Current max_locks_per_xact setting:   64Maximum data alignment:               8Database block size:                  8192Blocks per segment of large relation: 131072WAL block size:                       16384Bytes per WAL segment:                16777216Maximum length of identifiers:        64Maximum columns in an index:          32Maximum size of a TOAST chunk:        1996Date/time type storage:               64-bit integersFloat4 argument passing:              by valueFloat8 argument passing:              by valueData page checksum version:           0
Standby : 
pg_control version number:            937Catalog version number:               201306121Database system identifier:           5899156703623933927Database cluster state:               in archive recoverypg_control last modified:             Thu 11 Jul 2013 11:05:29 AM CSTLatest checkpoint location:           0/B000060Prior checkpoint location:            0/B000060Latest checkpoint's REDO location:    0/B000028Latest checkpoint's REDO WAL file:    00000004000000000000000BLatest checkpoint's TimeLineID:       4Latest checkpoint's PrevTimeLineID:   4Latest checkpoint's full_page_writes: onLatest checkpoint's NextXID:          0/1850Latest checkpoint's NextOID:          32768Latest checkpoint's NextMultiXactId:  1Latest checkpoint's NextMultiOffset:  0Latest checkpoint's oldestXID:        1674Latest checkpoint's oldestXID's DB:   1Latest checkpoint's oldestActiveXID:  1850Latest checkpoint's oldestMultiXid:   1Latest checkpoint's oldestMulti's DB: 1Time of latest checkpoint:            Thu 11 Jul 2013 11:04:57 AM CSTFake LSN counter for unlogged rels:   0/1Minimum recovery ending location:     0/B0000F0Min recovery ending loc's timeline:   4Backup start location:                0/0Backup end location:                  0/0End-of-backup record required:        noCurrent wal_level setting:            hot_standbyCurrent max_connections setting:      10000Current max_prepared_xacts setting:   0Current max_locks_per_xact setting:   64Maximum data alignment:               8Database block size:                  8192Blocks per segment of large relation: 131072WAL block size:                       16384Bytes per WAL segment:                16777216Maximum length of identifiers:        64Maximum columns in an index:          32Maximum size of a TOAST chunk:        1996Date/time type storage:               64-bit integersFloat4 argument passing:              by valueFloat8 argument passing:              by valueData page checksum version:           0
Primary : 
pg_ctl stopwaiting for server to shut down.... doneserver stopped
pg_controldata 
pg_control version number:            937Catalog version number:               201306121Database system identifier:           5899156703623933927Database cluster state:               shut downpg_control last modified:             Thu 11 Jul 2013 11:06:31 AM CSTLatest checkpoint location:           0/D000028Prior checkpoint location:            0/C000060Latest checkpoint's REDO location:    0/D000028Latest checkpoint's REDO WAL file:    00000004000000000000000DLatest checkpoint's TimeLineID:       4Latest checkpoint's PrevTimeLineID:   4Latest checkpoint's full_page_writes: onLatest checkpoint's NextXID:          0/1850Latest checkpoint's NextOID:          32768Latest checkpoint's NextMultiXactId:  1Latest checkpoint's NextMultiOffset:  0Latest checkpoint's oldestXID:        1674Latest checkpoint's oldestXID's DB:   1Latest checkpoint's oldestActiveXID:  0Latest checkpoint's oldestMultiXid:   1Latest checkpoint's oldestMulti's DB: 1Time of latest checkpoint:            Thu 11 Jul 2013 11:06:31 AM CSTFake LSN counter for unlogged rels:   0/1Minimum recovery ending location:     0/0Min recovery ending loc's timeline:   0Backup start location:                0/0Backup end location:                  0/0End-of-backup record required:        noCurrent wal_level setting:            hot_standbyCurrent max_connections setting:      10000Current max_prepared_xacts setting:   0Current max_locks_per_xact setting:   64Maximum data alignment:               8Database block size:                  8192Blocks per segment of large relation: 131072WAL block size:                       16384Bytes per WAL segment:                16777216Maximum length of identifiers:        64Maximum columns in an index:          32Maximum size of a TOAST chunk:        1996Date/time type storage:               64-bit integersFloat4 argument passing:              by valueFloat8 argument passing:              by valueData page checksum version:           0
standby : 
pg_controldata pg_control version number:            937Catalog version number:               201306121Database system identifier:           5899156703623933927Database cluster state:               in archive recoverypg_control last modified:             Thu 11 Jul 2013 11:05:29 AM CSTLatest checkpoint location:           0/B000060Prior checkpoint location:            0/B000060Latest checkpoint's REDO location:    0/B000028Latest checkpoint's REDO WAL file:    00000004000000000000000BLatest checkpoint's TimeLineID:       4Latest checkpoint's PrevTimeLineID:   4Latest checkpoint's full_page_writes: onLatest checkpoint's NextXID:          0/1850Latest checkpoint's NextOID:          32768Latest checkpoint's NextMultiXactId:  1Latest checkpoint's NextMultiOffset:  0Latest checkpoint's oldestXID:        1674Latest checkpoint's oldestXID's DB:   1Latest checkpoint's oldestActiveXID:  1850Latest checkpoint's oldestMultiXid:   1Latest checkpoint's oldestMulti's DB: 1Time of latest checkpoint:            Thu 11 Jul 2013 11:04:57 AM CSTFake LSN counter for unlogged rels:   0/1Minimum recovery ending location:     0/B0000F0Min recovery ending loc's timeline:   4Backup start location:                0/0Backup end location:                  0/0End-of-backup record required:        noCurrent wal_level setting:            hot_standbyCurrent max_connections setting:      10000Current max_prepared_xacts setting:   0Current max_locks_per_xact setting:   64Maximum data alignment:               8Database block size:                  8192Blocks per segment of large relation: 131072WAL block size:                       16384Bytes per WAL segment:                16777216Maximum length of identifiers:        64Maximum columns in an index:          32Maximum size of a TOAST chunk:        1996Date/time type storage:               64-bit integersFloat4 argument passing:              by valueFloat8 argument passing:              by valueData page checksum version:           0
pg_ctl promote
server promoting
pg_controldata 
pg_control version number:            937Catalog version number:               201306121Database system identifier:           5899156703623933927Database cluster state:               in productionpg_control last modified:             Thu 11 Jul 2013 11:07:37 AM CSTLatest checkpoint location:           0/D000090Prior checkpoint location:            0/B000060Latest checkpoint's REDO location:    0/D000058Latest checkpoint's REDO WAL file:    00000005000000000000000DLatest checkpoint's TimeLineID:       5Latest checkpoint's PrevTimeLineID:   5Latest checkpoint's full_page_writes: onLatest checkpoint's NextXID:          0/1851Latest checkpoint's NextOID:          32768Latest checkpoint's NextMultiXactId:  1Latest checkpoint's NextMultiOffset:  0Latest checkpoint's oldestXID:        1674Latest checkpoint's oldestXID's DB:   1Latest checkpoint's oldestActiveXID:  1851Latest checkpoint's oldestMultiXid:   1Latest checkpoint's oldestMulti's DB: 1Time of latest checkpoint:            Thu 11 Jul 2013 11:07:37 AM CSTFake LSN counter for unlogged rels:   0/1Minimum recovery ending location:     0/0Min recovery ending loc's timeline:   0Backup start location:                0/0Backup end location:                  0/0End-of-backup record required:        noCurrent wal_level setting:            hot_standbyCurrent max_connections setting:      10000Current max_prepared_xacts setting:   0Current max_locks_per_xact setting:   64Maximum data alignment:               8Database block size:                  8192Blocks per segment of large relation: 131072WAL block size:                       16384Bytes per WAL segment:                16777216Maximum length of identifiers:        64Maximum columns in an index:          32Maximum size of a TOAST chunk:        1996Date/time type storage:               64-bit integersFloat4 argument passing:              by valueFloat8 argument passing:              by valueData page checksum version:           0
primary  : 
cd $PGDATA mv recovery.done recovery.conf pg_ctl start
 log : 
2013-07-11 11:10:11.386 CST,,,14911,,51de2213.3a3f,1,,2013-07-11 11:10:11 CST,,0,LOG,00000,"database system was shut down in recovery at 2013-07-11 11:09:51 CST",,,,,,,,"StartupXLOG, xlog.c:4895",""2013-07-11 11:10:11.387 CST,,,14911,,51de2213.3a3f,2,,2013-07-11 11:10:11 CST,,0,LOG,00000,"entering standby mode",,,,,,,,"StartupXLOG, xlog.c:4968",""2013-07-11 11:10:11.391 CST,,,14911,,51de2213.3a3f,3,,2013-07-11 11:10:11 CST,1/0,0,LOG,00000,"consistent recovery state reached at 0/D000090",,,,,,,,"CheckRecoveryConsistency, xlog.c:6187",""2013-07-11 11:10:11.391 CST,,,14911,,51de2213.3a3f,4,,2013-07-11 11:10:11 CST,1/0,0,LOG,00000,"record with zero length at 0/D000090",,,,,,,,"ReadRecord, xlog.c:3285",""2013-07-11 11:10:11.392 CST,,,14909,,51de2213.3a3d,1,,2013-07-11 11:10:11 CST,,0,LOG,00000,"database system is ready to accept read only connections",,,,,,,,"sigusr1_handler, postmaster.c:4658",""2013-07-11 11:10:11.407 CST,,,14915,,51de2213.3a43,1,,2013-07-11 11:10:11 CST,,0,LOG,00000,"fetching timeline history file for timeline 5 from primary server",,,,,,,,"WalRcvFetchTimeLineHistoryFiles, walreceiver.c:666",""2013-07-11 11:10:11.411 CST,,,14915,,51de2213.3a43,2,,2013-07-11 11:10:11 CST,,0,LOG,00000,"primary server contains no more WAL on requested timeline 4",,,,,,,,"WalReceiverMain, walreceiver.c:529",""2013-07-11 11:10:11.411 CST,,,14911,,51de2213.3a3f,5,,2013-07-11 11:10:11 CST,1/0,0,LOG,00000,"new timeline 5 forked off current database system timeline 4 before current recovery point 0/D000090",,,,,,,,"rescanLatestTimeLine, xlog.c:3441",""2013-07-11 11:10:11.412 CST,,,14915,,51de2213.3a43,3,,2013-07-11 11:10:11 CST,,0,LOG,00000,"primary server contains no more WAL on requested timeline 4",,,,,,,,"WalReceiverMain, walreceiver.c:529",""2013-07-11 11:10:11.412 CST,,,14911,,51de2213.3a3f,6,,2013-07-11 11:10:11 CST,1/0,0,LOG,00000,"new timeline 5 forked off current database system timeline 4 before current recovery point 0/D000090",,,,,,,,"rescanLatestTimeLine, xlog.c:3441",""2013-07-11 11:10:16.407 CST,,,14915,,51de2213.3a43,4,,2013-07-11 11:10:11 CST,,0,LOG,00000,"primary server contains no more WAL on requested timeline 4",,,,,,,,"WalReceiverMain, walreceiver.c:529",""2013-07-11 11:10:16.407 CST,,,14911,,51de2213.3a3f,7,,2013-07-11 11:10:11 CST,1/0,0,LOG,00000,"new timeline 5 forked off current database system timeline 4 before current recovery point 0/D000090",,,,,,,,"rescanLatestTimeLine, xlog.c:3441",""2013-07-11 11:10:21.402 CST,,,14915,,51de2213.3a43,5,,2013-07-11 11:10:11 CST,,0,LOG,00000,"primary server contains no more WAL on requested timeline 4",,,,,,,,"WalReceiverMain, walreceiver.c:529",""2013-07-11 11:10:21.402 CST,,,14911,,51de2213.3a3f,8,,2013-07-11 11:10:11 CST,1/0,0,LOG,00000,"new timeline 5 forked off current database system timeline 4 before current recovery point 0/D000090",,,,,,,,"rescanLatestTimeLine, xlog.c:3441",""2013-07-11 11:10:26.398 CST,,,14915,,51de2213.3a43,6,,2013-07-11 11:10:11 CST,,0,LOG,00000,"primary server contains no more WAL on requested timeline 4",,,,,,,,"WalReceiverMain, walreceiver.c:529",""
同主机上,将数据库版本更换为9.2测试切换正常.

转载地址:http://nmnpl.baihongyu.com/

你可能感兴趣的文章
[Android] 关于getinstalledpackages参数的分析
查看>>
转:Redis监控技巧
查看>>
处理手势冲突和错乱的一点经验
查看>>
ServiceManager 小结
查看>>
Struts2防止表单重复提交
查看>>
[转]Python格式化输出
查看>>
Leetcode: Russian Doll Envelopes
查看>>
在Activity中响应ListView内部按钮的点击事件
查看>>
Java设计模式博客全文件夹
查看>>
poj1062昂贵的聘礼
查看>>
【GMT43智能液晶模块】例程五:IWDG看门狗实验——复位ARM
查看>>
解决cell切割线不是全屏问题
查看>>
cmd获取批处理文件所在路径
查看>>
LeetCode: Word Ladder [126]
查看>>
cache数据库之表的存储结构
查看>>
[React] Create component variations in React with styled-components and "extend"
查看>>
python装饰器的作用
查看>>
CSS - 修改input - placeholder 和 readonly 的样式
查看>>
JAX-WS使用Handler实现简单的WebService权限验证
查看>>
Scripting API Samples
查看>>