restore action does not work with focal

Bug #1924756 reported by Aymen Frikha
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
PostgreSQL Charm
Fix Released
High
Unassigned

Bug Description

Hello,

Trying to test the restore action of the charm but it seems it does not work with postgresql 12 (default in focal).

Trying to restore using this command: juju run-action postgresql/3 wal-e-restore storage-uri=s3://postgresql-test confirm=true --wait

but the database failed to start again and had those logs:

2021-04-16 12:00:45 UTC [27775]: [11-1] db=,user= LOG: database system is shut down
      2021-04-16 12:01:00.188 GMT [100589] LOG: skipping missing configuration file "/etc/postgresql/12/main/juju_recovery.conf"
      2021-04-16 12:01:00.189 GMT [100589] LOG: skipping missing configuration file "/etc/postgresql/12/main/juju_recovery.conf"
      2021-04-16 12:01:00 UTC [100589]: [3-1] db=,user= LOG: starting PostgreSQL 12.6 (Ubuntu 12.6-0ubuntu0.20.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit
      2021-04-16 12:01:00 UTC [100589]: [4-1] db=,user= LOG: listening on IPv4 address "0.0.0.0", port 5432
      2021-04-16 12:01:00 UTC [100589]: [5-1] db=,user= LOG: listening on IPv6 address "::", port 5432
      2021-04-16 12:01:00 UTC [100589]: [6-1] db=,user= LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
      2021-04-16 12:01:00 UTC [100590]: [1-1] db=,user= LOG: database system was interrupted; last known up at 2021-04-16 11:56:26 UTC
      2021-04-16 12:01:00 UTC [100590]: [2-1] db=,user= LOG: creating missing WAL directory "pg_wal/archive_status"
      2021-04-16 12:01:00 UTC [100590]: [3-1] db=,user= FATAL: using recovery command file "recovery.conf" is not supported
      2021-04-16 12:01:00 UTC [100589]: [7-1] db=,user= LOG: startup process (PID 100590) exited with exit code 1
      2021-04-16 12:01:00 UTC [100589]: [8-1] db=,user= LOG: aborting startup due to startup process failure
      2021-04-16 12:01:00 UTC [100589]: [9-1] db=,user= LOG: database system is shut down

After more troubleshooting it seems that postgresql 12 does not use recovery.conf file anymore and changed that with another process which is creating necessary parameters in postgresql.conf and a file called recovery.signal inside /var/lib/postgresql/12/main.

Related branches

Revision history for this message
Erik Lönroth (erik-lonroth) wrote :

I'm hit by this and its being discussed in this thread aswell: https://discourse.charmhub.io/t/backup-restore-to-from-filesystem-using-postgresql-charm/5584

Revision history for this message
Tom Haddon (mthaddon) wrote :
Changed in postgresql-charm:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Tom Haddon (mthaddon) wrote :

https://www.postgresql.org/docs/current/recovery-config.html shows the details of what's changed here

Tom Haddon (mthaddon)
Changed in postgresql-charm:
status: Confirmed → Fix Committed
Revision history for this message
Tom Haddon (mthaddon) wrote :

This has been released to the stable channel in revno 241

Changed in postgresql-charm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.