Skip to content

feat: default smartShutdownTimeout to 0 seconds - #11944

Merged
armru merged 4 commits into
mainfrom
dev/smart-shutdown-default-0
Nov 18, 2026
Merged

armru merged 4 commits into
mainfrom
dev/smart-shutdown-default-0

Conversation

@gbartolini

@gbartolini gbartolini commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Change the default of .spec.smartShutdownTimeout from 180 to 0, so that new clusters skip the smart shutdown phase and request a fast shutdown (still preceded by a CHECKPOINT) as soon as a PostgreSQL Pod is terminated. The smart phase waits for clients to disconnect and rarely completes with long-lived application and pooler connections, delaying node drains and rolling updates.

Existing clusters keep the value already persisted in their spec. Add an "Upgrading to 1.31.0" section explaining how to set the previous value explicitly.

Closes #11943

Assisted-by: Claude

@gbartolini
gbartolini requested a review from a team as a code owner November 17, 2026 13:52
@gbartolini

Copy link
Copy Markdown
Contributor Author

/test

@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.28 release-1.30 labels Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@github-actions

Copy link
Copy Markdown
Contributor

Change the default of `.spec.smartShutdownTimeout` from 180 to 0, so that
new clusters skip the smart shutdown phase and request a fast shutdown
(still preceded by a CHECKPOINT) as soon as a PostgreSQL Pod is
terminated. The smart phase waits for clients to disconnect and rarely
completes with long-lived application and pooler connections, delaying
node drains and rolling updates.

Existing clusters keep the value already persisted in their spec. Add an
"Upgrading to 1.31.0" section explaining how to set the previous value
explicitly.

Assisted-by: Claude

Signed-off-by: Gabriele Bartolini <[email protected]>
@mnencia
mnencia force-pushed the dev/smart-shutdown-default-0 branch from c89bd82 to 10e3838 Compare November 18, 2026 08:46
@leonardoce leonardoce added do not backport This PR must not be backported - it will be in the next minor release and removed backport-requested ◀️ This pull request should be backported to all supported releases release-1.28 release-1.30 labels Nov 18, 2026
Signed-off-by: Leonardo Cecchi <[email protected]>
The upgrade note described the change only for a terminated Pod. An
in-place restart of the primary shuts PostgreSQL down through the same
procedure, so a cluster using the new default no longer waits for
clients there either. State that the behavior depends on the default
being in use, and mention in-place restarts in the shutdown procedure.

An existing cluster keeps the stored value when it is patched, but takes
the new default when the whole resource is replaced with a definition
that does not set the field. Add this case to the upgrade note.

Signed-off-by: Armando Ruocco <[email protected]>
…eout`

The unit test added with the new default covers only the getter. Verify
that an instance manager without an explicit timeout requests a fast
shutdown as its first and only `pg_ctl stop`.

Signed-off-by: Armando Ruocco <[email protected]>
@armru
armru merged commit 78a018f into main Nov 18, 2026
@armru
armru deleted the dev/smart-shutdown-default-0 branch November 18, 2026 12:28
cnpg-bot pushed a commit to cloudnative-pg/api that referenced this pull request Nov 18, 2026
…udnative-pg#11944)

Change the default of `.spec.smartShutdownTimeout` from 180 to 0, so
that new clusters skip the smart shutdown phase and request a fast
shutdown (still preceded by a CHECKPOINT) as soon as a PostgreSQL Pod is
terminated. The smart phase waits for clients to disconnect and rarely
completes with long-lived application and pooler connections, delaying
node drains and rolling updates.

Existing clusters keep the value already persisted in their spec. Add an
"Upgrading to 1.31.0" section explaining how to set the previous value
explicitly.

Closes cloudnative-pg/cloudnative-pg#11943

Assisted-by: Claude

Signed-off-by: Gabriele Bartolini <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Co-authored-by: Leonardo Cecchi <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>

(cherry picked from commit cloudnative-pg/cloudnative-pg@78a018f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not backport This PR must not be backported - it will be in the next minor release ok to merge 👌 This PR can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change the default of .spec.smartShutdownTimeout from 180 to 0 seconds

4 participants