Automated backup performed while read-only mode was enabled

Should an automated backup be performed while the read-only mode is enabled?

Use case:

  • A discourse forum was migrated to another host, hence the read-only mode was enabled. This forum wasn’t deleted yet “just in case”.
  • After the migration, the disk was resized in order to reduce free unused space.
  • Then a backup was automatically performed, after that there was almost no free space and that impacted other services running on the host.

I didn’t expect the automated backups to be performed while the forum was in read-only mode.

Discourse: Commits · discourse/discourse · GitHub

There’s a site setting to control backups. That’s the way to turn them off. You’ll need to disable them before setting read only mode (unless you do it with an environment variable).

I’m not sure what to think about whether read only mode implies turning off backups.

Edit: but I agree with gerhard.

3 Likes

I’m torn on this. I understand the expectation of not having automatic backups in read-only mode. You usually create manual backups when the site is readonly and don’t rely on automatic ones.

But, and this is a big but, disabling automatic backups increases the chance of data loss. Should an automatic backup be created if there is no backup yet? How can we ensure that the site is really readonly all the time? The backup process might be unlucky and always run at a time when the site is readonly for whatever reason. Users could have created content in the time when it wasn’t readonly…

Solving this would complicate things. And ignoring those problems creates risk for site owners. Discourse tries to have safe defaults, so I think the best and only solution is to manually disable backups before permanently switching into readonly mode.

So, I’d say this isn’t a bug.

3 Likes

As an ordinary webmaster I would say options like backuping must be on or off, never conditionally when one must remember all situations and conditions.

Yes, I know. My answer is not matter of bugs, but UX/UI.

3 Likes

Then we should pop a dialog that warns about this when you trigger readonly mode? How would you know to do this? That’s my concern. You’d have zero way to know.

1 Like