Re: Long paths for tablespace leads to uninterruptible hang in Windows

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Long paths for tablespace leads to uninterruptible hang in Windows
Date: 2013-10-15 20:14:34
Message-ID: CAA4eK1+jiRxwXYerPtW3_j=4ADPhhyNVnB=H7YQ3ATpkd_J9DQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 15, 2013 at 6:28 PM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> On Tue, Oct 15, 2013 at 2:55 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> On Mon, Oct 14, 2013 at 1:30 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>>> Well, that sucks. So it's a Windows bug.
>>>
>>> It's not clear to me that we should do anything about this at all,
>>> except perhaps document that people should avoid long tablespace
>>> path names on an unknown set of Windows versions. We should not
>>> be in the business of working around any and every bug coming out
>>> of Redmond.
>>
>> It's sort of incomprehensible to me that Microsoft has a bug like this
>> and apparently hasn't fixed it. But I think I still favor trying to
>> work around it. When people try to use a long data directory name and
>> it freezes the system, some of them will blame us rather than
>> Microsoft. We've certainly gone to considerable lengths to work
>> around extremely strange bugs in various compiler toolchains, even
>> relatively obscure ones. I don't particularly see why we shouldn't do
>> the same here.
>
> I agree we'll probably want to work around it in the end, but I still
> think it should be put to Microsoft PSS if we can. The usual - have we
> actually produced a self-contained example that does just this (and
> doesn't include the full postgres support) and submitted it to
> *microsoft* for comments?

I have written a self contained win32 console application with which
the issue can be reproduced.
The application project is attached with this mail.

Here is brief description of the project:
This project is created using MSVC 2010, but even if somebody
doesn't have this version of VC, functions in file long_path.cpp can
be copied and
used in new project.
In project settings, I have changed Character Set to "Use Multi-Byte
Character Set" which is what Postgres uses.

It takes 3 parameters as input:
existingpath - path for which link will be created. this path should
be an already
existing path with one level less than actual
path. For example,
if we want to create a link for path
"E:/PG_Patch/Long_Path/path_dir/version_dir",
then this should be "E:/PG_Patch/Long_Path/path_dir".
newpath - path where link needs to be created. it should be
non-absolute path
of format "linked_path_dir/test_version"
curpath - path to set as current working directory path, it
should be the
location to prepend to newpath

Currently I have used input parameters as
E:/PG_Patch/Long_Path/path_dir
linked_path_dir/test_version
E:/PG_Patch/Long_Path/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Long path is much less than 260 char limit on windows, I have
observed this problem with path length > 130 (approx.)

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

Attachment Content-Type Size
long_path.rar application/rar 8.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kohei KaiGai 2013-10-15 20:17:09 Re: Triggers on foreign tables
Previous Message Kohei KaiGai 2013-10-15 20:02:46 Re: background workers, round three