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

From: Asif Naeem <anaeem(dot)it(at)gmail(dot)com>
To: MauMau <maumau307(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] PostgreSQL fails to start on Windows if it crashes after tablespace creation
Date: 2014-01-16 05:09:05
Message-ID: CAEB4t-OcdKpd=x-3N4vw4obG_LtPVB9MUNNbwtTeBXPUCOMOkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi MauMau,

Ah. Sorry, I missed that part. As NTFS junctions and symbolic links are
different (although they behave similarly), there seems only a minor
inconvenience related to misleading error message i.e.

+ #ifdef WIN32
> + if (rmdir(linkloc) < 0 && errno != ENOENT)
> + #else
> if (unlink(linkloc) < 0 && errno != ENOENT)
> + #endif
> ereport(ERROR,
> (errcode_for_file_access(),
> errmsg("could not remove symbolic link \"%s\": %m",

What is your opinion about it, Is it not worth changing ? . Thanks.

On Wed, Jan 15, 2014 at 7:42 PM, MauMau <maumau307(at)gmail(dot)com> wrote:

> From: "Asif Naeem" <anaeem(dot)it(at)gmail(dot)com>
>
> As you have
>>
> followed destroy_tablespace_directories() function, Is there any specific
> reason not to use same logic to detect type of the file/link i.e.
> “(lstat(linkloc, &st) == 0 && S_ISDIR(st.st_mode))”, It also seems have
> more appropriate error message i.e.
>
> Thanks for reviewing and testing the patch. Yes, at first I did what you
> mentioned, but modified the patch according to some advice in the mail
> thread. During redo, create_tablespace_directories() needs to handle the
> case where the $PGDATA/pg_tblspc/xxx is not a symlink but a directory even
> on UNIX/Linux. Please see TablespaceCreateDbspace is(). destroy_tablespace_directories()
> doesn't have to handle such situation.
>
> Regards
> MauMau
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2014-01-16 05:36:49 Re: Why conf.d should be default, and auto.conf and recovery.conf should be in it
Previous Message Amit Kapila 2014-01-16 05:07:42 Re: Performance Improvement by reducing WAL for Update Operation