Re: [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation
Дата
Msg-id CAA4eK1J-+uVXtezaGRK9GOJP1dG4Vcyb-VxwRRrW=7YF5vTrkA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation  ("MauMau" <maumau307@gmail.com>)
Ответы Re: [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation  ("MauMau" <maumau307@gmail.com>)
Список pgsql-hackers
On Mon, Mar 24, 2014 at 7:49 PM, MauMau <maumau307@gmail.com> wrote:
> A bit contrived example is:
>
> 1. After the directory is created by TablespaceCreateDbspace(), recovery is
> stopped (e.g. due to power outage).  The directory remains.
> 2. Restart the server, redoing CREATE TABLESPACE during recovery, which
> executes create_tablespace_directories().

I don't understand how after step-1, step-2 can occur in recovery for same
tablespace path.

Function TablespaceCreateDbspace() would have called for CREATE TABLE.
Now Step-2 can only occur if there is a Drop Tablespace command in-between
step-1 and step-2, else CREATE TABLESPACE can't be successful during
command execution so will not get recorded in WAL.  Basically Create Table
cannot happen on a particular directory without having some
CREATE TABLESPACE before it, so in the above example taken by you,
there must be some Create TableSpace before step-1 or it's on default
tablespace location which means you cannot perform step-2 for same
tablespace path as step-1 without having DROP TABLESPACE in-between
step-1 and step-2.

If you think that above scenario is not possible, then you just need to
modify comment:
"!  * Remove old symlink in recovery...."

One more minor point about patch:
+ struct stat st;

if (InRecovery)
{
struct stat st;

Defining stat struct two times in same function in different ways doesn't
seem to be good, we can do the same way for new usage as is already
done in code or may be declare it once.


With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: About adding a column to an existing system catalog
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: psql blows up on BOM character sequence