Re: win32 _dosmaperr()

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: win32 _dosmaperr()
Дата
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE6C776F@algol.sollentuna.se
обсуждение исходный текст
Ответ на win32 _dosmaperr()  ("Qingqing Zhou" <zhouqq@cs.toronto.edu>)
Список pgsql-hackers
> There were several reports of "unable to read/write" on
> Pg8.0.x win32 port:
>
> http://archives.postgresql.org/pgsql-bugs/2005-02/msg00181.php
>
> I encounter this several times and finally I catch the
> GetLastError() number. It is
>
>     32, ERROR_SHARING_VIOLATION
>     The process cannot access the file because it is being
> used by another process.
>
> But PG server error message is "invalid parameter" which
> makes this error difficult to understand and track. After
> examing win32 CRT's _dosmaperr() implementation, I found they
> failed to transalte ERROR_SHARING_VIOLATION, so the default
> errno is set to EINVAL. To solve it, we can do our own
> _dosmaperr(GetLastError()) again if read/write failed.
> Unfortunately our
> _dosmaperr() failed to do so either, so here is a patch of
> error.c. Also, I raised the error level to NOTICE for better
> bug report. If this is acceptable, I will patch
> FileRead()/FileWrite() etc.

Seems reasonable.


> However, I am very sure why this could happen. That is, who
> uses the data file in a non-sharing mode? There are many
> possibilities, a common concensus is [Anti-]virus software.
> Yes, I do have one installed. If we can confirm this, then we
> could at least print a hint message.

I would suspect either AV software and/or backup software not excluding
the pg data files.

I suggest you try using Process Explorer from www.sysinternals.com to
figure out who has the file open. Most of the time it should be able to
tell you exactly who has locked the file - at least as long as it's done
from userspace. I'm not 100% sure on how it deals with kernel level
locks.


//Magnus


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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: Order by optimisations?
Следующее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: Order by optimisations?