ScanSourceDatabasePgClass - Mailing list pgsql-hackers

From David Christensen
Subject ScanSourceDatabasePgClass
Date
Msg-id CAOxo6X+LQNhVqNNzOvrtUL1c=EfAbDkhzDBo=koB3_Pa8DJvjQ@mail.gmail.com
Whole thread Raw
List 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



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: About displaying NestLoopParam
Next
From: Juan José Santamaría Flecha
Date:
Subject: Re: Meson add host_system to PG_VERSION_STR