Conversation
Contributor
|
❗ By default, the pull request is configured to backport to all release branches.
|
Member
Author
|
/test limit=local |
Contributor
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/18529484354 |
Contributor
|
This should be backported as it is a minor change that prevents interference with some existing Postgres configurations. |
f1c4b8b to
157c727
Compare
Member
Author
|
/test limit=local |
Contributor
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/18554902297 |
mnencia
approved these changes
Oct 17, 2025
gbartolini
reviewed
Oct 18, 2025
Comment on lines
-599
to
-609
| db, err := r.instance.GetSuperUserDB() | ||
| if err != nil { | ||
| contextLogger.Error(err, "Cannot connect to primary server") | ||
| } else { | ||
| _, err = db.Exec("CHECKPOINT") | ||
| if err != nil { | ||
| contextLogger.Error(err, "Error while requesting a checkpoint") | ||
| } | ||
| } | ||
|
|
||
| contextLogger.Info("This is an old primary node. Shutting it down to get it demoted to a replica") |
Contributor
CHECKPOINT before smart and fast shutdowns
Contributor
|
/test |
Contributor
|
@gbartolini, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/18616741642 |
mnencia
approved these changes
Oct 20, 2025
Issue CHECKPOINT before shutdown to reduce shutdown time and subsequent replica promotion time for systems with high checkpoint_timeout. Follows best-effort pattern from instance_controller.go - logs errors but continues with shutdown. Skips checkpoint for immediate mode. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com>
gbartolini
approved these changes
Oct 20, 2025
cnpg-bot
pushed a commit
that referenced
this pull request
Oct 20, 2025
Run a `CHECKPOINT` before every PostgreSQL `smart` and `fast` shutdown request to reduce both shutdown duration and replica promotion time, especially in systems with a high `checkpoint_timeout`. This follows the best-effort approach used in `instance_controller.go`: errors during the checkpoint are logged, but the shutdown proceeds regardless. The checkpoint step is skipped for `immediate` shutdown mode. Closes #8865 Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> Co-authored-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> (cherry picked from commit d7b98ad)
cnpg-bot
pushed a commit
that referenced
this pull request
Oct 20, 2025
Run a `CHECKPOINT` before every PostgreSQL `smart` and `fast` shutdown request to reduce both shutdown duration and replica promotion time, especially in systems with a high `checkpoint_timeout`. This follows the best-effort approach used in `instance_controller.go`: errors during the checkpoint are logged, but the shutdown proceeds regardless. The checkpoint step is skipped for `immediate` shutdown mode. Closes #8865 Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> Co-authored-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> (cherry picked from commit d7b98ad)
cnpg-bot
pushed a commit
that referenced
this pull request
Oct 20, 2025
Run a `CHECKPOINT` before every PostgreSQL `smart` and `fast` shutdown request to reduce both shutdown duration and replica promotion time, especially in systems with a high `checkpoint_timeout`. This follows the best-effort approach used in `instance_controller.go`: errors during the checkpoint are logged, but the shutdown proceeds regardless. The checkpoint step is skipped for `immediate` shutdown mode. Closes #8865 Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> Co-authored-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> (cherry picked from commit d7b98ad)
THE-BRAHMA
pushed a commit
to THE-BRAHMA/cloudnative-pg
that referenced
this pull request
Oct 30, 2025
…ve-pg#8867) Run a `CHECKPOINT` before every PostgreSQL `smart` and `fast` shutdown request to reduce both shutdown duration and replica promotion time, especially in systems with a high `checkpoint_timeout`. This follows the best-effort approach used in `instance_controller.go`: errors during the checkpoint are logged, but the shutdown proceeds regardless. The checkpoint step is skipped for `immediate` shutdown mode. Closes cloudnative-pg#8865 Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Signed-off-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> Co-authored-by: Gabriele Bartolini <gabriele.bartolini@enterprisedb.com> Signed-off-by: theBrahma <office.utpal.brahma@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Run a
CHECKPOINTbefore every PostgreSQLsmartandfastshutdown request to reduce both shutdown duration and replica promotion time, especially in systems with a highcheckpoint_timeout.This follows the best-effort approach used in
instance_controller.go: errors during the checkpoint are logged, but the shutdown proceeds regardless. The checkpoint step is skipped forimmediateshutdown mode.Closes #8865