SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
An ultimate guide to
upgrading your
PostgreSQL
installation
Ilya Kosmodemiansky
ik@dataegret.com
2 Why this talk?
Upgrading your PostgreSQL is not a rocket science!
• ...but there are lots of small details
• Unsuccessful upgrade can ruin your data
• Or at least cause an unacceptable downtime
• Upgrade requires good knowledge of your system and substantial
preparation time
dataegret.com
3 Because of that
• DBAs do not like upgrades
• They are attached to outdated versions
• They manage to screw up an upgrade when they finally decide to perform
one
dataegret.com
4 Why do you need to upgrade?
• Bugfixes, security fixes
• Many performance improvements and new features over the last years
• Upgrading on time makes it easier
• Running 7.* in 2017 would make consultants too happy
dataegret.com
5 PostgreSQL version numbering
<= 9.6.*
9.4.3Major
Major
Minor
dataegret.com
5 PostgreSQL version numbering
> 9.6.*
10.2
Major Minor
dataegret.com
6 Types of upgrades
• Minor
New versions’ binaries can run on old version datafiles
• Major
New versions’ binaries can run on old version datafiles, but require new
system tables and internal data format may change
• Major with special requirements
dataegret.com
7 Before any upgrade
• Read carefully version specific release notes
• Play with chosen upgrade method in test environment
• Align with your application development team
• Make a backup and check it by test recovery
dataegret.com
8 Minor upgrades are easy
• You simply install new binaries and start new database server on the old
data directory
• There are no new features between minor versions
• Still - keep an eye on updating all PostgreSQL-related packages you use
dataegret.com
9 Major upgrade prerequisites
• Install new versions for all PostgreSQL-related packages
• Read carefully all release notes
• Know your PostgreSQL installation
• Choose the method and carefully read the documentation for this method
• Align with your application development team
• Do a backup and check it by doing a test recovery
dataegret.com
10 Check which PostgreSQL-related packages you use
your_server:~$ sudo dpkg -l *postgres*
||/ Name Version
+++-=================================================-=============================
ii postgresql-9.3 9.3.15-1.pgdg14.04+1
ii postgresql-client-9.3 9.3.15-1.pgdg14.04+1
ii postgresql-client-common 182.pgdg14.04+1
ii postgresql-common 182.pgdg14.04+1
ii postgresql-contrib-9.3 9.3.15-1.pgdg14.04+1
ii postgresql-plperl-9.3 9.3.15-1.pgdg14.04+1
ii postgresql-server-dev-9.3 9.3.15-1.pgdg14.04+1
your_server:~$ sudo dpkg -l *pg*
||/ Name Version
+++-=================================================-=============================
ii libdbd-pg-perl 2.19.3-2
ii pgbouncer 1.5.4-4
ii pgdg-keyring 2014.1
dataegret.com
11 Major upgrade methods
• Good old dump/restore
• pg_upgrade
• Replication-based methods
dataegret.com
12 Major upgrade using pg_dump
• Difficult to make without downtime if you have a large, heavyloaded
database
• Requires additional disk space
• Works with any PostgreSQL version since 7.0
• pg_dump -Fc - custom format, -Z - compression
• pg_dump -Fd –jobs can be a good option in terms of speed and downtime
• But if using -j you can’t do things like that: pg_dumpall -p 5432 | psql -d
postgres -p 5433
• If your installation can be upgraded easily by dump/restore, you are lucky!
dataegret.com
13 Major upgrade using pg_dump - procedure
• Install new binaries
• Initialize new cluster. Don’t forget about locale
• Change config files appropriately
• It can be a good idea to use newer version of pg_dump, but be careful if
running on pre-9.2 server
• Restore the dump, try to figure out if everything looks good
• Switch your application to the new cluster
dataegret.com
14 pg_upgrade - outline
• How it works?
• Procedure
Simple case - standalone server
How to minimize downtime?
Upgrading hot-standby cluster
• Details
dataegret.com
15 pg_upgrade - How it works?
user data
pg_clog
pg_catalog
pg_clog
pg_catalog
old
new
user data
pg_clog
pg_catalog
pg_clog
pg_catalog
freeze
user data
pg_clog
pg_catalog
pg_clog
pg_catalog
pg_clog and pg_control
user data
pg_clog
pg_catalog
pg_clog
pg_catalog
user data
dupm/restore of schema
and
cp or relink of datafiles
dataegret.com
15 pg_upgrade - How it works?
• Decouple pg_clog (pg_xact) from new cluster
• Couple old pg_clog to a new cluster and set xid
• Restore schema
• Copy or link datafiles from old cluster to a new one
dataegret.com
16 pg_upgrade - procedure
• Create empty database for new version of PostgreSQL
• Stop database with old PostgreSQL version
• Start upgrade procedure with pg_upgrade command
• Start database that runs on new PostgreSQL version
• Start collecting statistics (pg_upgrade does not transfer optimizer
statistics)
• When statistic collection started, you can open database for your
application
• Depending on your database, you can achieve 1-10 min downtime target
dataegret.com
17 pg_upgrade - minimizing downtime
• Use pgbouncer
PAUSE/RESUME
Issue CHECKPOINT; on old server before you start, to make shutdown
process faster
• Use -k (–link) to use hard links instead of copy (but carefully!)
dataegret.com
18 pg_upgrade - hot-standby replica
• Upgrade master as a standalone server
• Keep replica intact to failover if something goes wrong
• Reinstantiate your replica
• Procedure
Pause pgbouncer on standby or stop it
Clone a replica from upgraded master using pg_basebackup
Start replica with new binaries
Resume pgbouncer connections or start pgbouncer.
dataegret.com
19 pg_upgrade - Details
• pg_upgrade does not transfer optimizer statistics
• instead, it generates a script ./analyze_new_cluster.sh
It basically runs vacuumdb –all –analyze-in-stages
In some cases it is better to run vacuumdb –all –analyze-only
Since 9.5 you can vacuumdb run in parallel (-j)
We usually use vacuumdb –all –analyze-in-stages and open database for
application after medium optimizer statistics (10 targets) are generated
dataegret.com
20 pg_upgrade - Details
• Documentation suggests to use rsync to reinstantiate standby
• rsync –archive –delete –hard-links –size-only old_pgdata new_pgdata
remote_dir
• rsync allows you to save a lot of network traffic in that case
• ...and provides lots of opportunities to shoot yourself in the foot
dataegret.com
21 pg_upgrade - Details
• Debian/Ubuntu follow their own way
• Wrappers, like pg_ctlcluster are designed to manipulate PostgreSQL cluster
in a Debian way
• pg_upgradecluster -v 9.5 9.3 main1 -m upgrade -k supposed to be a
make-me-happy button for a DBA
• It even takes care of converting postgresql.conf parameters for you
• But I strongly recommend to do this manually
dataegret.com
22 pg_upgrade - Details
• Extensions can surprise you
• pg_upgrade keeps old versions of extensions
• We advise to cycle through all extensions and perform alter extension
EXTENSION_NAME update;
• Some extensions need special care: for example PostGIS should be
updated before an upgrade
dataegret.com
23 Using replication to upgrade PostgreSQL
• Streaming replication doesn’t work between versions
• But some replication methods can do that
Logical replication
Slony-I
Londiste
• Procedure
Setup new database cluster
Setup replication from old one to a new one
Perform failover
dataegret.com
24 Logical replication
• New promising method
• Allows you to upgrade from 9.4 to a newer version
• It can be tricky:
Check documentation carefully
If you have a complex schema, you may need some wrapper, like
https://github.com/rtshome/pgrepup
Check what you replicate using pglogical.replication_set
Don’t forget about sequences
dataegret.com
25 Slony-I
• Old and bulletproof
• Can be used with old versions
• Failover can be done really fast
• Drawbacks
Trigger based - can cause heavy load on old cluster
Extra disk space is needed
dataegret.com
26 Londiste
• I’am not a big fan of Londiste
• Same drawbacks as with Slony, but without Slony’s robustness
• Lots of bugs (compared to Slony)
• Tool was designed for a different purpose
dataegret.com
27 Conclusion
Method downtime extra disk space complexity riskiness
dump/restore high double low low
pg_upgrade (copy) high double high low
pg_upgrade (link) low low high very high
Logical replication low double high low
Slony-I low double medium low
Londiste low double medium low
dataegret.com
28 Reading list
• http://momjian.us/main/writings/pgsql/pg_upgrade.pdf
• https://blog.2ndquadrant.com/untangling-the-postgresql-upgrade/
• http://blog.endpoint.com/2016/12/postgres-statistics-and-pain-of-
analyze.html
• https://www.depesz.com/2016/11/08/major-version-upgrading-with-
minimal-downtime/
dataegret.com
29 Questions?
ik@dataegret.com
dataegret.com

Contenu connexe

Tendances

How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015PostgreSQL-Consulting
 
Understanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksUnderstanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksJignesh Shah
 
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정PgDay.Seoul
 
Oracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsOracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsAnil Nair
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep InternalEXEM
 
[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google CloudPgDay.Seoul
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialKenny Gryp
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HAharoonm
 
Alfresco devcon 2019: How to track user activities without using the audit fu...
Alfresco devcon 2019: How to track user activities without using the audit fu...Alfresco devcon 2019: How to track user activities without using the audit fu...
Alfresco devcon 2019: How to track user activities without using the audit fu...konok
 
Table partitioning in PostgreSQL + Rails
Table partitioning in PostgreSQL + RailsTable partitioning in PostgreSQL + Rails
Table partitioning in PostgreSQL + RailsAgnieszka Figiel
 
Stephan Ewen - Experiences running Flink at Very Large Scale
Stephan Ewen -  Experiences running Flink at Very Large ScaleStephan Ewen -  Experiences running Flink at Very Large Scale
Stephan Ewen - Experiences running Flink at Very Large ScaleVerverica
 
Cassandra vs. ScyllaDB: Evolutionary Differences
Cassandra vs. ScyllaDB: Evolutionary DifferencesCassandra vs. ScyllaDB: Evolutionary Differences
Cassandra vs. ScyllaDB: Evolutionary DifferencesScyllaDB
 
InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...
InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...
InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...InfluxData
 
Using ClickHouse for Experimentation
Using ClickHouse for ExperimentationUsing ClickHouse for Experimentation
Using ClickHouse for ExperimentationGleb Kanterov
 
The Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
The Rise of ZStandard: Apache Spark/Parquet/ORC/AvroThe Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
The Rise of ZStandard: Apache Spark/Parquet/ORC/AvroDatabricks
 
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlareClickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlareAltinity Ltd
 
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya KosmodemianskyPostgreSQL-Consulting
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL AdministrationEDB
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Alexey Lesovsky
 

Tendances (20)

How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
How does PostgreSQL work with disks: a DBA's checklist in detail. PGConf.US 2015
 
Understanding PostgreSQL LW Locks
Understanding PostgreSQL LW LocksUnderstanding PostgreSQL LW Locks
Understanding PostgreSQL LW Locks
 
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
 
Oracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsOracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret Internals
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep Internal
 
[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn Tutorial
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HA
 
Alfresco devcon 2019: How to track user activities without using the audit fu...
Alfresco devcon 2019: How to track user activities without using the audit fu...Alfresco devcon 2019: How to track user activities without using the audit fu...
Alfresco devcon 2019: How to track user activities without using the audit fu...
 
Table partitioning in PostgreSQL + Rails
Table partitioning in PostgreSQL + RailsTable partitioning in PostgreSQL + Rails
Table partitioning in PostgreSQL + Rails
 
Stephan Ewen - Experiences running Flink at Very Large Scale
Stephan Ewen -  Experiences running Flink at Very Large ScaleStephan Ewen -  Experiences running Flink at Very Large Scale
Stephan Ewen - Experiences running Flink at Very Large Scale
 
Cassandra vs. ScyllaDB: Evolutionary Differences
Cassandra vs. ScyllaDB: Evolutionary DifferencesCassandra vs. ScyllaDB: Evolutionary Differences
Cassandra vs. ScyllaDB: Evolutionary Differences
 
InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...
InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...
InfluxDB IOx Tech Talks: Query Engine Design and the Rust-Based DataFusion in...
 
Using ClickHouse for Experimentation
Using ClickHouse for ExperimentationUsing ClickHouse for Experimentation
Using ClickHouse for Experimentation
 
The Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
The Rise of ZStandard: Apache Spark/Parquet/ORC/AvroThe Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
The Rise of ZStandard: Apache Spark/Parquet/ORC/Avro
 
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlareClickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
Clickhouse Capacity Planning for OLAP Workloads, Mik Kocikowski of CloudFlare
 
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
 
Rac 12c optimization
Rac 12c optimizationRac 12c optimization
Rac 12c optimization
 

Similaire à Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installation PGConf.EU

Operating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with KubernetesOperating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with KubernetesJonathan Katz
 
Rapid Upgrades With Pg_Upgrade, Bruce Momjian
Rapid Upgrades With Pg_Upgrade, Bruce MomjianRapid Upgrades With Pg_Upgrade, Bruce Momjian
Rapid Upgrades With Pg_Upgrade, Bruce MomjianFuenteovejuna
 
Best Practices: Migrating a Postgres Production Database to the Cloud
Best Practices: Migrating a Postgres Production Database to the CloudBest Practices: Migrating a Postgres Production Database to the Cloud
Best Practices: Migrating a Postgres Production Database to the CloudEDB
 
Pg upgrade employer
Pg upgrade employerPg upgrade employer
Pg upgrade employerEDB
 
Using PostgreSQL With Docker & Kubernetes - July 2018
Using PostgreSQL With Docker & Kubernetes - July 2018Using PostgreSQL With Docker & Kubernetes - July 2018
Using PostgreSQL With Docker & Kubernetes - July 2018Jonathan Katz
 
Upgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeUpgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeOlivier DASINI
 
What's New in PostgreSQL 9.3
What's New in PostgreSQL 9.3What's New in PostgreSQL 9.3
What's New in PostgreSQL 9.3EDB
 
TechEvent PostgreSQL Best Practices
TechEvent PostgreSQL Best PracticesTechEvent PostgreSQL Best Practices
TechEvent PostgreSQL Best PracticesTrivadis
 
Overview of Postgres Utility Processes
Overview of Postgres Utility ProcessesOverview of Postgres Utility Processes
Overview of Postgres Utility ProcessesEDB
 
Webinar: Best Practices for Upgrading to MongoDB 3.2
Webinar: Best Practices for Upgrading to MongoDB 3.2Webinar: Best Practices for Upgrading to MongoDB 3.2
Webinar: Best Practices for Upgrading to MongoDB 3.2Dana Elisabeth Groce
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practicesJacques Kostic
 
Openstack hk-summit-upgrades-talk
Openstack hk-summit-upgrades-talkOpenstack hk-summit-upgrades-talk
Openstack hk-summit-upgrades-talkBuvanesh Kumar
 
Checklist for Upgrades and Migrations
Checklist for Upgrades and MigrationsChecklist for Upgrades and Migrations
Checklist for Upgrades and MigrationsMarkus Flechtner
 
ProstgreSQLFailoverConfiguration
ProstgreSQLFailoverConfigurationProstgreSQLFailoverConfiguration
ProstgreSQLFailoverConfigurationSuyog Shirgaonkar
 
Running PostgreSQL in a Kubernetes cluster: CloudNativePG
Running PostgreSQL in a Kubernetes cluster: CloudNativePGRunning PostgreSQL in a Kubernetes cluster: CloudNativePG
Running PostgreSQL in a Kubernetes cluster: CloudNativePGNick Ivanov
 
What's coming in Airflow 2.0? - NYC Apache Airflow Meetup
What's coming in Airflow 2.0? - NYC Apache Airflow MeetupWhat's coming in Airflow 2.0? - NYC Apache Airflow Meetup
What's coming in Airflow 2.0? - NYC Apache Airflow MeetupKaxil Naik
 
Best And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsBest And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsLetsConnect
 

Similaire à Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installation PGConf.EU (20)

The Accidental DBA
The Accidental DBAThe Accidental DBA
The Accidental DBA
 
Operating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with KubernetesOperating PostgreSQL at Scale with Kubernetes
Operating PostgreSQL at Scale with Kubernetes
 
Rapid Upgrades With Pg_Upgrade, Bruce Momjian
Rapid Upgrades With Pg_Upgrade, Bruce MomjianRapid Upgrades With Pg_Upgrade, Bruce Momjian
Rapid Upgrades With Pg_Upgrade, Bruce Momjian
 
Best Practices: Migrating a Postgres Production Database to the Cloud
Best Practices: Migrating a Postgres Production Database to the CloudBest Practices: Migrating a Postgres Production Database to the Cloud
Best Practices: Migrating a Postgres Production Database to the Cloud
 
Pg upgrade employer
Pg upgrade employerPg upgrade employer
Pg upgrade employer
 
Using PostgreSQL With Docker & Kubernetes - July 2018
Using PostgreSQL With Docker & Kubernetes - July 2018Using PostgreSQL With Docker & Kubernetes - July 2018
Using PostgreSQL With Docker & Kubernetes - July 2018
 
Upgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeUpgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtime
 
Database upgradation
Database upgradationDatabase upgradation
Database upgradation
 
What's New in PostgreSQL 9.3
What's New in PostgreSQL 9.3What's New in PostgreSQL 9.3
What's New in PostgreSQL 9.3
 
TechEvent PostgreSQL Best Practices
TechEvent PostgreSQL Best PracticesTechEvent PostgreSQL Best Practices
TechEvent PostgreSQL Best Practices
 
Overview of Postgres Utility Processes
Overview of Postgres Utility ProcessesOverview of Postgres Utility Processes
Overview of Postgres Utility Processes
 
Webinar: Best Practices for Upgrading to MongoDB 3.2
Webinar: Best Practices for Upgrading to MongoDB 3.2Webinar: Best Practices for Upgrading to MongoDB 3.2
Webinar: Best Practices for Upgrading to MongoDB 3.2
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practices
 
Postgre sql best_practices
Postgre sql best_practicesPostgre sql best_practices
Postgre sql best_practices
 
Openstack hk-summit-upgrades-talk
Openstack hk-summit-upgrades-talkOpenstack hk-summit-upgrades-talk
Openstack hk-summit-upgrades-talk
 
Checklist for Upgrades and Migrations
Checklist for Upgrades and MigrationsChecklist for Upgrades and Migrations
Checklist for Upgrades and Migrations
 
ProstgreSQLFailoverConfiguration
ProstgreSQLFailoverConfigurationProstgreSQLFailoverConfiguration
ProstgreSQLFailoverConfiguration
 
Running PostgreSQL in a Kubernetes cluster: CloudNativePG
Running PostgreSQL in a Kubernetes cluster: CloudNativePGRunning PostgreSQL in a Kubernetes cluster: CloudNativePG
Running PostgreSQL in a Kubernetes cluster: CloudNativePG
 
What's coming in Airflow 2.0? - NYC Apache Airflow Meetup
What's coming in Airflow 2.0? - NYC Apache Airflow MeetupWhat's coming in Airflow 2.0? - NYC Apache Airflow Meetup
What's coming in Airflow 2.0? - NYC Apache Airflow Meetup
 
Best And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM ConnectionsBest And Worst Practices Deploying IBM Connections
Best And Worst Practices Deploying IBM Connections
 

Plus de PostgreSQL-Consulting

Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...PostgreSQL-Consulting
 
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya KosmodemianskyPostgreSQL-Consulting
 
Linux internals for Database administrators at Linux Piter 2016
Linux internals for Database administrators at Linux Piter 2016Linux internals for Database administrators at Linux Piter 2016
Linux internals for Database administrators at Linux Piter 2016PostgreSQL-Consulting
 
10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQLPostgreSQL-Consulting
 
PostgreSQL Meetup Berlin at Zalando HQ
PostgreSQL Meetup Berlin at Zalando HQPostgreSQL Meetup Berlin at Zalando HQ
PostgreSQL Meetup Berlin at Zalando HQPostgreSQL-Consulting
 
Как PostgreSQL работает с диском
Как PostgreSQL работает с дискомКак PostgreSQL работает с диском
Как PostgreSQL работает с дискомPostgreSQL-Consulting
 
Максим Богук. Postgres-XC
Максим Богук. Postgres-XCМаксим Богук. Postgres-XC
Максим Богук. Postgres-XCPostgreSQL-Consulting
 
Илья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQL
Илья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQLИлья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQL
Илья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQLPostgreSQL-Consulting
 

Plus de PostgreSQL-Consulting (11)

Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
Linux IO internals for database administrators (SCaLE 2017 and PGDay Nordic 2...
 
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version FOSDEM PGDay 2017 by Ilya Kosmodemiansky
 
Linux internals for Database administrators at Linux Piter 2016
Linux internals for Database administrators at Linux Piter 2016Linux internals for Database administrators at Linux Piter 2016
Linux internals for Database administrators at Linux Piter 2016
 
10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL
 
PostgreSQL Meetup Berlin at Zalando HQ
PostgreSQL Meetup Berlin at Zalando HQPostgreSQL Meetup Berlin at Zalando HQ
PostgreSQL Meetup Berlin at Zalando HQ
 
Pgconfru 2015 kosmodemiansky
Pgconfru 2015 kosmodemianskyPgconfru 2015 kosmodemiansky
Pgconfru 2015 kosmodemiansky
 
Как PostgreSQL работает с диском
Как PostgreSQL работает с дискомКак PostgreSQL работает с диском
Как PostgreSQL работает с диском
 
Kosmodemiansky wr 2013
Kosmodemiansky wr 2013Kosmodemiansky wr 2013
Kosmodemiansky wr 2013
 
Максим Богук. Postgres-XC
Максим Богук. Postgres-XCМаксим Богук. Postgres-XC
Максим Богук. Postgres-XC
 
Иван Фролков. Tricky SQL
Иван Фролков. Tricky SQLИван Фролков. Tricky SQL
Иван Фролков. Tricky SQL
 
Илья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQL
Илья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQLИлья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQL
Илья Космодемьянский. Использование очередей асинхронных сообщений с PostgreSQL
 

Dernier

Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...arifengg7
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
Detection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and trackingDetection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and trackinghadarpinhas1
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfShreyas Pandit
 
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Coursebim.edu.pl
 
STATE TRANSITION DIAGRAM in psoc subject
STATE TRANSITION DIAGRAM in psoc subjectSTATE TRANSITION DIAGRAM in psoc subject
STATE TRANSITION DIAGRAM in psoc subjectGayathriM270621
 
Forming section troubleshooting checklist for improving wire life (1).ppt
Forming section troubleshooting checklist for improving wire life (1).pptForming section troubleshooting checklist for improving wire life (1).ppt
Forming section troubleshooting checklist for improving wire life (1).pptNoman khan
 
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESCME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESkarthi keyan
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSsandhya757531
 
70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical training70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical trainingGladiatorsKasper
 
The Satellite applications in telecommunication
The Satellite applications in telecommunicationThe Satellite applications in telecommunication
The Satellite applications in telecommunicationnovrain7111
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdfCaalaaAbdulkerim
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.elesangwon
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHSneha Padhiar
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...KrishnaveniKrishnara1
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 

Dernier (20)

Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
Analysis and Evaluation of Dal Lake Biomass for Conversion to Fuel/Green fert...
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
 
Detection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and trackingDetection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and tracking
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdf
 
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Course
 
STATE TRANSITION DIAGRAM in psoc subject
STATE TRANSITION DIAGRAM in psoc subjectSTATE TRANSITION DIAGRAM in psoc subject
STATE TRANSITION DIAGRAM in psoc subject
 
Forming section troubleshooting checklist for improving wire life (1).ppt
Forming section troubleshooting checklist for improving wire life (1).pptForming section troubleshooting checklist for improving wire life (1).ppt
Forming section troubleshooting checklist for improving wire life (1).ppt
 
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTESCME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
CME 397 - SURFACE ENGINEERING - UNIT 1 FULL NOTES
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
 
70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical training70 POWER PLANT IAE V2500 technical training
70 POWER PLANT IAE V2500 technical training
 
The Satellite applications in telecommunication
The Satellite applications in telecommunicationThe Satellite applications in telecommunication
The Satellite applications in telecommunication
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdf
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
22CYT12 & Chemistry for Computer Systems_Unit-II-Corrosion & its Control Meth...
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 

Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installation PGConf.EU

  • 1. An ultimate guide to upgrading your PostgreSQL installation Ilya Kosmodemiansky ik@dataegret.com
  • 2. 2 Why this talk? Upgrading your PostgreSQL is not a rocket science! • ...but there are lots of small details • Unsuccessful upgrade can ruin your data • Or at least cause an unacceptable downtime • Upgrade requires good knowledge of your system and substantial preparation time dataegret.com
  • 3. 3 Because of that • DBAs do not like upgrades • They are attached to outdated versions • They manage to screw up an upgrade when they finally decide to perform one dataegret.com
  • 4. 4 Why do you need to upgrade? • Bugfixes, security fixes • Many performance improvements and new features over the last years • Upgrading on time makes it easier • Running 7.* in 2017 would make consultants too happy dataegret.com
  • 5. 5 PostgreSQL version numbering <= 9.6.* 9.4.3Major Major Minor dataegret.com
  • 6. 5 PostgreSQL version numbering > 9.6.* 10.2 Major Minor dataegret.com
  • 7. 6 Types of upgrades • Minor New versions’ binaries can run on old version datafiles • Major New versions’ binaries can run on old version datafiles, but require new system tables and internal data format may change • Major with special requirements dataegret.com
  • 8. 7 Before any upgrade • Read carefully version specific release notes • Play with chosen upgrade method in test environment • Align with your application development team • Make a backup and check it by test recovery dataegret.com
  • 9. 8 Minor upgrades are easy • You simply install new binaries and start new database server on the old data directory • There are no new features between minor versions • Still - keep an eye on updating all PostgreSQL-related packages you use dataegret.com
  • 10. 9 Major upgrade prerequisites • Install new versions for all PostgreSQL-related packages • Read carefully all release notes • Know your PostgreSQL installation • Choose the method and carefully read the documentation for this method • Align with your application development team • Do a backup and check it by doing a test recovery dataegret.com
  • 11. 10 Check which PostgreSQL-related packages you use your_server:~$ sudo dpkg -l *postgres* ||/ Name Version +++-=================================================-============================= ii postgresql-9.3 9.3.15-1.pgdg14.04+1 ii postgresql-client-9.3 9.3.15-1.pgdg14.04+1 ii postgresql-client-common 182.pgdg14.04+1 ii postgresql-common 182.pgdg14.04+1 ii postgresql-contrib-9.3 9.3.15-1.pgdg14.04+1 ii postgresql-plperl-9.3 9.3.15-1.pgdg14.04+1 ii postgresql-server-dev-9.3 9.3.15-1.pgdg14.04+1 your_server:~$ sudo dpkg -l *pg* ||/ Name Version +++-=================================================-============================= ii libdbd-pg-perl 2.19.3-2 ii pgbouncer 1.5.4-4 ii pgdg-keyring 2014.1 dataegret.com
  • 12. 11 Major upgrade methods • Good old dump/restore • pg_upgrade • Replication-based methods dataegret.com
  • 13. 12 Major upgrade using pg_dump • Difficult to make without downtime if you have a large, heavyloaded database • Requires additional disk space • Works with any PostgreSQL version since 7.0 • pg_dump -Fc - custom format, -Z - compression • pg_dump -Fd –jobs can be a good option in terms of speed and downtime • But if using -j you can’t do things like that: pg_dumpall -p 5432 | psql -d postgres -p 5433 • If your installation can be upgraded easily by dump/restore, you are lucky! dataegret.com
  • 14. 13 Major upgrade using pg_dump - procedure • Install new binaries • Initialize new cluster. Don’t forget about locale • Change config files appropriately • It can be a good idea to use newer version of pg_dump, but be careful if running on pre-9.2 server • Restore the dump, try to figure out if everything looks good • Switch your application to the new cluster dataegret.com
  • 15. 14 pg_upgrade - outline • How it works? • Procedure Simple case - standalone server How to minimize downtime? Upgrading hot-standby cluster • Details dataegret.com
  • 16. 15 pg_upgrade - How it works? user data pg_clog pg_catalog pg_clog pg_catalog old new user data pg_clog pg_catalog pg_clog pg_catalog freeze user data pg_clog pg_catalog pg_clog pg_catalog pg_clog and pg_control user data pg_clog pg_catalog pg_clog pg_catalog user data dupm/restore of schema and cp or relink of datafiles dataegret.com
  • 17. 15 pg_upgrade - How it works? • Decouple pg_clog (pg_xact) from new cluster • Couple old pg_clog to a new cluster and set xid • Restore schema • Copy or link datafiles from old cluster to a new one dataegret.com
  • 18. 16 pg_upgrade - procedure • Create empty database for new version of PostgreSQL • Stop database with old PostgreSQL version • Start upgrade procedure with pg_upgrade command • Start database that runs on new PostgreSQL version • Start collecting statistics (pg_upgrade does not transfer optimizer statistics) • When statistic collection started, you can open database for your application • Depending on your database, you can achieve 1-10 min downtime target dataegret.com
  • 19. 17 pg_upgrade - minimizing downtime • Use pgbouncer PAUSE/RESUME Issue CHECKPOINT; on old server before you start, to make shutdown process faster • Use -k (–link) to use hard links instead of copy (but carefully!) dataegret.com
  • 20. 18 pg_upgrade - hot-standby replica • Upgrade master as a standalone server • Keep replica intact to failover if something goes wrong • Reinstantiate your replica • Procedure Pause pgbouncer on standby or stop it Clone a replica from upgraded master using pg_basebackup Start replica with new binaries Resume pgbouncer connections or start pgbouncer. dataegret.com
  • 21. 19 pg_upgrade - Details • pg_upgrade does not transfer optimizer statistics • instead, it generates a script ./analyze_new_cluster.sh It basically runs vacuumdb –all –analyze-in-stages In some cases it is better to run vacuumdb –all –analyze-only Since 9.5 you can vacuumdb run in parallel (-j) We usually use vacuumdb –all –analyze-in-stages and open database for application after medium optimizer statistics (10 targets) are generated dataegret.com
  • 22. 20 pg_upgrade - Details • Documentation suggests to use rsync to reinstantiate standby • rsync –archive –delete –hard-links –size-only old_pgdata new_pgdata remote_dir • rsync allows you to save a lot of network traffic in that case • ...and provides lots of opportunities to shoot yourself in the foot dataegret.com
  • 23. 21 pg_upgrade - Details • Debian/Ubuntu follow their own way • Wrappers, like pg_ctlcluster are designed to manipulate PostgreSQL cluster in a Debian way • pg_upgradecluster -v 9.5 9.3 main1 -m upgrade -k supposed to be a make-me-happy button for a DBA • It even takes care of converting postgresql.conf parameters for you • But I strongly recommend to do this manually dataegret.com
  • 24. 22 pg_upgrade - Details • Extensions can surprise you • pg_upgrade keeps old versions of extensions • We advise to cycle through all extensions and perform alter extension EXTENSION_NAME update; • Some extensions need special care: for example PostGIS should be updated before an upgrade dataegret.com
  • 25. 23 Using replication to upgrade PostgreSQL • Streaming replication doesn’t work between versions • But some replication methods can do that Logical replication Slony-I Londiste • Procedure Setup new database cluster Setup replication from old one to a new one Perform failover dataegret.com
  • 26. 24 Logical replication • New promising method • Allows you to upgrade from 9.4 to a newer version • It can be tricky: Check documentation carefully If you have a complex schema, you may need some wrapper, like https://github.com/rtshome/pgrepup Check what you replicate using pglogical.replication_set Don’t forget about sequences dataegret.com
  • 27. 25 Slony-I • Old and bulletproof • Can be used with old versions • Failover can be done really fast • Drawbacks Trigger based - can cause heavy load on old cluster Extra disk space is needed dataegret.com
  • 28. 26 Londiste • I’am not a big fan of Londiste • Same drawbacks as with Slony, but without Slony’s robustness • Lots of bugs (compared to Slony) • Tool was designed for a different purpose dataegret.com
  • 29. 27 Conclusion Method downtime extra disk space complexity riskiness dump/restore high double low low pg_upgrade (copy) high double high low pg_upgrade (link) low low high very high Logical replication low double high low Slony-I low double medium low Londiste low double medium low dataegret.com
  • 30. 28 Reading list • http://momjian.us/main/writings/pgsql/pg_upgrade.pdf • https://blog.2ndquadrant.com/untangling-the-postgresql-upgrade/ • http://blog.endpoint.com/2016/12/postgres-statistics-and-pain-of- analyze.html • https://www.depesz.com/2016/11/08/major-version-upgrading-with- minimal-downtime/ dataegret.com