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

Поиск
Список
Период
Сортировка
Искать
От
MauMau
Тема
[bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation
Дата
Msg-id
0CAA393E7F0B4FF88848B6C96B89468E@maumau
Список
Дерево обсуждения
[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 Andrew Dunstan <andrew@dunslane.net>
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>
Re: [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation Asif Naeem <anaeem.it@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>
Re: [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation Amit Kapila <amit.kapila16@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 Amit Kapila <amit.kapila16@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 Amit Kapila <amit.kapila16@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 Amit Kapila <amit.kapila16@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 Tom Lane <tgl@sss.pgh.pa.us>
Re: [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation Andres Freund <andres@2ndquadrant.com>
Re: [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation Amit Kapila <amit.kapila16@gmail.com>
Re: [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation Asif Naeem <anaeem.it@gmail.com>
Hello,

I've found and fixed a bug that causes recovery (crash recovery, PITR) to 
fail.  Please find attached the patch against HEAD.


[Bug]
To reproduce the problem, do the following on Windows:

1. pg_ctl start
2. CREATE TABLESPACE tbs LOCATION 'some_tblspc_path';
3. pg_ctl stop -mi
4. pg_ctl start

The database server fails to start, leaving the below messages:

LOG:  database system was interrupted; last known up at 2013-10-31 20:24:07 
JST
LOG:  database system was not properly shut down; automatic recovery in 
progress
LOG:  redo starts at 0/1788938
FATAL:  could not remove symbolic link "pg_tblspc/16385": Permission denied
CONTEXT:  xlog redo create tablespace: 16385 "d:/tbs"
LOG:  startup process (PID 2724) exited with exit code 1
LOG:  aborting startup due to startup process failure


[Cause]
In redo, create_tablespace_directories() tries to remove the symbolic link 
for the tablespace using unlink().  However, unlink() on Windows fails with 
errno=13 (Permission denied).  This is because junction points are 
directories on Windows.


[Fix]
Follow destroy_tablespace_directories() and use rmdir() to remove the 
junction point.


I've tested the patch.  Could you review it and commit?  I wish it to be 
backported to all major releases.


Regards
MauMau
В списке pgsql-hackers по дате отправления
От: Robert Haas
Дата:
От: Kevin Grittner
Дата:
FAQ