Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
postgres-operator
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
zalando
postgres-operator
Commits
c25dc57b
Unverified
Commit
c25dc57b
authored
10 months ago
by
Ida Novindasari
Committed by
GitHub
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
only skip upgrade if failed before after recheck version (#2755)
parent
2e398120
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/cluster/majorversionupgrade.go
+9
-5
9 additions, 5 deletions
pkg/cluster/majorversionupgrade.go
with
9 additions
and
5 deletions
pkg/cluster/majorversionupgrade.go
+
9
−
5
View file @
c25dc57b
...
...
@@ -127,11 +127,6 @@ func (c *Cluster) majorVersionUpgrade() error {
return
nil
}
if
_
,
exists
:=
c
.
ObjectMeta
.
Annotations
[
majorVersionUpgradeFailureAnnotation
];
exists
{
c
.
logger
.
Infof
(
"last major upgrade failed, skipping upgrade"
)
return
nil
}
if
!
isInMainternanceWindow
(
c
.
Spec
.
MaintenanceWindows
)
{
c
.
logger
.
Infof
(
"skipping major version upgrade, not in maintenance window"
)
return
nil
...
...
@@ -162,10 +157,19 @@ func (c *Cluster) majorVersionUpgrade() error {
// Recheck version with newest data from Patroni
if
c
.
currentMajorVersion
>=
desiredVersion
{
if
_
,
exists
:=
c
.
ObjectMeta
.
Annotations
[
majorVersionUpgradeFailureAnnotation
];
exists
{
// if failure annotation exists, remove it
c
.
removeFailuresAnnotation
()
c
.
logger
.
Infof
(
"removing failure annotation as the cluster is already up to date"
)
}
c
.
logger
.
Infof
(
"recheck cluster version is already up to date. current: %d, min desired: %d"
,
c
.
currentMajorVersion
,
desiredVersion
)
return
nil
}
if
_
,
exists
:=
c
.
ObjectMeta
.
Annotations
[
majorVersionUpgradeFailureAnnotation
];
exists
{
c
.
logger
.
Infof
(
"last major upgrade failed, skipping upgrade"
)
return
nil
}
isUpgradeSuccess
:=
true
numberOfPods
:=
len
(
pods
)
if
allRunning
&&
masterPod
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment