Re: Allow interrupts on waiting standby

From: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: 'Michael Paquier' <michael(dot)paquier(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow interrupts on waiting standby
Date: 2017-03-29 08:04:42
Message-ID: 0A3221C70F24FB45833433255569204D1F6BD1B7@G01JPEXMBYT05
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Hi, Michael,

From: pgsql-hackers-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org] On Behalf Of Michael Paquier
> What do you think about the updated version attached?

I reviewed this patch. Here are some comments and questions:

(1) monitoring.sgml
The new row needs to be placed in the "Timeout" group. The current patch puts the row at the end of IO group. Please insert the new row according to the alphabetical order.

In addition, "morerows" attribute of the following line appears to be increased.

<entry morerows="2"><literal>Timeout</></entry>

By the way, doesn't this wait event belong to IPC wait event type, because the process is waiting for other conflicting processes to terminate the conflict conditions? Did you choose Timeout type because max_standby_{archive | streaming}_delay relates to this wait? I'm not confident which is appropriate, but I'm afraid users can associate this wait with a timeout.

(2) standby.c
Do we need to specify WL_LATCH_SET? Who can set the latch? Do the backends who ended the conflict set the latch?

(3) standby.c
+ if (rc & WL_LATCH_SET)
+ ResetLatch(MyLatch);
+
+ /* emergency bailout if postmaster has died */
+ if (rc & WL_POSTMASTER_DEATH)
+ proc_exit(1);

I thought the child processes have to terminate as soon as postmaster vanishes. So, it would be better for the order of the two if statements above to be reversed. proc_exit() could be exit(), as some children do in postmaster/*.c.

(4) standby.c
The latch is not reset when the wait timed out. The next WaitLatch() would return immediately.

Regards
Takayuki Tsunakawa

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Law 2017-03-29 08:11:01 [PATCH] Remove trailing spaces
Previous Message Kyotaro HORIGUCHI 2017-03-29 07:49:38 Re: Partitioned tables and relfilenode