Re: Online verification of checksums

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Online verification of checksums
Дата
Msg-id 20190330133529.t7chaepvbmi63xbi@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Online verification of checksums  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
Hi,

On 2019-03-30 12:56:21 +0100, Magnus Hagander wrote:
> > ISTM that the fact that we had to teach it about different segment files
> > for checksum verification by splitting up the filename at "." implies
> > that it is not the correct level of abstraction (but maybe it could get
> > schooled some more about Postgres internals, e.g. by passing it a
> > RefFileNode struct and not a filename).
> >
> 
> But that has to be fixed in pg_basebackup *regardless*, doesn't it? And if
> we fix it there, we only have to fix it once...

I'm not understanding the problem here. We already need to know all of
this? sendFile() determines whether the file is checksummed, and
computes the segment number:

        if (is_checksummed_file(readfilename, filename))
        {
            verify_checksum = true;
...
                    checksum = pg_checksum_page((char *) page, blkno + segmentno * RELSEG_SIZE);
                    phdr = (PageHeader) page;

I agree that the way checksumming works is a bit of a layering
violation. In my opinion it belongs in the smgr level, not bufmgr.c etc,
so different storage methods can store it differently. But that seems
fairly indepedent of this problem.

Greetings,

Andres Freund



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Checksum errors in pg_stat_database
Следующее
От: Stephen Frost
Дата:
Сообщение: [PATCH v22] GSSAPI encryption support