zalando / zalando/postgres-operator

Merge the create and the sync code for the cluster

Open
#192 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Right now, Create is special because it fails when objects it tries to create are discovered as already existing during the call of the create{Object} (i.e. StatefulSet, Service, etc.). Subsequently, the next sync will find the cluster in a half-created state and sync all definitions from the cluster manifest with the actual state of the Kubernetes. This actually results in Create being equivalent to a Sync at the end of the day, but introduces a delay of one one ResyncPeriod before such a cluster can be used.

Given that, I don't see any strong reasons for not replacing Create with Sync altogether for the cluster. In fact, we already run sync every time for the secrets and user roles in the DB, not failing when those already exist.

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 the cluster Create and Sync entry points and the createObject handling for StatefulSets, Services, secrets, and user roles. Compare the existing secret and role sync behavior, then verify that Create handles already-existing objects without leaving a partial cluster or waiting for the next ResyncPeriod.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.