pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: WR <wolle321@freenet.de>
To: Ninad Shah <nshah.postgres@gmail.com>
Cc: Vijaykumar Jain <vijaykumarjain.github@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Obsolete or dead serverconnections after reboot
Date: Mon, 26 Jul 2021 09:31:03 +0200
Message-ID: <0fc1f047-9be7-9fbf-7f9f-e66f30b6bfef@freenet.de> (raw)
In-Reply-To: <CAOFEiBfKFJb-QZ0WdEs+-gq5SOX+j4w8BSCdm=7YZ_e3KzqQcg@mail.gmail.com>
References: <9da9e765-9042-4f5e-00a1-4695d1244a47@freenet.de>
	<CAM+6J96cyN1L_gGMNtA6r9kF-_-X6Ef-=td7zev8GFRWLhpPkg@mail.gmail.com>
	<CAM+6J97QBebDc55bS6sD9F2zrv59yYkF-degQd-r6gULtPvPVA@mail.gmail.com>
	<32bb4b13-2ec1-91c6-4e1f-efa51cfd25c0@freenet.de>
	<CAOFEiBdgNiz9E5w+f==Wrp7kO9EMg8tizQLqgDDbC+2_hEhAxA@mail.gmail.com>
	<864515f0-8009-cd89-85e1-e4e65391e092@freenet.de>
	<CAOFEiBdWzSBUCJ09SVD63m98k3ZKmxoNkO46Bf=KHu7J16DeYQ@mail.gmail.com>
	<ae4e4c33-89fe-5f2d-36b0-5e4fe7623925@freenet.de>
	<CAOFEiBfKFJb-QZ0WdEs+-gq5SOX+j4w8BSCdm=7YZ_e3KzqQcg@mail.gmail.com>

Hello Ninad Shah,

Thank you for clarification.
The state of the mentioned connections was "Idle" in pg_stat_activity.

Now on my Laptops the shutdown of the postgres-service works too.

I had to switch off the "Schnellstart" (in english something like "fast 
start" or "fast boot"), which can be found under Settings > System > 
Energy Options > Behavior when pushing the Power-Button / Closing the 
Computer

There in the lower part of the dialog "Settings for Shutdown"

The Option is then disabled first, but can be enabled with a link in the 
upper Part of the dialog.

(Dont ask me why it is so complicated, and what this Option has to do 
with the Power Button / closing the Display, it affects every kind of 
shutdown)

Thanks you for your help.
Wolfgang



Am 23.07.2021 um 16:31 schrieb Ninad Shah:
> Just to make it clear, "idle in transaction" and "idle" are different 
> terms. "Idle in transaction" refers to connections that are waiting for 
> either commit or rollback.
> 
> Additionally, this could be a bug as well. However, it's difficult to 
> conclude at this stage. You may report this to postgresql-bugs group.
> 
> 
> Regards,
> Ninad Shah
> 
> On Fri, 23 Jul 2021 at 17:25, WR <wolle321@freenet.de 
> <mailto:wolle321@freenet.de>> wrote:
> 
>     Hello,
> 
>     unfortunately, it's my companys choice of OS.
>     In private life I'm riding the penguin.
> 
>     One last thing: I have 2 Laptops, where the shutdown doesn't work, and
>     one VirtualBox machine where it works like a charm. Maybe it has
>     something to do with the power management.
> 
>     As a workaround I set the value
>     idle_in_transaction_session_timeout
>     to 5min. So the server kills this idle connections from before the
>     power
>     cycle (and all others too) after 5 minutes.
> 
>     Thank you, guys
> 
>     (PS.: still no answer from EDB)
> 
>     Am 22.07.2021 um 16:51 schrieb Ninad Shah:
>      > Factually, Windows itself has a number of issues. Hence, it is
>     always
>      > suggested to use Linux with it.
>      >
>      > It can be explored further by querying the table from which
>      > pg_stat_activity gathers data.
>      >
>      >
>      > Regards,
>      > Ninad Shah
>      >
>      >
>      > On Thu, 22 Jul 2021 at 12:51, WR <wolle321@freenet.de
>     <mailto:wolle321@freenet.de>
>      > <mailto:wolle321@freenet.de <mailto:wolle321@freenet.de>>> wrote:
>      >
>      >     Hello Ninad Shah,
>      >
>      >     I think, nobody holds the connections, because the state is
>     idle. But
>      >     I'm not shure what means: the connection is idle.
>      >
>      >     One interesting fact was: when I dont stop the psql
>     commandline on the
>      >     client (and dont start another query, wht ends up in a connection
>      >     reset,
>      >     while the server is down), psql uses the same connection
>     after reboot
>      >     and the state goes from idle back to active.
>      >
>      >     So there are two questions: what will happen to idle
>     connctions after a
>      >     while, if the client doesnt exist anymore.
>      >     And is this desired behavior, the the postgres-Server-Service
>     does
>      >     not a
>      >     shutdown on reboot on windows. (seem my mail to Vijaykumar Jain)
>      >
>      >     Thanks you, Greeting from germany,
>      >     Wolfgang
>      >
>      >     Am 21.07.2021 um 16:10 schrieb Ninad Shah:
>      >      > Hello,
>      >      >
>      >      > Would you be able to verify the process trees for those
>     PIDs on
>      >     Windows?
>      >      > You may be able to see who holds the connections?
>      >      >
>      >      >
>      >      > Regards,
>      >      > Ninad Shah
>      >      >
>      >      > On Wed, 21 Jul 2021 at 19:15, WR <wolle321@freenet.de
>     <mailto:wolle321@freenet.de>
>      >     <mailto:wolle321@freenet.de <mailto:wolle321@freenet.de>>
>      >      > <mailto:wolle321@freenet.de <mailto:wolle321@freenet.de>
>     <mailto:wolle321@freenet.de <mailto:wolle321@freenet.de>>>> wrote:
>      >      >
>      >      >     Hello Vijaykumar Jain,
>      >      >
>      >      >     thank you for fast answer, today I'm not able to
>     access the
>      >     hardware,
>      >      >     I'll be back tomorrow and will do the required tests.
>      >      >
>      >      >     Wolfgang
>      >      >
>      >      >     Am 21.07.2021 um 15:14 schrieb Vijaykumar Jain:
>      >      >      > select pg_stat_reset();
>      >      >      >
>      >      >      > Can you run above function, to check if stats are
>     reset and
>      >      >     things are
>      >      >      > fine without a pg restart?
>      >      >      > I not able to understand how new connection stats
>     are added,
>      >      >     along with
>      >      >      > old stale states, if I assume stats collector
>     process is
>      >     having
>      >      >     issues ,
>      >      >      > or the stats folder is corrupt etc.
>      >      >      > That would also mean, all table stats would be off
>     or not
>      >     updated
>      >      >     too?
>      >      >      > Is that so? Or analyse works fine on tables without
>     a restart?
>      >      >      >
>      >      >      > On Wed, Jul 21, 2021, 6:27 PM Vijaykumar Jain
>      >      >      > <vijaykumarjain.github@gmail.com
>     <mailto:vijaykumarjain.github@gmail.com>
>      >     <mailto:vijaykumarjain.github@gmail.com
>     <mailto:vijaykumarjain.github@gmail.com>>
>      >      >     <mailto:vijaykumarjain.github@gmail.com
>     <mailto:vijaykumarjain.github@gmail.com>
>      >     <mailto:vijaykumarjain.github@gmail.com
>     <mailto:vijaykumarjain.github@gmail.com>>>
>      >      >      > <mailto:vijaykumarjain.github@gmail.com
>     <mailto:vijaykumarjain.github@gmail.com>
>      >     <mailto:vijaykumarjain.github@gmail.com
>     <mailto:vijaykumarjain.github@gmail.com>>
>      >      >     <mailto:vijaykumarjain.github@gmail.com
>     <mailto:vijaykumarjain.github@gmail.com>
>      >     <mailto:vijaykumarjain.github@gmail.com
>     <mailto:vijaykumarjain.github@gmail.com>>>>> wrote:
>      >      >      >
>      >      >      >
>      >      >      >
>      >      >      >         Is there a way to avoid this (without
>     restarting
>      >     the service
>      >      >      >         after every
>      >      >      >         reboot). Is this a bug or a normal behavior?
>      >      >      >
>      >      >      >
>      >      >      >     I have less knowledge of windows.
>      >      >      >
>     https://www.enterprisedb.com/blog/postgresql-shutdown
>     <https://www.enterprisedb.com/blog/postgresql-shutdown;
>      >     <https://www.enterprisedb.com/blog/postgresql-shutdown
>     <https://www.enterprisedb.com/blog/postgresql-shutdown>;
>      >      >     <https://www.enterprisedb.com/blog/postgresql-shutdown
>     <https://www.enterprisedb.com/blog/postgresql-shutdown;
>      >     <https://www.enterprisedb.com/blog/postgresql-shutdown
>     <https://www.enterprisedb.com/blog/postgresql-shutdown>>;
>      >      >      >   
>       <https://www.enterprisedb.com/blog/postgresql-shutdown
>     <https://www.enterprisedb.com/blog/postgresql-shutdown;
>      >     <https://www.enterprisedb.com/blog/postgresql-shutdown
>     <https://www.enterprisedb.com/blog/postgresql-shutdown>;
>      >      >     <https://www.enterprisedb.com/blog/postgresql-shutdown
>     <https://www.enterprisedb.com/blog/postgresql-shutdown;
>      >     <https://www.enterprisedb.com/blog/postgresql-shutdown
>     <https://www.enterprisedb.com/blog/postgresql-shutdown>>>;
>      >      >      >
>      >      >      >
>      >      >      >
>      >      >      >     Do you see shutdown/termination messages in the
>     db logs or
>      >      >     windows
>      >      >      >     event logs when the machine is rebooted?
>      >      >      >
>      >      >      >     You get the same pid and query, does it also
>     has the same
>      >      >     age( time
>      >      >      >     since it started),
>      >      >      >     I mean is the stats table updated with new data
>     for stale
>      >      >      >     connections or they remain static.
>      >      >      >
>      >      >      >     Do you see the same issue when the machine is power
>      >     cycled.
>      >      >      >
>      >      >      >     Maybe windows might be preserving the memory
>     state on
>      >     disk and
>      >      >      >     reading it back on reboot (like sleep) unless
>     there are
>      >      >     instructions
>      >      >      >     to shutdown the db server on reboot. Idk.
>      >      >      >
>      >      >      >     What are the state of the connections in
>      >     pg_stat_activity abd
>      >      >      >     process explorer before and after reboot. The
>     sockets
>      >     exists and
>      >      >      >     active,  or are residual in pg stats only.
>      >      >      >
>      >      >      >
>      >      >
>      >      >
>      >      >
>      >
>      >
>      >     --
>      >     May the source be with you
>      >
> 
> 
>     -- 
>     May the source be with you
> 


-- 
May the source be with you





view thread (15+ messages)  latest in thread

Message-ID: <0fc1f047-9be7-9fbf-7f9f-e66f30b6bfef@freenet.de>
Permalink:  ../0fc1f047-9be7-9fbf-7f9f-e66f30b6bfef@freenet.de/
Also on:    postgresql.org/message-id/0fc1f047-9be7-9fbf-7f9f-e66f30b6bfef@freenet.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: wolle321@freenet.de, nshah.postgres@gmail.com, vijaykumarjain.github@gmail.com
  Subject: Re: Obsolete or dead serverconnections after reboot
  In-Reply-To: <0fc1f047-9be7-9fbf-7f9f-e66f30b6bfef@freenet.de>
  References: <9da9e765-9042-4f5e-00a1-4695d1244a47@freenet.de> <CAM+6J96cyN1L_gGMNtA6r9kF-_-X6Ef-=td7zev8GFRWLhpPkg@mail.gmail.com> <CAM+6J97QBebDc55bS6sD9F2zrv59yYkF-degQd-r6gULtPvPVA@mail.gmail.com> <32bb4b13-2ec1-91c6-4e1f-efa51cfd25c0@freenet.de> <CAOFEiBdgNiz9E5w+f==Wrp7kO9EMg8tizQLqgDDbC+2_hEhAxA@mail.gmail.com> <864515f0-8009-cd89-85e1-e4e65391e092@freenet.de> <CAOFEiBdWzSBUCJ09SVD63m98k3ZKmxoNkO46Bf=KHu7J16DeYQ@mail.gmail.com> <ae4e4c33-89fe-5f2d-36b0-5e4fe7623925@freenet.de> <CAOFEiBfKFJb-QZ0WdEs+-gq5SOX+j4w8BSCdm=7YZ_e3KzqQcg@mail.gmail.com> <0fc1f047-9be7-9fbf-7f9f-e66f30b6bfef@freenet.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox