Skip to content

feat: add .spec.replicaCluster.primary field - #4388

Merged
leonardoce merged 5 commits into
mainfrom
dev/3942
Jun 24, 2024
Merged

leonardoce merged 5 commits into
mainfrom
dev/3942

Conversation

@armru

@armru armru commented Apr 26, 2024 •

Copy link
Copy Markdown
Member

This patch introduces changes to the handling of the .spec.replica.enabled field, allowing it to be set to nil. Prior to this patch, only true and false were permitted, with false being the default. When the .spec.replica.enabled field is set to nil, the cluster's classification as a primary or replica cluster will be determined by two new fields, .spec.replica.primary and .spec.replica.self.

The .spec.replica.self field specifies the name of the current cluster, which will be compared with the .spec.externalClusters[].name field. The .spec.replica.primary field specifies the name of the current primary cluster, which will be searched in the same list.
Under the new behavior, when the .spec.replica.enabled field is set to nil and the .spec.replica.primary and .spec.replica.self fields contain the same value, the cluster is classified as a primary cluster.

Conversely, when the .spec.replica.enabled field is nil and the values of .spec.replica.primary and .spec.replica.self differ, the cluster will be classified as a replica cluster.

The purpose of this patch is to streamline the configuration process for a distributed PostgreSQL topology, where the .spec.externalClusters section is synchronized across different data centers.

Closes #3942

@github-actions github-actions Bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.21 labels Apr 26, 2024
@github-actions

Copy link
Copy Markdown
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@armru

armru commented Apr 26, 2024

Copy link
Copy Markdown
Member Author

/test limit=local

@github-actions

Copy link
Copy Markdown
Contributor

@armru

armru commented Apr 26, 2024

Copy link
Copy Markdown
Member Author

/test limit=local

@github-actions

Copy link
Copy Markdown
Contributor

@armru armru removed backport-requested ◀️ This pull request should be backported to all supported releases release-1.21 labels Apr 26, 2024
@armru

armru commented Apr 29, 2024

Copy link
Copy Markdown
Member Author

/test limit=local

@github-actions

Copy link
Copy Markdown
Contributor

@leonardoce
leonardoce force-pushed the dev/3942 branch 2 times, most recently from 7dc7fee to cdd3a45 Compare May 16, 2024 14:42
@litaocdl

Copy link
Copy Markdown
Collaborator

@gbartolini gbartolini added the do not merge 🙅 This PR cannot be merged (yet) label May 27, 2024
@fcanovai
fcanovai force-pushed the dev/3942 branch 2 times, most recently from 1d72356 to 3ca301d Compare June 19, 2024 07:34
@leonardoce

Copy link
Copy Markdown
Contributor

@leonardoce leonardoce removed the do not merge 🙅 This PR cannot be merged (yet) label Jun 21, 2024
armru and others added 5 commits June 24, 2024 11:41
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Fix a validation bug and use the new api in some tests

Signed-off-by: Francesco Canovai <[email protected]>
@leonardoce

Copy link
Copy Markdown
Contributor

/ok-to-merge e2e failures are not related

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Jun 24, 2024
@leonardoce
leonardoce merged commit ae9a127 into main Jun 24, 2024
@leonardoce
leonardoce deleted the dev/3942 branch June 24, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok to merge 👌 This PR can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Introduce replica.primary and replica.enabled = auto

6 participants