Re: Corner-case bug in pg_rewind

Heikki Linnakangas <hlinnaka@iki.fi>

From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Ian Barwick <ian.barwick@2ndquadrant.com>, Pavel Borisov <pashkin.elfe@gmail.com>, Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Cc: Ian Lawrence Barwick <barwick@gmail.com>, Pgsql Hackers <pgsql-hackers@postgresql.org>
Date: 2020-12-03T14:10:47Z
Lists: pgsql-hackers
On 02/12/2020 15:26, Ian Barwick wrote:
> On 02/12/2020 20:13, Heikki Linnakangas wrote:
>> Attached are two patches. The first patch is your original patch, unmodified
>> (except for a cosmetic rename of the test file). The second patch builds on
>> that, demonstrating and fixing the issue I mentioned. It took me a while to
>> create a repro for it, it's easily masked by incidental full-page writes or
>> because rows created by XIDs that are not marked as committed on the other
>> timeline are invisible, but succeeded at last.
> 
> Aha, many thanks. I wasn't entirely sure what I was looking for there and
> recently haven't had the time or energy to dig any further.

Ok, pushed and backpatched this now.

Thanks!

- Heikki



Commits

  1. Fix more race conditions in the newly-added pg_rewind test.

  2. Fix race conditions in newly-added test.

  3. Fix pg_rewind bugs when rewinding a standby server.

  4. Allow pg_rewind to use a standby server as the source system.

  5. Support clean switchover.