Re: [bug fix] pg_rewind takes long time because it mistakenly copies data files

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] pg_rewind takes long time because it mistakenly copies data files
Date: 2018-02-26 09:24:02
Message-ID: 20180226092402.GH6927@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 26, 2018 at 08:13:02AM +0000, Tsunakawa, Takayuki wrote:
> From: Michael Paquier [mailto:michael(at)paquier(dot)xyz]
>> Your patch is able to fix that. I have also checked that after diverging
>> the promoted server with more data and inserting data on the old primary
>> then the correct set of blocks from the tablespace is fetched as well by
>> pg_rewind. This patch also behaves correctly when creating a new relation
>> on the promoted server as it copies the whole relation. In short your patch
>> looks good to me.
>
> How quick, I was surprised. Thank you so much! I'd be glad if you could be the reviewer in CF:
>
> https://commitfest.postgresql.org/17/1542/

Sure.

>> Creating a test case for this patch would be nice, however this needs a
>> bit of work so as the tablespace map can be used with pg_basebackup and
>> PostgresNode.pm (or use raw pg_basebackup commands in pg_rewind tests):
>> - PostgresNode::init_from_backup needs to be able to understand extra
>> options given by caller for pg_basebackup.
>> - RewindTest::create_standby should be extended with extra arguments given
>> for previous extension.
>> :(
>
> That sounds difficult from your way of saying... but this may be a
> good opportunity to look into the TAP tests.

Anything like that would be work only for HEAD I think as that's a bit
of refactoring. And indeed it could give you a good introduction to the
TAP facility.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2018-02-26 10:03:21 Re: [HACKERS] advanced partition matching algorithm for partition-wise join
Previous Message Michael Paquier 2018-02-26 09:19:21 Re: [bug fix] Cascaded standby cannot start after a clean shutdown