zalando / zalando/postgres-operator

Operator doesn't create prepared databases after standby replication from standalone source

Open
#2,846 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
5.2k
Forks
1.1k
Avg merge
2d 16h
Merged PRs (30d)
3

Description

Hello,

I’ve encountered an interesting situation where I "hacked" (is it?) the operator to use the standby feature for replicating a standalone PostgreSQL database located on a remote server into my Kubernetes cluster. The source database's tables were in the postgres database.

The replication worked so well that the operator didn’t perform some expected tasks, specifically:

  1. It didn’t create the database I specified in the preparedDatabase .
  2. It didn’t create any users, even though defaultUsers: true was set.

Now that my data was "backed up" within my cluster. Does anybody know if there a way to make the operator to actually create these default users and database?

I would appreciate any guidance or clarification on how the operator handles such scenarios. Let me know if you need more details about my setup.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how standby replication from a remote standalone PostgreSQL source handles the preparedDatabase and defaultUsers settings. Compare the resulting cluster state with the requested configuration, and determine whether creating the database and users is expected after replication; capture the behavior in a focused test or documentation update.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, postgresql
Domain
databases, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.