-
- Downloads
Make pg_receivexlog and pg_basebackup -X stream work across timeline switches.
This mirrors the changes done earlier to the server in standby mode. When receivelog reaches the end of a timeline, as reported by the server, it fetches the timeline history file of the next timeline, and restarts streaming from the new timeline by issuing a new START_STREAMING command. When pg_receivexlog crosses a timeline, it leaves the .partial suffix on the last segment on the old timeline. This helps you to tell apart a partial segment left in the directory because of a timeline switch, and a completed segment. If you just follow a single server, it won't make a difference, but it can be significant in more complicated scenarios where new WAL is still generated on the old timeline. This includes two small changes to the streaming replication protocol: First, when you reach the end of timeline while streaming, the server now sends the TLI of the next timeline in the server's history to the client. pg_receivexlog uses that as the next timeline, so that it doesn't need to parse the timeline history file like a standby server does. Second, when BASE_BACKUP command sends the begin and end WAL positions, it now also sends the timeline IDs corresponding the positions.
Showing
- doc/src/sgml/protocol.sgml 10 additions, 4 deletionsdoc/src/sgml/protocol.sgml
- src/backend/access/transam/timeline.c 9 additions, 5 deletionssrc/backend/access/transam/timeline.c
- src/backend/access/transam/xlog.c 21 additions, 3 deletionssrc/backend/access/transam/xlog.c
- src/backend/access/transam/xlogfuncs.c 2 additions, 2 deletionssrc/backend/access/transam/xlogfuncs.c
- src/backend/replication/basebackup.c 30 additions, 11 deletionssrc/backend/replication/basebackup.c
- src/backend/replication/walsender.c 44 additions, 6 deletionssrc/backend/replication/walsender.c
- src/bin/pg_basebackup/pg_basebackup.c 14 additions, 9 deletionssrc/bin/pg_basebackup/pg_basebackup.c
- src/bin/pg_basebackup/pg_receivexlog.c 53 additions, 46 deletionssrc/bin/pg_basebackup/pg_receivexlog.c
- src/bin/pg_basebackup/receivelog.c 487 additions, 200 deletionssrc/bin/pg_basebackup/receivelog.c
- src/bin/pg_basebackup/receivelog.h 1 addition, 1 deletionsrc/bin/pg_basebackup/receivelog.h
- src/include/access/timeline.h 2 additions, 1 deletionsrc/include/access/timeline.h
- src/include/access/xlog.h 4 additions, 2 deletionssrc/include/access/xlog.h
Loading
Please register or sign in to comment