Discourse docker not supporting PG 9.6


(Alex S) #1

We’re using PG 9.6 as DB server, but when I try to backup, it fails:

[2017-01-25 09:30:21] Dumping the public schema of the database...
[2017-01-25 09:30:21] Dumping the public schema of the database...
[2017-01-25 09:30:21] EXCEPTION: pg_dump failed
[2017-01-25 09:30:21] pg_dump: server version: 9.6.19.6.4; pg_dump version: 9.5.5
[2017-01-25 09:30:21] /var/www/discourse/lib/backup_restore/backuper.rb:172:in `dump_public_schema'
/var/www/discourse/lib/backup_restore/backuper.rb:37:in `run'

Since PG 9.6 is stable, can we upgrade the PG client version in the image?

Thank you!


(Rafael dos Santos Silva) #2

If you are alreary running an outside database, you can manage the backups on the outisde.

Stop the web_container, backup, restore, update the DB address and start the container.


Since PostgreSQL binary format changes between major versions, it’s not simply updating the version we need to handle updating the data, failure cases, etc.

I couldn’t measure parallel query of PG 9.6 having many benefits for Discourse, but maybe my sample was way too small, did you saw any gains?


(leopku) #3

Found same issue while doing https://meta.discourse.org/t/a-new-project-aimed-playing-discourse-with-docker-compose-or-rancher-compose-and-less-rebuilds/56780.
At the beginning, I used postgres 9.6.
Because of this issue, I downgrade postgres to 9.5.5.

Honestly upgrading maybe need more testing especially for currently running discourse.


(Sam Saffron) #4

I don’t recommend trying anything custom here, what is happening is that the pg client tools in your web container are out-of-sync with the db server you are running, you need a custom step when setting up your web container to remove the old pg client tools and install 9.6 version of them.


(leopku) #5

updating program pg_upgrade which shipped with PG can do binary files updating automatically.


(leopku) #6

Is there any official plan for upgrading postgres to 9.6?


(Sam Saffron) #7

I would consider upgrading very soon if we could prove that it is faster for Discourse workloads.

Historically we have upgraded PG once for every 2 releases, we had 2 PG upgrades to date.


(leopku) #8

Got it.
Thanks a lot.


(Alex S) #9

Yea, now the workaround is to update the PG client in container every time.

BTW, do you know the ETA of upgrading PG client to 9.6?