Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-11-22 Thread Thomas Munro
On Sat, Nov 17, 2018 at 2:27 PM Thomas Munro wrote: > Thanks for the review. Pushed. -- Thomas Munro http://www.enterprisedb.com

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-11-16 Thread Thomas Munro
On Sat, Nov 17, 2018 at 5:56 AM Tom Lane wrote: > Thomas Munro writes: > > [ 0001-Add-WL_EXIT_ON_PM_DEATH-pseudo-event-v4.patch ] > > I took a quick look through this. I have no objection to the idea of > letting the latch infrastructure do the proc_exit(1), but I'm wondering > why this is in

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-11-16 Thread Tom Lane
Thomas Munro writes: > [ 0001-Add-WL_EXIT_ON_PM_DEATH-pseudo-event-v4.patch ] I took a quick look through this. I have no objection to the idea of letting the latch infrastructure do the proc_exit(1), but I'm wondering why this is in the thread that it's in. Is there any remaining connection

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-11-15 Thread Kyotaro HORIGUCHI
At Fri, 26 Oct 2018 14:13:51 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20181026.141351.09076928.horiguchi.kyot...@lab.ntt.co.jp> > Thank you for the fix. > > At Tue, 23 Oct 2018 17:26:37 +1300, Thomas Munro > wrote in > > > On Thu, Sep 6, 2018 at 9:57 PM Kyotaro HORIGUCHI >

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-10-25 Thread Kyotaro HORIGUCHI
Thank you for the fix. At Tue, 23 Oct 2018 17:26:37 +1300, Thomas Munro wrote in > On Thu, Sep 6, 2018 at 9:57 PM Kyotaro HORIGUCHI > wrote: > > And don't we need a description about this restriction in the > > function comment? > > Ok, added. Thank you. It looks good. > While

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-10-22 Thread Thomas Munro
On Thu, Sep 6, 2018 at 9:57 PM Kyotaro HORIGUCHI wrote: > In sysloger.c, cur_flags is (just set but) no longer used. Right. Fixed. > === > In latch.c, > > - The parentheses around the symbols don't seem to be needed. > | (wakeEvents & (WL_EXIT_ON_PM_DEATH)) != 0 || > |

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-09-06 Thread Kyotaro HORIGUCHI
Ugrrr! PLEASE ignore this! It's not wrong at all. 2018年9月6日(木) 18:58 Kyotaro HORIGUCHI : > - The following assertion looks contradicting to the comment. > |/* Postmaster-managed callers must handle postmaster death somehow. */ > |Assert(!IsUnderPostmaster || > | (wakeEvents &

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-09-06 Thread Kyotaro HORIGUCHI
At Sun, 2 Sep 2018 07:04:19 +1200, Thomas Munro wrote in > > > # Is it intentional that the patch doesn't touch pgstat.c? > > > > Yes. pgstat.c still uses WL_POSTMASTER_DEATH because it does > > something special: it calls pgstat_write_statsfiles() before it exits. Mmm. Exactly.. > Rebased.

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-09-01 Thread Thomas Munro
On Thu, Jul 19, 2018 at 11:51 PM Thomas Munro wrote: > On Thu, Jul 19, 2018 at 10:30 PM, Kyotaro HORIGUCHI > > Yeah. That seems good. Couldn't we reuse prepared WaitEventSet in > > other places? For example PgstatCollectorMain has the same > > characteristics, where WaitLatchOrSocket is used with

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-07-19 Thread Thomas Munro
On Thu, Jul 19, 2018 at 10:30 PM, Kyotaro HORIGUCHI wrote: >> Hmm. Why wait any longer? The cluster is broken. Is there some >> correctness reason to defer shutdown in any of these places? > > Well, please don't get me wrong. I don't object to backends' exit > on postmaster death, rather I'm

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-07-19 Thread Kyotaro HORIGUCHI
At Thu, 19 Jul 2018 16:58:30 +1200, Thomas Munro wrote in > On Wed, Jul 18, 2018 at 8:30 PM, Kyotaro HORIGUCHI > wrote: > > At Wed, 18 Jul 2018 14:02:47 +1200, Thomas Munro > > wrote in > > > >> Here are some of the places I had to add WL_EXIT_ON_PM_DEATH: > >> gather_readnext(),

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-07-18 Thread Thomas Munro
On Wed, Jul 18, 2018 at 8:30 PM, Kyotaro HORIGUCHI wrote: > At Wed, 18 Jul 2018 14:02:47 +1200, Thomas Munro > wrote in > >> Here are some of the places I had to add WL_EXIT_ON_PM_DEATH: >> gather_readnext(), shm_mq_send_bytes(), shm_mq_receive_bytes(), >> shm_mq_wait_internal(), ProcSleep(),

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-07-17 Thread Thomas Munro
On Sat, Jul 14, 2018 at 5:34 AM, Heikki Linnakangas wrote: > On 18/04/18 09:55, Thomas Munro wrote: >> Here's a draft patch that does that. One contentious question is: >> should you have to opt *in* to auto-exit-on-postmaster death? Andres >> opined that you should. I actually think it's not

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-07-13 Thread Heikki Linnakangas
On 18/04/18 09:55, Thomas Munro wrote: Here's a draft patch that does that. One contentious question is: should you have to opt *in* to auto-exit-on-postmaster death? Andres opined that you should. I actually think it's not so bad if you don't have to do that, and instead have to opt out. I

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-04-18 Thread Thomas Munro
On Wed, Apr 18, 2018 at 6:55 PM, Thomas Munro wrote: > Here's a draft patch that does that. Here's a better one (the previous version could read past the end of the occurred_events array). -- Thomas Munro http://www.enterprisedb.com

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-04-18 Thread Thomas Munro
Hi, I'd like to disentangle two related topics. For "I want PostmasterIsAlive() to go faster using signals on platforms that can support that", please see over here:

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-04-11 Thread Thomas Munro
On Wed, Apr 11, 2018 at 12:47 PM, Thomas Munro wrote: > On Wed, Apr 11, 2018 at 12:26 PM, Andres Freund wrote: >> On 2018-04-11 12:17:14 +1200, Thomas Munro wrote: >>> I arrived at this idea via the realisation that the closest thing to >>>

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-04-10 Thread Thomas Munro
On Wed, Apr 11, 2018 at 12:26 PM, Andres Freund wrote: > On 2018-04-11 12:17:14 +1200, Thomas Munro wrote: >> I arrived at this idea via the realisation that the closest thing to >> prctl(PR_SET_PDEATHSIG) on BSD-family systems today is >>

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-04-10 Thread Andres Freund
Hi, On 2018-04-11 12:17:14 +1200, Thomas Munro wrote: > I arrived at this idea via the realisation that the closest thing to > prctl(PR_SET_PDEATHSIG) on BSD-family systems today is > please-tell-my-kqueue-if-this-process-dies. It so happens that my > kqueue patch already uses that instead of

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-04-10 Thread Thomas Munro
On Wed, Apr 11, 2018 at 12:03 PM, Andres Freund wrote: > On 2018-04-11 11:57:20 +1200, Thomas Munro wrote: >> Then if pgarch_ArchiverCopyLoop() and HandleStartupProcInterrupts() >> (ie loops without waiting) adopt a prctl(PR_SET_PDEATHSIG)-based >> approach where available as

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-04-10 Thread Andres Freund
Hi, On 2018-04-11 11:57:20 +1200, Thomas Munro wrote: > Rebased, but I don't actually like this patch any more. Over in > another thread[1] I proposed that we should just make exit(1) the > default behaviour built into latch.c for those cases that don't want > to do something special (eg

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2018-04-10 Thread Thomas Munro
On Tue, Sep 20, 2016 at 11:26 AM, Andres Freund wrote: > On 2016-09-20 11:07:03 +1200, Thomas Munro wrote: >> Yeah, I wondered why that was different than the pattern established >> elsewhere when I was hacking on replication code. There are actually >> several places where

Re: [HACKERS] PATCH: Keep one postmaster monitoring pipe per process

2017-12-04 Thread Marco Pfatschbacher
On Thu, Sep 15, 2016 at 04:40:00PM -0400, Tom Lane wrote: > Thomas Munro writes: > > Very interesting. Perhaps that is why NetBSD shows a speedup with the > > kqueue patch[1] but FreeBSD doesn't. I guess that if I could get the > > kqueue patch to perform better