pgsql: Change how first WAL segment on new timeline after promotion is

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change how first WAL segment on new timeline after promotion is
Date: 2014-12-18 18:25:19
Message-ID: E1Y1flH-000118-KB@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/ba94518aad23beb800b657bd0cc8c4e7ea43ca33

Modified Files
--------------
src/backend/access/transam/xlog.c | 82 +++++++++++++++++++++++++++----------
1 file changed, 61 insertions(+), 21 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-12-18 18:36:45 pgsql: Improve hash_create's API for selecting simple-binary-key hash f
Previous Message Fujii Masao 2014-12-18 14:08:09 pgsql: Add memory barriers for PgBackendStatus.st_changecount protocol.

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2014-12-18 18:28:04 Re: Commitfest problems
Previous Message Joshua D. Drake 2014-12-18 18:08:11 Re: Commitfest problems