Re: Online checksums verification in the backend

From: Andres Freund <andres(at)anarazel(dot)de>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Julien Rouhaud <rjuju123(at)gmail(dot)com>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: Re: Online checksums verification in the backend
Date: 2020-10-29 18:31:06
Message-ID: 20201029183106.r5xkcws6zkwupip2@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2020-10-29 11:17:29 -0700, Andres Freund wrote:
> LWLockAcquire(BufferDescriptorGetIOLock(bufdesc), LW_SHARED);
> buf_state = LockBufHdr(bufdesc);
> UnlockBufHdr(bufdesc, buf_state);
>
> /* If the page is dirty or invalid, skip it */
> if ((buf_state & BM_DIRTY) != 0 || (buf_state & BM_TAG_VALID) == 0)

This is weird as well. What is this supposed to do? Just locking and
unlocking a buffer header doesn't do squat? There's no guarantee that
the flags haven't changed by this point, so you could just as well not
acquire the buffer header lock.

Also, why are pages without a valid tag ignored? I can follow the
argument for skipping it in the DIRTY case, but that doesn't apply for
BM_TAG_VALID?

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2020-10-29 19:10:45 Re: Online checksums verification in the backend
Previous Message Andres Freund 2020-10-29 18:17:29 Re: Online checksums verification in the backend