Re: PITR Redo Create Database fails
От | Alvaro Herrera |
---|---|
Тема | Re: PITR Redo Create Database fails |
Дата | |
Msg-id | 20040708151933.GA8362@dcc.uchile.cl обсуждение исходный текст |
Ответ на | PITR Redo Create Database fails (Simon Riggs <simon@2ndquadrant.com>) |
Ответы |
Re: PITR Redo Create Database fails
|
Список | pgsql-hackers |
On Thu, Jul 08, 2004 at 02:58:01PM +0100, Simon Riggs wrote: > I've discovered that CREATE DATABASE doesn't redo correctly in an > archive recovery test. > > This isn't a bug --in the current code--, because when crash recovery > occurs, the database directories are already there, so this only doesn't > work when using the PITR patches. During archive recovery, nothing is > there, so needs to be created. > > It looks like CREATE DATABASE doesn't produce redo, nor is there a > replay command created for it. [...] > The FileNameOpenFile fails when the first relation in the database is > created. The code assumes that any failure of the FileNameOpenFile is > because the file is already there, then tries to open it which also > fails. The failure is caused by the fact that there is no directory (as > well as no file), but that isn't tested for. I don't think it's a good idea to just create a directory if it's not already there. It would mean creating a spurious directory with an empty file if the data is corrupted and a wrong RelFileNode is in memory for whatever reason. The correct solution would be to emit a XLog record for CREATE DATABASE ... -- Alvaro Herrera (<alvherre[a]dcc.uchile.cl>) "El destino baraja y nosotros jugamos" (A. Schopenhauer)
В списке pgsql-hackers по дате отправления: