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 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -354,16 +354,36 @@ spec:
type: object
status:
properties:
clusterSize:
format: int32
type: integer
comments:
type: string
completed:
format: date-time
type: string
haproxySize:
format: int32
type: integer
lastscheduled:
format: date-time
type: string
proxysqlSize:
format: int32
type: integer
state:
type: string
unsafeFlags:
properties:
backupIfUnhealthy:
type: boolean
proxySize:
type: boolean
pxcSize:
type: boolean
tls:
type: boolean
type: object
type: object
type: object
served: true
Expand Down
20 changes: 20 additions & 0 deletions deploy/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -597,16 +597,36 @@ spec:
type: object
status:
properties:
clusterSize:
format: int32
type: integer
comments:
type: string
completed:
format: date-time
type: string
haproxySize:
format: int32
type: integer
lastscheduled:
format: date-time
type: string
proxysqlSize:
format: int32
type: integer
state:
type: string
unsafeFlags:
properties:
backupIfUnhealthy:
type: boolean
proxySize:
type: boolean
pxcSize:
type: boolean
tls:
type: boolean
type: object
type: object
type: object
served: true
Expand Down
20 changes: 20 additions & 0 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -597,16 +597,36 @@ spec:
type: object
status:
properties:
clusterSize:
format: int32
type: integer
comments:
type: string
completed:
format: date-time
type: string
haproxySize:
format: int32
type: integer
lastscheduled:
format: date-time
type: string
proxysqlSize:
format: int32
type: integer
state:
type: string
unsafeFlags:
properties:
backupIfUnhealthy:
type: boolean
proxySize:
type: boolean
pxcSize:
type: boolean
tls:
type: boolean
type: object
type: object
type: object
served: true
Expand Down
20 changes: 20 additions & 0 deletions deploy/cw-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -597,16 +597,36 @@ spec:
type: object
status:
properties:
clusterSize:
format: int32
type: integer
comments:
type: string
completed:
format: date-time
type: string
haproxySize:
format: int32
type: integer
lastscheduled:
format: date-time
type: string
proxysqlSize:
format: int32
type: integer
state:
type: string
unsafeFlags:
properties:
backupIfUnhealthy:
type: boolean
proxySize:
type: boolean
pxcSize:
type: boolean
tls:
type: boolean
type: object
type: object
type: object
served: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ metadata:
percona.com/restore-svc-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 @@ -11,7 +11,8 @@ metadata:
percona.com/restore-svc-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
5 changes: 4 additions & 1 deletion pkg/apis/pxc/v1/pxc_prestore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ type PerconaXtraDBClusterRestoreStatus struct {
Comments string `json:"comments,omitempty"`
CompletedAt *metav1.Time `json:"completed,omitempty"`
LastScheduled *metav1.Time `json:"lastscheduled,omitempty"`
PXCSize int32 `json:"clusterSize,omitempty"`
HAProxySize int32 `json:"haproxySize,omitempty"`
ProxySQLSize int32 `json:"proxysqlSize,omitempty"`
Unsafe UnsafeFlags `json:"unsafeFlags,omitempty"`
}

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

const (
RestoreNew BcpRestoreStates = ""
RestoreStarting BcpRestoreStates = "Starting"
RestoreStopCluster BcpRestoreStates = "Stopping Cluster"
RestoreRestore BcpRestoreStates = "Restoring"
RestoreStartCluster BcpRestoreStates = "Starting Cluster"
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/pxc/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/controller/pxc/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,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