postgres-operator icon indicating copy to clipboard operation
postgres-operator copied to clipboard

Moving from users/databases config to preparedDatabases

Open xvilo opened this issue 1 year ago • 1 comments

Please, answer some short questions which should help us to understand your problem / question better?

  • Which image of the operator are you using? ghcr.io/zalando/postgres-operator:v1.12.2
  • What PSQL version are you using? 15
  • Where do you run it - cloud or metal? Kubernetes or OpenShift? Kubernetes
  • Are you running Postgres Operator in production? [yes]
  • Type of issue? question

We're running Sentry Helm Chart with the Postgres operator for the Database. However, due to the complexities of Sentry, it saves all of the raw events data in the Postgres database and often find us with a full PVC.

We found out that we need to VACUUM FULL that table to reclaim space on the PVC, however, this requires an exclusive lock on that table, rendering Sentry out of service for a bit. After searching for alternatives, we came across pg_repack, which should be a way to reclaim PVC space without an exclusive lock in the table.

To start using pg_repack I believe we need to have a preparedDatabase with that extension in the list. But currently we're using the users and databases configurations keys.

The question: Can I just switch to preparedDatabases and remove the databases/users mapping without dataloss? Or do I need to keep them in there, and additionally add preparedDatabases? What is the best way forward to add this extension into the mix.

xvilo avatar Sep 02 '24 12:09 xvilo