fly-apps / postgres-flex

Postgres HA setup using repmgr
67 stars 32 forks source link

Readonly is not enforced for newly created databases #189

Open davissp14 opened 1 year ago

davissp14 commented 1 year ago

When a cluster is made read-only, we will loop through each of the user-defined databases and turn them read-only individually. This ensures that each existing database will no longer be able to issue writes until the existing problem is addressed, however, this is not enforced for databases that are created after the fact.

Example case where this could cause issues:

App is made read-only to prevent disk capacity from reaching 100%

  1. User attaches a new app to the database.
  2. User will be able to issue writes and push their volume to 100% disk capacity.

Problem

We don't re-evaluate the list of databases once the readonly.lock file has been issued.