/etc and databases



Hi,

I am a newcomer to OSTREE and I'm trying to understand whether putting database files (let's say PostgreSQL) in /etc is the right thing to do.
I have a piece of software that uses PostgreSQL and implements DB schema versioning and DB migration between versions.
Today the software is deployed as a tarball and extracted onto a mount point over /var (where both binaries and the DB are deployed).
The tarball includes an installation script that runs the database migration in case of upgrade and rolls back to the previous DB in case installation fails.

I am considering the following setup:
1) Deploy software as a layered package (
2) Set up the DB in /etc and run the installation (including DB migration) script in %post.

My questions are:
If I install the software using rpm-ostree install and the installation fails (during or after the DB migration),
would it be necessary to rollback the DB in /etc to the state it was before, or are the changes kept temporary and are committed only after the RPM is successfully installed and
I reboot the machine. 

Can this be done with layering or do I need to install an initial version of the software when I first deploy the OSTREE machine?

If this is not possible, I would appreciate any suggestion regarding how to utilize OSTREE to avoid having to implement this rollback scheme in the installation script.

Thanks

 






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]