Hi there,
I am following https://maas.io/docs/how-to-back-up-maas to set up a periodic backup task for maas db and its supported files. The document suggests to stop MaaS services, which should be fine for a clean backup (and restore). Every stop/start activity creates a service disruption. Is it a requirement to stop MaaS services while doing a periodic backup?
Reading through pg_dumpall
(the tool used for db backup) documentation:
pg_dumpall
backs up all database and uses pg_dump underneath to backup a database.pg_dump
process requests shared locks ACCESS SHARE (AccessShareLock) on table before doing a dump - this is to prevent some application trying to drop table while a dump is happening.- pg_dump does not block other users accessing the database (readers or writers), which means update operations will still happen.
- The dump begins with setting
TRANSACTION ISOLATION LEVEL SERIALIZABLE
. Everything afterpg_dump
sets the transaction isolation level is not part of this dump.
To me this means its safe to perform periodic backup without stopping MaaS services, its just that any insert/update operation that happens in MaaS db during the time pg_dump
happens won’t be part of the backup, however they will be backed-up during the next run.
Appreciate thoughts/comments!