Re: pg_upgrade: fail early if a tablespace dir already exists for new cluster version

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: pg_upgrade: fail early if a tablespace dir already exists for new cluster version
Дата
Msg-id 20201009185325.GA24870@momjian.us
обсуждение исходный текст
Ответ на pg_upgrade: fail early if a tablespace dir already exists for new cluster version  (Justin Pryzby <pryzby@telsasoft.com>)
Ответы Re: pg_upgrade: fail early if a tablespace dir already exists for new cluster version  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
On Thu, Sep 24, 2020 at 07:55:31PM -0500, Justin Pryzby wrote:
> This should be caught during --check, or earlier in the upgrade, rather than
> only after dumping the schema.
> 
> Typically, the tablespace dir would be left behind by a previous failed upgrade
> attempt, causing a cascade of failured upgrades.  I guess I may not be the only
> one with a 3 year old wrapper which has a hack to check for this.

This is an interesting failure case I never considered --- running
pg_upgrade, having it fail, deleting and recreating the _new_ cluster
directory, but not removing the new cluster's tablepace directories.  I
was able to recreate the failure, and verify that your patch properly
throws an error during 'check' for this case.

Modified patch attached.  I plan to apply this to all supported Postgres
versions.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee


Вложения

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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: dynamic result sets support in extended query protocol
Следующее
От: David Christensen
Дата:
Сообщение: [PATCH] Add `truncate` option to subscription commands