Prev: [HACKERS] I am interested in the MERGE command implementation as my gSoC project
Next: pending patch: Re: [HACKERS] Streaming replication and pg_xlogfile_name()
From: Fujii Masao on 30 Mar 2010 05:09 On Mon, Feb 1, 2010 at 11:49 AM, Fujii Masao <masao.fujii(a)gmail.com> wrote: > On Sat, Jan 30, 2010 at 12:54 PM, Fujii Masao <masao.fujii(a)gmail.com> wrote: >>> HOWEVER, I do believe this is an issue we could live with for 9.0 if >>> it's going to lead to a whole lot of additional debugging of SR. But if >>> it's an easy fix, it'll avoid a lot of complaints on pgsql-general. >> >> I think that the latter statement is right. > > Though we've not reached consensus on smart shutdown during > recovery yet, I wrote the patch that changes its behavior: > shut down the server (including the startup process and the > walreceiver) as soon as all read-only connections have died. > The code is also available in the 'replication' branch in > my git repository. > > And, let's discuss whether something like the attached patch > is required for v9.0 or not. I rebased the patch to HEAD. Is the patch still required for 9.0? If not, I'd remove the open item of the smart shutdown during recovery. Regards, -- Fujii Masao NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center
From: Robert Haas on 30 Mar 2010 20:47 On Tue, Mar 30, 2010 at 5:09 AM, Fujii Masao <masao.fujii(a)gmail.com> wrote: > I rebased the patch to HEAD. Is the patch still required for 9.0? > If not, I'd remove the open item of the smart shutdown during > recovery. I am by no means an expert on this area of the code, but in the interest of moving things along I reviewed this patch tonight. 1. I wonder if there is a problem if we receive SIGINT while in the PM_WAIT_READONLY state? Seems to me that might need to be added to the if statement beginning at line 2212, in pmdie(). 2. It appears to me that HandleChildCrash() needs to switch to PM_WAIT_BACKENDS state if it's in PM_WAIT_READONLY when the child crash occurs - i.e. the if statement beginning at line 2772 needs updating. Thoughts? ....Robert -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Fujii Masao on 30 Mar 2010 21:48 On Wed, Mar 31, 2010 at 9:47 AM, Robert Haas <robertmhaas(a)gmail.com> wrote: > On Tue, Mar 30, 2010 at 5:09 AM, Fujii Masao <masao.fujii(a)gmail.com> wrote: >> I rebased the patch to HEAD. Is the patch still required for 9.0? >> If not, I'd remove the open item of the smart shutdown during >> recovery. > > I am by no means an expert on this area of the code, but in the > interest of moving things along I reviewed this patch tonight. Thanks a lot! > 1. I wonder if there is a problem if we receive SIGINT while in the > PM_WAIT_READONLY state? Seems to me that might need to be added to > the if statement beginning at line 2212, in pmdie(). > > 2. It appears to me that HandleChildCrash() needs to switch to > PM_WAIT_BACKENDS state if it's in PM_WAIT_READONLY when the child > crash occurs - i.e. the if statement beginning at line 2772 needs > updating. > > Thoughts? Oh, those are my oversights. You are right! I modified the patch as you pointed out. Regards, -- Fujii Masao NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center
From: Robert Haas on 30 Mar 2010 23:10 On Tue, Mar 30, 2010 at 9:48 PM, Fujii Masao <masao.fujii(a)gmail.com> wrote: > On Wed, Mar 31, 2010 at 9:47 AM, Robert Haas <robertmhaas(a)gmail.com> wrote: >> On Tue, Mar 30, 2010 at 5:09 AM, Fujii Masao <masao.fujii(a)gmail.com> wrote: >>> I rebased the patch to HEAD. Is the patch still required for 9.0? >>> If not, I'd remove the open item of the smart shutdown during >>> recovery. >> >> I am by no means an expert on this area of the code, but in the >> interest of moving things along I reviewed this patch tonight. > > Thanks a lot! > >> 1. I wonder if there is a problem if we receive SIGINT while in the >> PM_WAIT_READONLY state? Seems to me that might need to be added to >> the if statement beginning at line 2212, in pmdie(). >> >> 2. It appears to me that HandleChildCrash() needs to switch to >> PM_WAIT_BACKENDS state if it's in PM_WAIT_READONLY when the child >> crash occurs - i.e. the if statement beginning at line 2772 needs >> updating. >> >> Thoughts? > > Oh, those are my oversights. You are right! > I modified the patch as you pointed out. Cool. This looks good to me now and I also tested it. I will commit it unless (a) someone objects or (b) someone else does it first. ....Robert -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Simon Riggs on 31 Mar 2010 04:00
On Wed, 2010-03-31 at 10:48 +0900, Fujii Masao wrote: > On Wed, Mar 31, 2010 at 9:47 AM, Robert Haas <robertmhaas(a)gmail.com> wrote: > > On Tue, Mar 30, 2010 at 5:09 AM, Fujii Masao <masao.fujii(a)gmail.com> wrote: > >> I rebased the patch to HEAD. Is the patch still required for 9.0? > >> If not, I'd remove the open item of the smart shutdown during > >> recovery. > > > > I am by no means an expert on this area of the code, but in the > > interest of moving things along I reviewed this patch tonight. > > Thanks a lot! > > > 1. I wonder if there is a problem if we receive SIGINT while in the > > PM_WAIT_READONLY state? Seems to me that might need to be added to > > the if statement beginning at line 2212, in pmdie(). > > > > 2. It appears to me that HandleChildCrash() needs to switch to > > PM_WAIT_BACKENDS state if it's in PM_WAIT_READONLY when the child > > crash occurs - i.e. the if statement beginning at line 2772 needs > > updating. > > > > Thoughts? > > Oh, those are my oversights. You are right! > I modified the patch as you pointed out. Please add some docs that a) explains what the patch does and b) notes any changes from behaviour in previous releases. ISTM this is a major change in behaviour. The reason for the lack of consensus on this issue is simply people aren't following what you're talking about and don't want to have to re-read a whole thread to do so. It might be that many would agree. >From what I have seen, the comment about PM_WAIT_BACKENDS is incorrect. "backends might be waiting for the WAL record that conflicts with their queries to be replayed". Recovery sometimes waits for backends, but backends never wait for recovery. -- Simon Riggs www.2ndQuadrant.com -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers |