Re: [Patch] Make pg_checksums skip foreign tablespace directories

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [Patch] Make pg_checksums skip foreign tablespace directories
Дата
Msg-id 20200131045352.GB2631@paquier.xyz
обсуждение исходный текст
Ответ на [Patch] Make pg_checksums skip foreign tablespace directories  (Michael Banck <michael.banck@credativ.de>)
Ответы Re: [Patch] Make pg_checksums skip foreign tablespace directories  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Re: [Patch] Make pg_checksums skip foreign tablespace directories  (Michael Banck <michael.banck@credativ.de>)
Re: [Patch] Make pg_checksums skip foreign tablespace directories  (Bernd Helmle <mailings@oopsware.de>)
Список pgsql-hackers
On Thu, Jan 30, 2020 at 06:11:22PM +0100, Michael Banck wrote:
> The other question is whether it is possible to end up with a
> pg_internal.init.$PID file in a running cluster. E.g. if an instance
> crashes and gets started up again - are those cleaned up during crash
> recovery, or should pg_checksums ignore them? Right now pg_checksums
> only checks against a list of filenames and only skips on exact matches
> not prefixes so that might take a bit of work.

Indeed, with a bad timing and a crash in the middle of
write_relcache_init_file(), it could be possible to have such a file
left around in the data folder.  Having a past tablespace version left
around after an upgrade is a pilot error in my opinion because
pg_upgrade generates a script to cleanup past tablespaces, no?  So
your patch does not look like a good idea to me.  And now that I look
at it, if we happen to leave behind a temporary file for
pg_internal.init, backups fail with the following error:
2020-01-31 13:26:18.345 JST [102076] 010_pg_basebackup.pl ERROR:
invalid segment number 0 in file "pg_internal.init.123"

So, I think that it would be better to change basebackup.c,
pg_checksums and pg_rewind so as files are excluded if there is a
prefix match with the exclude lists.  Please see the attached.
--
Michael

Вложения

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

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: table partitioning and access privileges
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Proposal: Add more compile-time asserts to exposeinconsistencies.