]> granicus.if.org Git - postgresql/commit
Change how first WAL segment on new timeline after promotion is created.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 18 Dec 2014 17:38:53 +0000 (19:38 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Thu, 18 Dec 2014 18:23:03 +0000 (20:23 +0200)
commitba94518aad23beb800b657bd0cc8c4e7ea43ca33
tree259072a497ff59641d45acfbbdfdb6b63c89ff99
parent38628db8d8caff21eb6cf8d775c0b2d04cf07b9b
Change how first WAL segment on new timeline after promotion is created.

Two changes:

1. When copying a WAL segment from old timeline to create the first segment
on the new timeline, only copy up to the point where the timeline switch
happens, and zero-fill the rest. This avoids corner cases where we might
think that the copied WAL from the previous timeline belong to the new
timeline.

2. If the timeline switch happens at a segment boundary, don't copy the
whole old segment to the new timeline. It's pointless, because it's 100%
identical to the old segment.
src/backend/access/transam/xlog.c