8000 [Maintenance] Coordinator Health issue upgrade procedure (#1853) · arangodb/kube-arangodb@8cd2ceb · GitHub
[go: up one dir, main page]

Skip to content

Commit 8cd2ceb

Browse files
authored
[Maintenance] Coordinator Health issue upgrade procedure (#1853)
1 parent 6d6045f commit 8cd2ceb

12 files changed

+69
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- (Feature) Emit Default values in Inventory
1414
- (Maintenance) Bump github.com/containerd/containerd to v1.7.27
1515
- (Feature) Rotation Order
16+
- (Maintenance) Coordinator Health issue upgrade procedure
1617

1718
## [1.2.46](https://github.com/arangodb/kube-arangodb/tree/1.2.46) (2025-02-24)
1819
- (Bugfix) Clean Phase change properly during upgrade

docs/integration-sidecar.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22
layout: page
3-
has_children: true
43
title: Integration Sidecars
54
parent: ArangoDBPlatform
6-
has_toc: false
5+
nav_order: 1
76
---
87

98
# Integration

docs/integration/authentication.v1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page
3-
title: Authentication V1
4-
parent: Integration Sidecars
3+
title: Integration Sidecar Authentication V1
4+
parent: ArangoDBPlatform
55
---
66

77
# Authentication V1

docs/integration/authorization.v0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page
3-
title: Authorization V0
4-
parent: Integration Sidecars
3+
title: Integration Sidecar Authorization V0
4+
parent: ArangoDBPlatform
55
---
66

77
# Authorization V0

docs/integration/scheduler.v1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page
3-
title: Scheduler V1
4-
parent: Integration Sidecars
3+
title: Integration Sidecar Scheduler V1
4+
parent: ArangoDBPlatform
55
---
66

77
# Scheduler V1

docs/integration/scheduler.v2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page
3-
title: Scheduler V2
4-
parent: Integration Sidecars
3+
title: Integration Sidecar Scheduler V2
4+
parent: ArangoDBPlatform
55
---
66

77
# Scheduler V2

docs/integration/shutdown.v1.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page
3-
title: Shutdown V1
4-
parent: Integration Sidecars
3+
title: Integration Sidecar Shutdown V1
4+
parent: ArangoDBPlatform
55
---
66

77
# Shutdown V1

docs/integration/storage.v2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page
3-
title: Storage V2
4-
parent: Integration Sidecars
3+
title: Integration Sidecar Storage V2
4+
parent: ArangoDBPlatform
55
---
66

77
# Storage V2
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
layout: page
3+
parent: Upgrading ArangoDB version
4+
title: Coordinator Health Endpoint Issue
5+
---
6+
7+
# Coordinator Health Endpoint Issue
8+
9+
Affected Versions:
10+
- < 3.12.4
11+
12+
# Changes
13+
14+
During the upgrade Operator will change default [Upgrade Order](../api/ArangoDeployment.V1.md#specupgradeorder) from `standard` to `coordinatorFirst` in order to update coordinators first.

pkg/deployment/reconcile/plan_builder_rotate_upgrade.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ func (r *Reconciler) createUpgradePlanInternalCondition(apiObject k8sutil.APIObj
238238
}
239239

240240
func (r *Reconciler) createUpgradePlanInternal(apiObject k8sutil.APIObject, spec api.DeploymentSpec, status api.DeploymentStatus, context PlanBuilderContext, decision updateUpgradeDecisionMap, agencyCache state.State) (api.Plan, bool) {
241-
upgradeOrder := getUpgradeOrder(spec).Groups()
241+
from, to := decision.GetFromToVersion()
242+
upgradeOrder := getUpgradeOrder(spec, from, to).Groups()
242243

243244
for _, group := range upgradeOrder {
244245
for _, m := range status.Members.AsListInGroup(group) {
@@ -610,7 +611,13 @@ func waitForMemberActions(group api.ServerGroup, member api.MemberStatus) api.Pl
610611
}
611612
}
612613

613-
func getUpgradeOrder(spec api.DeploymentSpec) api.DeploymentSpecOrder {
614+
func getUpgradeOrder(spec api.DeploymentSpec, from, to driver.Version) api.DeploymentSpecOrder {
615+
if upgrade := spec.Upgrade; upgrade == nil || upgrade.Order == nil {
616+
if to.CompareTo("3.12.4") >= 0 && from.CompareTo("3.12.4") < 0 && from.CompareTo("3.12.0") >= 0 && from != "" && to != "" {
617+
return api.DeploymentSpecOrderCoordinatorFirst
618+
}
619+
}
620+
614621
return util.BoolSwitch(features.UpgradeAlternativeOrder().Enabled(), api.DeploymentSpecOrderCoordinatorFirst, spec.Upgrade.GetOrder(util.NewType(api.DeploymentSpecOrderStandard)))
615622
}
616623

pkg/deployment/reconcile/plan_builder_rotate_upgrade_decision.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
package reconcile
2222

2323
import (
24+
"github.com/arangodb/go-driver"
25+
2426
api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
2527
"github.com/arangodb/kube-arangodb/pkg/deployment/rotation"
2628
"github.com/arangodb/kube-arangodb/pkg/util"
@@ -44,6 +46,24 @@ type updateUpgradeDecisionItem struct {
4446

4547
type updateUpgradeDecisionMap map[updateUpgradeDecisionItem]updateUpgradeDecision
4648

49+
func (u updateUpgradeDecisionMap) GetFromToVersion() (from driver.Version, to driver.Version) {
50+
for _, el := range u {
51+
if !el.upgradeDecision.UpgradeNeeded {
52+
continue
53+
}
54+
55+
if from == "" || from.CompareTo(el.upgradeDecision.FromVersion) > 0 {
56+
from = el.upgradeDecision.FromVersion
57+
}
58+
59+
if to == "" || to.CompareTo(el.upgradeDecision.ToVersion) < 0 {
60+
to = el.upgradeDecision.ToVersion
61+
}
62+
}
63+
64+
return
65+
}
66+
4767
func (u updateUpgradeDecisionMap) AreGroupsPendingUpgrade(groups ...api.ServerGroup) bool {
4868
for _, group := range groups {
4969
if u.IsGroupPendingUpgrade(group) {

pkg/deployment/reconcile/plan_builder_rotate_upgrade_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ package reconcile
2323
import (
2424
"testing"
2525

26+
"github.com/stretchr/testify/assert"
2627
"github.com/stretchr/testify/require"
2728

2829
"github.com/arangodb/go-driver"
@@ -109,3 +110,14 @@ func Test_RotateUpgrade_Condition(t *testing.T) {
109110
})
110111
}
111112
}
113+
114+
func Test_getUpgradeOrder(t *testing.T) {
115+
assert.EqualValues(t, api.DeploymentSpecOrderStandard, getUpgradeOrder(api.DeploymentSpec{}, "", ""))
116+
assert.EqualValues(t, api.DeploymentSpecOrderStandard, getUpgradeOrder(api.DeploymentSpec{}, "3.11.0", "3.12.4"))
117+
assert.EqualValues(t, api.DeploymentSpecOrderCoordinatorFirst, getUpgradeOrder(api.DeploymentSpec{}, "3.12.0", "3.12.4"))
118+
assert.EqualValues(t, api.DeploymentSpecOrderCoordinatorFirst, getUpgradeOrder(api.DeploymentSpec{}, "3.12.1", "3.12.4"))
119+
assert.EqualValues(t, api.DeploymentSpecOrderCoordinatorFirst, getUpgradeOrder(api.DeploymentSpec{}, "3.12.2", "3.12.4"))
120+
assert.EqualValues(t, api.DeploymentSpecOrderCoordinatorFirst, getUpgradeOrder(api.DeploymentSpec{}, "3.12.3", "3.12.4"))
121+
assert.EqualValues(t, api.DeploymentSpecOrderStandard, getUpgradeOrder(api.DeploymentSpec{}, "3.12.4", "3.12.4"))
122+
assert.EqualValues(t, api.DeploymentSpecOrderStandard, getUpgradeOrder(api.DeploymentSpec{}, "3.12.4", "3.12.5"))
123+
}

0 commit comments

Comments
 (0)
0