When to use "readonly mode during backup"

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.

6 Likes