Re: post-recovery amcheck expectations

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Subject: Re: post-recovery amcheck expectations
Date: 2023-10-23 23:46:23
Message-ID: CAH2-WznBJZQxKRYgtMDAhre-R4YasPNqXGy=g_yNQGKLHP9C2Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 20, 2023 at 8:55 PM Noah Misch <noah(at)leadboat(dot)com> wrote:
> > > I lean toward fixing this by
> > > having amcheck scan left; if left links reach only half-dead or deleted pages,
> > > that's as good as the present child block being P_LEFTMOST.
> >
> > Also my preference.
>
> Done mostly that way, except I didn't accept deleted pages. Making this work
> on !readonly would take more than that, and readonly shouldn't need that.

That makes sense to me. I believe that it's not possible to have a
string of consecutive sibling pages that are all half-dead (regardless
of the BlockNumber order of sibling pages, even). But I'd probably
have written the fix in roughly the same way. Although...maybe you
should try to detect a string of half-dead pages? Hard to say if it's
worth the trouble.

Suggest adding a CHECK_FOR_INTERRUPTS() call to the loop, too, just
for good luck.

> After I fixed the original error, the "block %u is not leftmost" surfaced
> next. The attached patch fixes that, too. I didn't investigate the others.
> The original test was flaky in response to WAL flush timing, but this one
> survives thousands of runs.

Hmm. Can't argue with that. Your fix seems sound.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2023-10-23 23:56:51 Re: trying again to get incremental backup
Previous Message Michael Paquier 2023-10-23 23:41:59 Re: WIP: new system catalog pg_wait_event