Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, michael(at)paquier(dot)xyz
Cc: robertmhaas(at)gmail(dot)com, kuroda(dot)hayato(at)fujitsu(dot)com, shlok(dot)kyal(dot)oss(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows
Date: 2024-06-06 19:03:41
Message-ID: 3322a97e-97d2-4811-bc10-fbf279b5a5ce@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2024-06-06 Th 04:15, Kyotaro Horiguchi wrote:
> At Thu, 06 Jun 2024 16:45:00 +0900 (JST), Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote in
>> I have been thinking about this since then. At first, I thought it
>> referred to FindFirstChangeNotification() and friends, and inotify on
>> Linux. However, I haven't found a way to simplify the specified code
>> area using those APIs.
> By the way, the need to shift by 2 seconds to tolerate clock skew
> suggests that the current launcher-postmaster association mechanism is
> somewhat unreliable. Couldn't we add a command line option to
> postmaster to explicitly pass a unique identifier (say, pid itself) of
> the launcher? If it is not specified, the number should be the PID of
> the immediate parent process.
>
> This change avoids the need for the special treatment for Windows.
>

Looks good generally. I assume iterating over the process table to find
the right pid will be pretty quick.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2024-06-06 19:07:02 Re: Assert in heapgettup_pagemode() fails due to underlying buffer change
Previous Message Alexander Lakhin 2024-06-06 19:00:01 Re: Assert in heapgettup_pagemode() fails due to underlying buffer change