Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8SPXC-1152: restore stucks on operator restart #1610

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ spec:
type: object
status:
properties:
allowUnsafeConfigurations:
type: boolean
clusterSize:
format: int32
type: integer
comments:
type: string
completed:
Expand Down
5 changes: 5 additions & 0 deletions deploy/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,11 @@ spec:
type: object
status:
properties:
allowUnsafeConfigurations:
type: boolean
clusterSize:
format: int32
type: integer
comments:
type: string
completed:
Expand Down
5 changes: 5 additions & 0 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,11 @@ spec:
type: object
status:
properties:
allowUnsafeConfigurations:
type: boolean
clusterSize:
format: int32
type: integer
comments:
type: string
completed:
Expand Down
5 changes: 5 additions & 0 deletions deploy/cw-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,11 @@ spec:
type: object
status:
properties:
allowUnsafeConfigurations:
type: boolean
clusterSize:
format: int32
type: integer
comments:
type: string
completed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ metadata:
name: restore-src-restore-pvc-sec-context
name: restore-src-restore-pvc-sec-context
ownerReferences:
- controller: true
- blockOwnerDeletion: true
controller: true
kind: PerconaXtraDBClusterRestore
name: restore-pvc
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ metadata:
name: restore-src-restore-pvc-sec-context
name: restore-src-restore-pvc-sec-context
ownerReferences:
- controller: true
- blockOwnerDeletion: true
controller: true
kind: PerconaXtraDBClusterRestore
name: restore-pvc
spec:
Expand Down
11 changes: 6 additions & 5 deletions pkg/apis/pxc/v1/pxc_prestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ type PerconaXtraDBClusterRestoreSpec struct {

// PerconaXtraDBClusterRestoreStatus defines the observed state of PerconaXtraDBClusterRestore
type PerconaXtraDBClusterRestoreStatus struct {
State BcpRestoreStates `json:"state,omitempty"`
Comments string `json:"comments,omitempty"`
CompletedAt *metav1.Time `json:"completed,omitempty"`
LastScheduled *metav1.Time `json:"lastscheduled,omitempty"`
State BcpRestoreStates `json:"state,omitempty"`
Comments string `json:"comments,omitempty"`
CompletedAt *metav1.Time `json:"completed,omitempty"`
LastScheduled *metav1.Time `json:"lastscheduled,omitempty"`
PXCSize int32 `json:"clusterSize,omitempty"`
AllowUnsafeConfig bool `json:"allowUnsafeConfigurations,omitempty"`
}

type PITR struct {
Expand Down Expand Up @@ -63,7 +65,6 @@ type BcpRestoreStates string

const (
RestoreNew BcpRestoreStates = ""
RestoreStarting BcpRestoreStates = "Starting"
RestoreStopCluster BcpRestoreStates = "Stopping Cluster"
RestoreRestore BcpRestoreStates = "Restoring"
RestoreStartCluster BcpRestoreStates = "Starting Cluster"
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/pxc/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ func (r *ReconcilePerconaXtraDBCluster) isRestoreRunning(clusterName, namespace
}

switch v.Status.State {
case api.RestoreStarting, api.RestoreStopCluster, api.RestoreRestore,
case api.RestoreStopCluster, api.RestoreRestore,
api.RestoreStartCluster, api.RestorePITR:
return true, nil
}
Expand Down
Loading
Loading