Skip to content

feat: [CPCAP-9364] automatic pvc extension - #584

Open
yerkennz wants to merge 5 commits into
mainfrom
feat-pvc-extension
Open

feat: [CPCAP-9364] automatic pvc extension#584
yerkennz wants to merge 5 commits into
mainfrom
feat-pvc-extension

Conversation

@yerkennz

Copy link
Copy Markdown
Contributor

No description provided.

@yerkennz
yerkennz requested review from Tvion and anikin-aa August 21, 2026 10:51
@github-actions github-actions Bot added the enhancement New feature or request label Aug 21, 2026
@anikin-aa
anikin-aa requested a review from mchekalov August 21, 2026 11:26
Comment thread operator/pkg/helper/resource_management.go
return restartRequired, err
}

func (rm *ResourceManager) WaitForPodDeletion(podName string, timeout time.Duration) error {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have util.WaitDeletePod method

Comment thread operator/pkg/reconciler/patroni.go Outdated
return err
}

time.Sleep(10 * time.Second)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the sleep is there?

Comment thread operator/pkg/reconciler/patroni.go Outdated
return err
}

time.Sleep(10 * time.Second)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the sleep is there?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gives the storage system a few seconds to finish releasing the disk before the pod uses it again.

}
}

time.Sleep(10 * time.Second)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please describe every provided sleep

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It gives the storage system a few seconds to finish releasing the disk before the pod uses it again.

Comment thread operator/pkg/patroni/patroni.go Outdated
return err
}

resp, err := http.Post(patroniURL+"switchover", "application/json", bytes.NewBuffer(data))

@Tvion Tvion Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use patroniPost method here

Comment thread operator/pkg/reconciler/backup_daemon.go Outdated
Comment thread operator/pkg/reconciler/backup_daemon.go Outdated
@github-actions github-actions Bot added the bug Something isn't working label Aug 27, 2026
logger.Info(fmt.Sprintf("Restarting Backup Daemon deployment %s to complete PVC resize, attempt %d, waiting %s", backupDaemonDeployment.Name, attempt, delay))

backupPods, err := r.helper.GetNamespacePodListBySelectors(
map[string]string{"app": "postgres-backup-daemon"},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use deployment.BackupDaemonLabels

return fmt.Errorf("timeout waiting for Backup Daemon PVC resize")
}

if err := r.helper.CreateOrUpdateDeploymentForce(backupDaemonDeployment, true); err != nil {

@Tvion Tvion Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We pass waitForStability argument as true

Will this method wait for pod to be healthy

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, since inside of this function we are checking with util.WaitForStabilityDepl that wait for stability

}
patroniPvcs = append(patroniPvcs, storage.NewPvc(fmt.Sprintf("%s-wals-data-%v", opUtil.GetPatroniClusterName(cr.Spec.Patroni.ClusterName), deploymentIdx), patroniSpec.PgWalStorage, deploymentIdx))
}
if cr.Spec.PgBackRest != nil && strings.ToLower(cr.Spec.PgBackRest.RepoType) == "rwx" {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please roll back this section removal as pgbackrest PVC must be created as before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants