Re: Testing WAL replay by comparing before and after images again

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Testing WAL replay by comparing before and after images again
Date: 2015-09-04 13:30:14
Message-ID: CANP8+jJzzB=UJS=pAYAM18rSzfJ+_EZS6OFq_L3T-N+aEFJVsQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 4 September 2015 at 13:45, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:

> Another issue was with the new speculative insertions. Replaying a
> speculative insertion record sets the tuple's CTID to point to itself, like
> in a regular insertion. But in the original system, the CTID is set to a
> special speculative insertion token. The tool flagged up that difference.
>
> I propose the attached patch (mark-speculative-insertions-in-replay.patch)
> to fix that in the replay routine. This is not required for correctness,
> but helps this tool, and seems like a good idea for debugging purposes
> anyway.
>

ISTM that the WAL record should include the speculative insertion token, so
that replay can set it correctly.

That way we can always re-check that the later update matches the
speculative insertion token we expect, in all cases.

In any case, the assumption that we are replaying all changes in single
threaded mode is not appropriate for use with logical replication.

--
Simon Riggs http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/>
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-09-04 13:40:43 Re: Making tab-complete.c easier to maintain
Previous Message Thomas Munro 2015-09-04 13:21:17 Making tab-complete.c easier to maintain