Re: pg_rewind: warn when checkpoint hasn't happened after promotion

From: kuroda(dot)keisuke(at)nttcom(dot)co(dot)jp
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: jtc331(at)gmail(dot)com, robertmhaas(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_rewind: warn when checkpoint hasn't happened after promotion
Date: 2022-11-16 05:17:59
Message-ID: ab39f6cbd775a4ead9fb3ea7fcf3edd1@nttcom.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, hackers

> The issue here is pg_rewind looks into control file to determine the
> soruce timeline, because the control file is not updated until the
> first checkpoint ends after promotion finishes, even though file
> blocks are already diverged.
>
> Even in that case history file for the new timeline is already
> created, so searching for the latest history file works.

I think this change is a good one because if I want
pg_rewind to run automatically after a promotion,
I don't have to wait for the checkpoint to complete.

The attached patch is Horiguchi-san's patch with
additional tests. The tests are based on James's tests,
"010_no_checkpoint_after_promotion.pl" tests that
pg_rewind is successfully executed without running
checkpoint after promote.

Best Regards,
Keisuke Kuroda
NTT COMWARE

Attachment Content-Type Size
pg_rewind_fix_4.diff.patch text/x-diff 18.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-11-16 05:20:23 Re: New strategies for freezing, advancing relfrozenxid early
Previous Message John Naylor 2022-11-16 05:17:23 Re: [PoC] Improve dead tuple storage for lazy vacuum