Michael Paquier - PostgreSQL committer

  • Home
  • Manuals
  • Presentations
  • Projects
  • Resume
  • Tags
  • About

Postgres 9.5 feature highlight - Default shutdown mode of pg_ctl to fast

You liked this post or you have a comment? Contact information is available here and sponsoring is here.
04 Apr 2015
Tags: postgres, postgresql, 9.5, pg_ctl

This week, I wanted to share something that may impact many users of Postgres, with this commit changing a behavior in a binary utility that had for a long time been the same default:

commit: 0badb069bc9f590dbc1306ccbd51e99ed81f228c
author: Bruce Momjian <bruce@momjian.us>
date: Tue, 31 Mar 2015 11:46:27 -0400
pg_ctl:  change default shutdown mode from 'smart' to 'fast'

Retain the order of the options in the documentation.

pg_ctl has three shutdown modes:

  • smart, the polite one, waits patiently for all the active clients connections to be disconnected before shutting down the server. This is the default mode for Postgres for ages.
  • immediate, the brute-force one, aborts all the server processes without thinking, leading to crash recovery when the instance is restarted the next time.
  • fast, takes an intermediate approach by rollbacking all the existing connections and then shutting down the server.

Simply, the “smart” mode has been considered the default because it is the least distuptive, particularly it will wait for a backup to finish before shutting down the server. It has been (justly) discussed that it was not enough aggresive, users being sometimes surprised that a shutdown requested can finish with a timeout because a connection has been for example left open, hence the default has been switched to “fast”.

This is not complicated litterature, however be careful if you had scripts that relied on the default behavior of pg_ctl when switching to 9.5, particularly for online backups that will be immediately terminated at shutdown with the new default.

Search

Social

Github

Mastodon

Twitter

RSS Feeds

Main

Postgres

Sponsor

Unless otherwise specified, the contents of this website are (C)Copyright Michael Paquier 2010-2023 and are licensed for use under CC BY-SA 3.0.