diff options
| author | Heikki Linnakangas | 2013-01-18 09:48:29 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2013-01-18 09:59:34 +0000 |
| commit | 6f7cddc7ae27a42ac2af72b675b9c08138a0c439 (patch) | |
| tree | a4963727613f09a93f18ed84469fdd4999af2f31 /src/include/replication | |
| parent | 2ff65553131d8ad2ddbbfe298fffc378f127b15e (diff) | |
Now that START_REPLICATION returns the next timeline's ID after reaching end
of timeline, take advantage of that in walreceiver.
Startup process is still in control of choosign the target timeline, by
scanning the timeline history files present in pg_xlog, but walreceiver now
uses the next timeline's ID to fetch its history file immediately after it
has finished streaming the old timeline. Before, the standby would first try
to restart streaming on the old timeline, which fetches the missing timeline
history file as a side-effect, and only then restart from the new timeline.
This patch eliminates the extra iteration, which speeds up the timeline
switch and reduces the noise in the log caused by the extra restart on the
old timeline.
Diffstat (limited to 'src/include/replication')
| -rw-r--r-- | src/include/replication/walreceiver.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/replication/walreceiver.h b/src/include/replication/walreceiver.h index 3afc4a86bbd..72878f84c61 100644 --- a/src/include/replication/walreceiver.h +++ b/src/include/replication/walreceiver.h @@ -128,7 +128,7 @@ extern PGDLLIMPORT walrcv_readtimelinehistoryfile_type walrcv_readtimelinehistor typedef bool (*walrcv_startstreaming_type) (TimeLineID tli, XLogRecPtr startpoint); extern PGDLLIMPORT walrcv_startstreaming_type walrcv_startstreaming; -typedef void (*walrcv_endstreaming_type) (void); +typedef void (*walrcv_endstreaming_type) (TimeLineID *next_tli); extern PGDLLIMPORT walrcv_endstreaming_type walrcv_endstreaming; typedef int (*walrcv_receive_type) (int timeout, char **buffer); |
