Skip to content

[Maintenance] Coordinator Health issue upgrade procedure #1853

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

Merged
merged 1 commit into from
Mar 25, 2025
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- (Feature) Emit Default values in Inventory
- (Maintenance) Bump github.com/containerd/containerd to v1.7.27
- (Feature) Rotation Order
- (Maintenance) Coordinator Health issue upgrade procedure

## [1.2.46](https://github.com/arangodb/kube-arangodb/tree/1.2.46) (2025-02-24)
- (Bugfix) Clean Phase change properly during upgrade
Expand Down
3 changes: 1 addition & 2 deletions docs/integration-sidecar.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
layout: page
has_children: true
title: Integration Sidecars
parent: ArangoDBPlatform
has_toc: false
nav_order: 1
---

# Integration
Expand Down
4 changes: 2 additions & 2 deletions docs/integration/authentication.v1.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: page
title: Authentication V1
parent: Integration Sidecars
title: Integration Sidecar Authentication V1
parent: ArangoDBPlatform
---

# Authentication V1
Expand Down
4 changes: 2 additions & 2 deletions docs/integration/authorization.v0.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: page
title: Authorization V0
parent: Integration Sidecars
title: Integration Sidecar Authorization V0
parent: ArangoDBPlatform
---

# Authorization V0
Expand Down
4 changes: 2 additions & 2 deletions docs/integration/scheduler.v1.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: page
title: Scheduler V1
parent: Integration Sidecars
title: Integration Sidecar Scheduler V1
parent: ArangoDBPlatform
---

# Scheduler V1
Expand Down
4 changes: 2 additions & 2 deletions docs/integration/scheduler.v2.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: page
title: Scheduler V2
parent: Integration Sidecars
title: Integration Sidecar Scheduler V2
parent: ArangoDBPlatform
---

# Scheduler V2
Expand Down
4 changes: 2 additions & 2 deletions docs/integration/shutdown.v1.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: page
title: Shutdown V1
parent: Integration Sidecars
title: Integration Sidecar Shutdown V1
parent: ArangoDBPlatform
---

# Shutdown V1
Expand Down
4 changes: 2 additions & 2 deletions docs/integration/storage.v2.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: page
title: Storage V2
parent: Integration Sidecars
title: Integration Sidecar Storage V2
parent: ArangoDBPlatform
---

# Storage V2
Expand Down
14 changes: 14 additions & 0 deletions docs/upgrade/health-endpoint-issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
layout: page
parent: Upgrading ArangoDB version
title: Coordinator Health Endpoint Issue
---

# Coordinator Health Endpoint Issue

Affected Versions:
- < 3.12.4

# Changes

During the upgrade Operator will change default [Upgrade Order](../api/ArangoDeployment.V1.md#specupgradeorder) from `standard` to `coordinatorFirst` in order to update coordinators first.
11 changes: 9 additions & 2 deletions pkg/deployment/reconcile/plan_builder_rotate_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ func (r *Reconciler) createUpgradePlanInternalCondition(apiObject k8sutil.APIObj
}

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

for _, group := range upgradeOrder {
for _, m := range status.Members.AsListInGroup(group) {
Expand Down Expand Up @@ -610,7 +611,13 @@ func waitForMemberActions(group api.ServerGroup, member api.MemberStatus) api.Pl
}
}

func getUpgradeOrder(spec api.DeploymentSpec) api.DeploymentSpecOrder {
func getUpgradeOrder(spec api.DeploymentSpec, from, to driver.Version) api.DeploymentSpecOrder {
if upgrade := spec.Upgrade; upgrade == nil || upgrade.Order == nil {
if to.CompareTo("3.12.4") >= 0 && from.CompareTo("3.12.4") < 0 && from.CompareTo("3.12.0") >= 0 && from != "" && to != "" {
return api.DeploymentSpecOrderCoordinatorFirst
}
}

return util.BoolSwitch(features.UpgradeAlternativeOrder().Enabled(), api.DeploymentSpecOrderCoordinatorFirst, spec.Upgrade.GetOrder(util.NewType(api.DeploymentSpecOrderStandard)))
}

Expand Down
20 changes: 20 additions & 0 deletions pkg/deployment/reconcile/plan_builder_rotate_upgrade_decision.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
package reconcile

import (
"github.com/arangodb/go-driver"

api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
"github.com/arangodb/kube-arangodb/pkg/deployment/rotation"
"github.com/arangodb/kube-arangodb/pkg/util"
Expand All @@ -44,6 +46,24 @@ type updateUpgradeDecisionItem struct {

type updateUpgradeDecisionMap map[updateUpgradeDecisionItem]updateUpgradeDecision

func (u updateUpgradeDecisionMap) GetFromToVersion() (from driver.Version, to driver.Version) {
for _, el := range u {
if !el.upgradeDecision.UpgradeNeeded {
continue
}

if from == "" || from.CompareTo(el.upgradeDecision.FromVersion) > 0 {
from = el.upgradeDecision.FromVersion
}

if to == "" || to.CompareTo(el.upgradeDecision.ToVersion) < 0 {
to = el.upgradeDecision.ToVersion
}
}

return
}

func (u updateUpgradeDecisionMap) AreGroupsPendingUpgrade(groups ...api.ServerGroup) bool {
for _, group := range groups {
if u.IsGroupPendingUpgrade(group) {
Expand Down
12 changes: 12 additions & 0 deletions pkg/deployment/reconcile/plan_builder_rotate_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package reconcile
import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/arangodb/go-driver"
Expand Down Expand Up @@ -109,3 +110,14 @@ func Test_RotateUpgrade_Condition(t *testing.T) {
})
}
}

func Test_getUpgradeOrder(t *testing.T) {
assert.EqualValues(t, api.DeploymentSpecOrderStandard, getUpgradeOrder(api.DeploymentSpec{}, "", ""))
assert.EqualValues(t, api.DeploymentSpecOrderStandard, getUpgradeOrder(api.DeploymentSpec{}, "3.11.0", "3.12.4"))
assert.EqualValues(t, api.DeploymentSpecOrderCoordinatorFirst, getUpgradeOrder(api.DeploymentSpec{}, "3.12.0", "3.12.4"))
assert.EqualValues(t, api.DeploymentSpecOrderCoordinatorFirst, getUpgradeOrder(api.DeploymentSpec{}, "3.12.1", "3.12.4"))
assert.EqualValues(t, api.DeploymentSpecOrderCoordinatorFirst, getUpgradeOrder(api.DeploymentSpec{}, "3.12.2", "3.12.4"))
assert.EqualValues(t, api.DeploymentSpecOrderCoordinatorFirst, getUpgradeOrder(api.DeploymentSpec{}, "3.12.3", "3.12.4"))
assert.EqualValues(t, api.DeploymentSpecOrderStandard, getUpgradeOrder(api.DeploymentSpec{}, "3.12.4", "3.12.4"))
assert.EqualValues(t, api.DeploymentSpecOrderStandard, getUpgradeOrder(api.DeploymentSpec{}, "3.12.4", "3.12.5"))
}