Re: Issue in PG start

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Ron <ronljohnsonjr(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Issue in PG start
Date: 2021-05-08 16:53:45
Message-ID: 240268.1620492825@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> writes:
> On 5/8/21 9:23 AM, Ron wrote:
>> Is Windows Postgresql a service? If so then Windows "should" shut it
>> down cleanly when you cleanly power off the machine.

> The log would indicate otherwise:
>
>>> 2021-05-08 10:26:20.783 IST [7360] LOG: database system was
>>> interrupted; last known up at 2021-05-07 18:46:00 IST
>
> So something is not working as it should.

Yeah, that's bad news. In theory, as long as you didn't set
fsync = off, Postgres should be able to recover from an unclean
shutdown. In practice, that requires all the levels of the
hardware and software stack to pay strict attention to write
ordering requirements. It is, um, pretty common for inexpensive
Windows gear to not be very careful about that. I'd say this
particular machine has clearly failed the plug-pull test [1].

If the OP is in the habit of just hitting the power switch
at lunchtime, I'd say he's got to stop doing that. Telling
Windows to shut down will add a few seconds, but greatly
reduce the risk of problems (and not only for Postgres).
If he *did* tell Windows to shut down, then there's something
else that needs adjustment.

regards, tom lane

[1] https://wiki.postgresql.org/wiki/Reliable_Writes

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter J. Holzer 2021-05-08 19:07:58 Re: idle_in_transaction_session_timeout
Previous Message Adrian Klaver 2021-05-08 16:32:09 Re: Issue in PG start