Re: Refactor pg_rewind code and make it work against a standby
Heikki Linnakangas <hlinnaka@iki.fi>
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Soumyadeep Chakraborty <soumyadeep2007@gmail.com>,
Kyotaro Horiguchi <horikyota.ntt@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-11-15T15:10:53Z
Lists: pgsql-hackers
On 15/11/2020 09:07, Tom Lane wrote:
> I wrote:
>> Not sure if you noticed, but piculet has twice failed the
>> 007_standby_source.pl test that was added by 9c4f5192f:
>> ...
>> Now, I'm not sure what to make of that, but I can't help noticing that
>> piculet uses --disable-atomics while francolin uses --disable-spinlocks.
>> That leads the mind towards some kind of low-level synchronization
>> bug ...
>
> Or, maybe it's less mysterious than that. The failure looks like we
> have not waited long enough for the just-inserted row to get replicated
> to node C. That wait is implemented as
>
> $lsn = $node_a->lsn('insert');
> $node_b->wait_for_catchup('node_c', 'write', $lsn);
>
> which looks fishy ... shouldn't wait_for_catchup be told to
> wait for replay of that LSN, not just write-the-WAL?
Yep, quite right. Fixed that way, thanks for the debugging!
- Heikki
Commits
-
Make pg_rewind test case more stable.
- c71f9a094b32 14.0 landed
-
Fix timing issue in pg_rewind test.
- 39f9f04b5784 14.0 landed
-
Allow pg_rewind to use a standby server as the source system.
- 9c4f5192f69e 14.0 landed
-
pg_rewind: Refactor the abstraction to fetch from local/libpq source.
- 37d2ff380312 14.0 landed
-
pg_rewind: Replace the hybrid list+array data structure with simplehash.
- f81e97d0475c 14.0 landed
-
Refactor pg_rewind for more clear decision making.
- eb00f1d4bf96 14.0 landed
-
pg_rewind: Move syncTargetDirectory() to file_ops.c
- ffb4e27e9c5e 14.0 landed