Add support for Fly Volume Restores #63
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for Fly-based volume restores.
How it works
The initial cue for kicking off a restore is the presence of the
FLY_RESTORED_FROM
environment variable. When this environment variable is present, we will push through the following process.restore.lock
file exists. The restore process will begin if therestore.lock
file does not exist, or it exists but its value does not match the name of our app.pg_hba.conf
file so we can bypass authentication locally.flypgadmin
,repmgr
andpostgres
users and ensure their credentials match the current environment.repmgr
database will be dropped so we can start a fresh cluster setup.pg_hba.conf
file back to its original configuration.restore.lock
file and set its value to the name of our app. This will ensure the restore process isn't retried.Notes
flyctl
, it's recommended that you restore into a single node cluster. Scale-out as needed once the restore completes.flypgadmin
,repmgr
andpostgres
will not be persisted across restores.