Re: [RFC] Should we fix postmaster to avoid slow shutdown?

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [RFC] Should we fix postmaster to avoid slow shutdown?
Date: 2016-11-22 10:02:38
Message-ID: CAFjFpRe9Fq7YYUm=6tyeYpmw+uBG506egZAbn89H0UtVWQPSTA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 22, 2016 at 12:26 PM, Tsunakawa, Takayuki
<tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com> wrote:
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
>> The point I was trying to make is that I think the forced-removal behavior
>> is not desirable, and therefore committing a patch that makes it be graven
>> in stone is not desirable either.
>
> I totally agree that we should pursue the direction for escaping from the complete loss of stats files. Personally, I would like to combine that with the idea of persistent performance diagnosis information for long-term analysis (IIRC, someone proposed it.) However, I don't think my patch will make everyone forget about the problem of stats file loss during recovery. The problem exists with or without my patch, and my patch doesn't have the power to delute the importance of the problem. If you are worried about memory, we can add an entry for the problem in TODO list that Bruce-san is maintaining.

I don't think Tom is worried about forgetting this. I think he is
worried that if we do the changes as suggested in 01... patch, we will
make it more difficult to change stats file behaviour later. Right now
we are throwing away statistics files at the time of crash recovery.
In case we want to change it tomorrow, we will have to fix the
existing problem with the half-written/stale stats files and then fix
not to zap those files at the time of crash recovery. In case we go
ahead with this patch, we will have more instances of creating
half-written/stale stats file, which will need to fixed.

>
> 9.4 change may be sufficient. But I don't think I can proudly explain the logic to a really severe customer. I can't answer the question "Why does PostgreSQL write files that will be deleted, even during 'immediate' shutdown? Why does PostgreSQL use 5 seconds for nothing?"
>
> Other children do nothing and exit immediately. I believe they are behaving correctly.

I agree, with this though.

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vladimir Svedov 2016-11-22 10:05:05 Re: postgres 9.3 postgres_fdw ::LOG: could not receive data from client: Connection reset by peer
Previous Message Kyotaro HORIGUCHI 2016-11-22 09:49:31 Re: Re: Use procsignal_sigusr1_handler and RecoveryConflictInterrupt() from walsender?