You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Declarative support for PostgreSQL major in-place upgrades #4682
Alternative approaches are valid too, for example through CRDs that evoke imperative names (like upgrades) and that are useful too as they prepare the underlying PVCs for the new major.
Reacted by Terdunov Vyacheslav, altitude1326, Christian Ciach, kyklos, Abhishek Chanda, Douglas Greenbaum, Moray Baruh, Matt M., duffn, isdinAghmir and 50 more
Reacted by D, Phillip Schichtel, Ani Ravi, Joseph Glanville, 0xAuwtch, Lukasz Raczylo, Max Makarov, George Gaál, Jack Langston, Jakob Hofer and 11 more
Reacted by Giuseppe Binetti, kyklos, Zoë Sam Candy, Matt M., Hendrik Ferber, Ani Ravi, Joseph Glanville, 0xAuwtch, Lukasz Raczylo, Maxime Nrb and 14 more
Reacted by Zoë Sam Candy, D, Joseph Glanville, 0xAuwtch, Lukasz Raczylo, Antonio Augusto Maccarini, Daniel Sachse, Christopher Demicoli and Jake Klingler
changed the title [-]Declarative support for PostgreSQL major online upgrades[/-][+]Declarative support for PostgreSQL major in-place upgrades[/+]on Dec 6, 2024
Version 1.25 introduced support for logical subscriptions, which simplifies the process of performing major upgrades using logical replication. Additionally, we've added the ability to perform parallel dump and restore, providing more flexibility for handling large-scale database operations. These features already cover many everyday use cases—logical online upgrades were, in fact, our preferred approach for Postgres upgrades during our time at 2ndQuadrant.
I've been reflecting on this feature and considering how the direction we're taking with operand container images and extensions might influence its evolution. Specifically, we're working towards separating PostgreSQL operand images from extensions starting with PostgreSQL 18, with a proposed patch by EDB for the extension_control_path in PostgreSQL (see RFC: Extension Packaging Lookup. It is hard to say without a prototype, but I remain concerned about the potential for extension upgrades to lead to unpredictable or unrecoverable scenarios.
However, given the strong demand for this feature, one approach for an initial implementation could be an offline update. If the update fails, the system would revert to the previous PostgreSQL version, resulting in an inconsistent state and requiring manual intervention to change the cluster definition. If successful, the process would promote the primary, destroy the standbys, and recreate them in sequence. Thoughts?
Given our current commitments, I believe we can start working on this feature for version 1.26. However, due to the uncertainties mentioned earlier, there is a possibility that its delivery might be delayed.
one approach for an initial implementation could be an offline update. If the update fails, the system would revert to the previous PostgreSQL version, resulting in an inconsistent state and requiring manual intervention to change the cluster definition.
The main point of concern is extensions, right? How is the risk of failure/inconsistency different when performing offline updates?
one approach for an initial implementation could be an offline update. If the update fails, the system would revert to the previous PostgreSQL version, resulting in an inconsistent state and requiring manual intervention to change the cluster definition.
The main point of concern is extensions, right? How is the risk of failure/inconsistency different when performing offline updates?
You work on a new cluster. You have time to prepare it in advance and test it, especially with applications. That's always been the main advantage of migrations to a different cluster, at least in my experience. You will have time to test upgrades to a different extension version as well.
Ah ok that's what you mean, makes sense. The declarative in-place upgrade approach wouldn't prevent people from using the imperative approach to have more safety if preferred, right? Even clusters that don't use extensions could hit a bug in a newer PG version and (subtly) break, so cluster upgrades would need to go through the usual QA processes anyway
I’ve submitted a possible implementation for declarative support for PostgreSQL major in-place upgrades in #6664. I would greatly appreciate it if you could review and test my approach and provide feedback or suggestions for improvement.
Reacted by Ivan Kurnosov, borisroman, huyantian, Jakob Hofer, Ee Durbin, saolof, Zacharya, Pedro Morello Abbud and Mauro Sérgio
Will in-place major upgrades be included in version 1.26, scheduled for February 20th?
We are currently evaluating CNPG, and this feature is critical for our decision. With over a thousand databases to manage, performing major upgrades imperatively is far too time-consuming. Declarative support for in-place upgrades would be a game-changer for us.
We’d greatly appreciate any updates on whether this will make it into the next release.
Reacted by Adrien Peiffer, isdinAghmir, Térence Chateigné, Douglas Greenbaum, bo0tzz, Igor Nikiforov, ganarajtejasvi, Matt M., Maxime Nrb, hzmi and 27 more
Reacted by Jason Tackaberry, ganarajtejasvi, Matt M., Aran Donohue, hzmi, Jakob Hofer, Daniel Sachse, dmekhov, maryam-ismayilova-m10, nthtrung09it and 8 more
Activity
maxpain commentedon Oct 7, 2024
Any updates on this?
I can't believe that CNPG doesn't have major pg upgrades.
bo0tzz commentedon Oct 7, 2024
It's on the roadmap for 1.26.0 Roadmap (view) - as is also noted by the events listed above your comment ;)
[-]Declarative support for PostgreSQL major online upgrades[/-][+]Declarative support for PostgreSQL major in-place upgrades[/+]gbartolini commentedon Jan 8, 2025
Version 1.25 introduced support for logical subscriptions, which simplifies the process of performing major upgrades using logical replication. Additionally, we've added the ability to perform parallel dump and restore, providing more flexibility for handling large-scale database operations. These features already cover many everyday use cases—logical online upgrades were, in fact, our preferred approach for Postgres upgrades during our time at 2ndQuadrant.
I've been reflecting on this feature and considering how the direction we're taking with operand container images and extensions might influence its evolution. Specifically, we're working towards separating PostgreSQL operand images from extensions starting with PostgreSQL 18, with a proposed patch by EDB for the
extension_control_pathin PostgreSQL (see RFC: Extension Packaging Lookup. It is hard to say without a prototype, but I remain concerned about the potential for extension upgrades to lead to unpredictable or unrecoverable scenarios.However, given the strong demand for this feature, one approach for an initial implementation could be an offline update. If the update fails, the system would revert to the previous PostgreSQL version, resulting in an inconsistent state and requiring manual intervention to change the cluster definition. If successful, the process would promote the primary, destroy the standbys, and recreate them in sequence. Thoughts?
Given our current commitments, I believe we can start working on this feature for version 1.26. However, due to the uncertainties mentioned earlier, there is a possibility that its delivery might be delayed.
pschichtel commentedon Jan 8, 2025
The main point of concern is extensions, right? How is the risk of failure/inconsistency different when performing offline updates?
gbartolini commentedon Jan 9, 2025
You work on a new cluster. You have time to prepare it in advance and test it, especially with applications. That's always been the main advantage of migrations to a different cluster, at least in my experience. You will have time to test upgrades to a different extension version as well.
pschichtel commentedon Jan 9, 2025
Ah ok that's what you mean, makes sense. The declarative in-place upgrade approach wouldn't prevent people from using the imperative approach to have more safety if preferred, right? Even clusters that don't use extensions could hit a bug in a newer PG version and (subtly) break, so cluster upgrades would need to go through the usual QA processes anyway
mnencia commentedon Jan 25, 2025
I’ve submitted a possible implementation for declarative support for PostgreSQL major in-place upgrades in #6664. I would greatly appreciate it if you could review and test my approach and provide feedback or suggestions for improvement.
egkristi commentedon Feb 13, 2025
Will in-place major upgrades be included in version 1.26, scheduled for February 20th?
We are currently evaluating CNPG, and this feature is critical for our decision. With over a thousand databases to manage, performing major upgrades imperatively is far too time-consuming. Declarative support for in-place upgrades would be a game-changer for us.
We’d greatly appreciate any updates on whether this will make it into the next release.
gbartolini commentedon Mar 10, 2025
This feature will be in 1.26.0.
feat: declarative offline in-place major upgrades of PostgreSQL (clou…