ScanSourceDatabasePgClass

From: David Christensen <david(dot)christensen(at)crunchydata(dot)com>
To: "robertmhaas(at)gmail(dot)com" <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: ScanSourceDatabasePgClass
Date: 2022-11-16 21:16:51
Message-ID: CAOxo6X+LQNhVqNNzOvrtUL1c=EfAbDkhzDBo=koB3_Pa8DJvjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Robert,

In 9c08aea6a you introduce the block-by-block strategy for creating a
copy of the database. In the main loop, this utilizes this call:

buf = ReadBufferWithoutRelcache(rlocator, MAIN_FORKNUM, blkno,
RBM_NORMAL, bstrategy, false);

Here, the last parameter is "false" for the permanence factor of this
relation. Since we know that pg_class is in fact a permanent
relation, this ends up causing issues for the TDE patches that I am
working on updating, due using the opposite value when calculating the
page's IV and thus failing the decryption when trying to create a
database based on template0.

Is there a reason why this needs to be "false" here? I recognize that
this routine is accessing the table outside of a formal connection, so
there might be more subtle effects that I am not aware of. If so this
should be documented. If it's an oversight, I think we should change
to be "true" to match the actual permanence state of the relation.

I did test changing it to true and didn't notice any adverse effects
in `make installcheck-world`, but let me know if there is more to this
story than meets the eye.

(I did review the original discussion at
https://www.postgresql.org/message-id/flat/CA%2BTgmoYtcdxBjLh31DLxUXHxFVMPGzrU5_T%3DCYCvRyFHywSBUQ%40mail.gmail.com
and did not notice any discussion of this specific parameter choice.)

Thanks,

David

Browse pgsql-hackers by date

  From Date Subject
Next Message Juan José Santamaría Flecha 2022-11-16 21:32:47 Re: Meson add host_system to PG_VERSION_STR
Previous Message Greg Stark 2022-11-16 21:13:27 Re: About displaying NestLoopParam