Skip to content

Flexible server replica entering in a broken state #5086

@andreidorin-oprea

Description

@andreidorin-oprea

Describe the bug

We are creating some postgres instances with geo replica. Creation works as expected, everything enters ready state. At some point there is a pod restart and everything is again reconciled. The objects defining the replica enter in a continuous transition state between Reconciling and ReadReplicaAlreadyExistWithGivenName, with the error Cannot create read replica '<name>' because a server with that name already exists

Azure Service Operator Version: 2.17.0

Expected behavior

The controller should pick up that there is an existing replica and adopt it.

To Reproduce

  1. Apply object for primary
apiVersion: dbforpostgresql.azure.com/v20250801
kind: FlexibleServer
metadata:
  name: tst-df-postgres2
spec:
  administratorLogin: postgreSQLAdmin
  administratorLoginPassword:
    key: password
    name: tst-df-postgres2
  authConfig:
    activeDirectoryAuth: Enabled
    passwordAuth: Enabled
  azureName: tst-df-postgres2
  location: northeurope
  owner:
    armId: <rg_arm_id>
  sku:
    name: Standard_D2ds_v5
    tier: GeneralPurpose
  storage:
    storageSizeGB: 64
  version: "16"
  1. Apply object for secondary
apiVersion: dbforpostgresql.azure.com/v20250801
kind: FlexibleServer
metadata:
  name: tst-df-postgres2-secondary
spec:
  azureName: tst-df-postgres2-secondary
  createMode: Replica
  highAvailability:
    mode: ZoneRedundant
  location: westeurope
  owner:
    armId: <rg_arm_id>
  sourceServerResourceReference:
    group: dbforpostgresql.azure.com
    kind: FlexibleServer
    name: tst-df-postgres2
  1. Restart controller

Screenshots

Image

Metadata

Metadata

Assignees

Labels

bug 🪲Something isn't working

Type

No type

Projects

Status

Medium Term

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions