pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedClean Postgres shutdown
3+ messages / 3 participants
[nested] [flat]
* Clean Postgres shutdown
@ 2021-01-19 10:10 Yambu <hyambu@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Yambu @ 2021-01-19 10:10 UTC (permalink / raw)
To: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Hello
Is there a clean way to shutdown postgres which completes transactions and
does not abort them.
I ran #systemctl stop postgresql-10
2021-01-18 14:31:28.600 GMT [10594] LOG: received fast shutdown request
2021-01-18 14:31:28.603 GMT [10594] LOG: aborting any active transactions
2021-01-18 14:31:28.607 GMT [10594] LOG: worker process: logical
replication launcher (PID 10604) exited with exit code 1
2021-01-18 14:31:28.613 GMT [10598] LOG: shutting down
2021-01-18 14:31:28.634 GMT [23850] FATAL: the database system is shutting
down
2021-01-18 14:31:29.119 GMT [10594] LOG: database system is shut down
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Clean Postgres shutdown
@ 2021-01-19 11:00 Laurenz Albe <laurenz.albe@cybertec.at>
parent: Yambu <hyambu@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Laurenz Albe @ 2021-01-19 11:00 UTC (permalink / raw)
To: Yambu <hyambu@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
On Tue, 2021-01-19 at 12:10 +0200, Yambu wrote:
> Is there a clean way to shutdown postgres which completes transactions and does not abort them.
>
> I ran #systemctl stop postgresql-10
>
> 2021-01-18 14:31:28.600 GMT [10594] LOG: received fast shutdown request
> 2021-01-18 14:31:28.603 GMT [10594] LOG: aborting any active transactions
> 2021-01-18 14:31:28.607 GMT [10594] LOG: worker process: logical replication launcher (PID 10604) exited with exit code 1
> 2021-01-18 14:31:28.613 GMT [10598] LOG: shutting down
> 2021-01-18 14:31:28.634 GMT [23850] FATAL: the database system is shutting down
> 2021-01-18 14:31:29.119 GMT [10594] LOG: database system is shut down
Yes, that is the "smart" shutdown mode that will wait for all sessions to finish.
Admitted, that's not the same as waiting for the end of the *transaction*, but
it is the closest thing we have.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Clean Postgres shutdown
@ 2021-01-19 11:02 Magnus Hagander <magnus@hagander.net>
parent: Laurenz Albe <laurenz.albe@cybertec.at>
0 siblings, 0 replies; 3+ messages in thread
From: Magnus Hagander @ 2021-01-19 11:02 UTC (permalink / raw)
To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Yambu <hyambu@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
On Tue, Jan 19, 2021 at 12:01 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>
> On Tue, 2021-01-19 at 12:10 +0200, Yambu wrote:
> > Is there a clean way to shutdown postgres which completes transactions and does not abort them.
> >
> > I ran #systemctl stop postgresql-10
> >
> > 2021-01-18 14:31:28.600 GMT [10594] LOG: received fast shutdown request
> > 2021-01-18 14:31:28.603 GMT [10594] LOG: aborting any active transactions
> > 2021-01-18 14:31:28.607 GMT [10594] LOG: worker process: logical replication launcher (PID 10604) exited with exit code 1
> > 2021-01-18 14:31:28.613 GMT [10598] LOG: shutting down
> > 2021-01-18 14:31:28.634 GMT [23850] FATAL: the database system is shutting down
> > 2021-01-18 14:31:29.119 GMT [10594] LOG: database system is shut down
>
> Yes, that is the "smart" shutdown mode that will wait for all sessions to finish.
>
> Admitted, that's not the same as waiting for the end of the *transaction*, but
> it is the closest thing we have.
It is, and this is very unfortunate :/ Because waiting until the end
of running transactions would actually be useful, whereas waiting to
the end of sessions is usually the wrong thing to do.
So in the perspective of most applications, we can just say we don't
have it, and people should sue the fast mode (default).
--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2021-01-19 11:02 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 10:10 Clean Postgres shutdown Yambu <hyambu@gmail.com>
2021-01-19 11:00 ` Laurenz Albe <laurenz.albe@cybertec.at>
2021-01-19 11:02 ` Magnus Hagander <magnus@hagander.net>
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