Re: Server is not getting started with log level as debug5 on master after commit 3147ac

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: Server is not getting started with log level as debug5 on master after commit 3147ac
Дата
Msg-id CAA4eK1Lr6FmMR1nqn+4yapGYJgY=3wU_3fnmZEp4a4gb6Ap-Dg@mail.gmail.com
обсуждение исходный текст
Ответ на Server is not getting started with log level as debug5 on master after commit 3147ac  (Amit Kapila <amit.kapila16@gmail.com>)
Ответы Re: Re: Server is not getting started with log level as debug5 on master after commit 3147ac  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Nov 22, 2013 at 9:30 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> In master branch, server is not getting started with log level as debug5.
>
> Simple steps to reproduce the problem:
> a. initdb -D ..\..\Data
> b. change log_min_messages = debug5 in postgresql.conf
> c. start server (pg_ctl start -D ..\..\Data)  -- server doesn't get started
>
> Relevant message on server console:
> DEBUG:  mapped win32 error code 2 to 2
> FATAL:  could not open recovery command file "recovery.conf": No error
>
> This problem occurs only in Windows, but the cause of problem is generic.
>
> I could think of below possible ways to fix the problem:
> a. in function pvsnprintf(), save the errno before setting it to 0 and
> then before exiting function reset it back to saved errno. I think
> this is sane because in function pvsnprintf, if any error occurs due
> to which errno is changed, it will not return control, so errno will
> not be required by callers.
> b. we can change the callers like _dosmaperr() who have responsibility
> to save errno for their callers.
>
> Patch with approach a) is attached with mail, we can change code as
> per approach b) or any other better method as well, but for now I have
> prepared patch with approach a), as I could not see any problem with
> it.

Again looking at it, I think better fix would be to restore 'errno'
from 'edata->saved_errno' in errfinish() incase the control returns
back to caller (elevel <= WARNING). It seems to me that this fix is
required anyway because if we return from errfinish (ereport/elog) to
caller, it should restore back 'errno', as caller might need to take
some action based on errno.
Patch to restore 'errno' in errfinish() is attached with this mail.

Any better ideas for fixing this issue?

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

Вложения

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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Proof of concept: standalone backend with full FE/BE protocol
Следующее
От: mohsen soodkhah mohammadi
Дата:
Сообщение: COPY TO