I see there’s a checkbox for “readonly mode during backup” which is not checked by default. I suppose backups work fine without it - when might this feature be needed?
The only time I’ve used the read only mode is when I’m migrating a forum from one host to another.
There can be other use cases but that’s the only one I’ve found useful.
I imagine the global ‘read only mode’ is useful for the case of migration. (The setting in question, presumably, makes the forum read-write again when the backup is done, which makes it not so useful for migration.)
Maybe we can remove this setting @eviltrout?
I’m quite sure we can remove the readonly_mode_during_backup
setting. It’s off by default anyway. The chance of creating a backup in an inconsistent state is negligible compared to the annoyance of showing a read-only banner to all users everytime a backup is created.
pg_dump runs in a serializable transaction, so an inconsistent state can only happen when Discourse is in the middle of persisting data into multiple tables without using a transaction exactly at the beginning of the database dump. That should be quite rare.
Enabling that setting enables read-only mode only for the duration of database backup. Not a second longer, so it’s not really usable for migrating to another host. You’d be better of in using the “Enable read-only” button in /admin/backups
.
Sounds good to me! Did you want to take that?
Hmm… Would it be better, and possible, to ensure that transactions are always used? In the meantime, those with very large and busy forums and a deep sense of anxiety can use this “readonly mode during backup” option.
The site setting was removed here: