revert to working database system when wal-e-restore fails

Bug #1782655 reported by james beedy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PostgreSQL Charm
Triaged
High
Unassigned

Bug Description

When restoring a new postgresql server from the PITR backup of another fails the new database system is left broken.

Not sure why the wal-e-restore failed, but the database system is left in a broken state following an attempted restore.

$ juju run-action pg-test/0 --wait wal-e-restore storage-uri=s3://pdl-api-prod-postgresql-pitr target-time='2018-07-18 13:22.00.00000+00' confirm=true
unit-pg-test-0:
  id: 80cbbcd5-a23c-40b0-80a3-e2bdaf02c6f4
  status: completed
  timing:
    completed: 2018-07-19 21:08:00 +0000 UTC
    enqueued: 2018-07-19 21:07:45 +0000 UTC
    started: 2018-07-19 21:07:45 +0000 UTC
  unit: pg-test/0

Also, the action status reads 'completed' even though the action failed.

cat /var/log/juju/unit-pg-test-0.log | http://paste.ubuntu.com/p/QtWvdFVfmK/

james beedy (jamesbeedy)
summary: - revert to working database system if wal-e-restore fails
+ revert to working database system when wal-e-restore fails
Revision history for this message
Stuart Bishop (stub) wrote :

The recovery_target_time in recovery.conf was set to an invalid value:

    recovery_target_time='2018-07-18 13:22.00.00000+00'

Possibly a locale issue? In any case, it should be validated before writing recovery.conf and destroying the database.

Revision history for this message
Stuart Bishop (stub) wrote :

Per example command line, the date PostgreSQL failed to parse was user input. So I think this bug is about adding validation and fixing documentation.

Changed in postgresql-charm:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Stuart Bishop (stub) wrote :

And reporting a failure if we can detect that, rather than a success.

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.