mirror of
https://github.com/arangodb/kube-arangodb.git
synced 2024-12-14 11:57:37 +00:00
[Bugfix] Fix AKS Volume resize mode (#688)
This commit is contained in:
parent
5b7dddd7d4
commit
9951738e5b
8 changed files with 21 additions and 6 deletions
|
@ -1,6 +1,7 @@
|
|||
# Change Log
|
||||
|
||||
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
|
||||
- Fix AKS Volume Resize mode
|
||||
|
||||
## [1.1.4](https://github.com/arangodb/kube-arangodb/tree/1.1.4) (2021-02-15)
|
||||
- Add support for spec.ClusterDomain to be able to use FQDN in ArangoDB cluster communication
|
||||
|
|
|
@ -42,6 +42,8 @@ const (
|
|||
MemberPhaseShuttingDown MemberPhase = "ShuttingDown"
|
||||
// MemberPhaseRotating indicates that a member is being rotated
|
||||
MemberPhaseRotating MemberPhase = "Rotating"
|
||||
// MemberPhaseRotateStart indicates that a member is being rotated but wont get up outside of plan
|
||||
MemberPhaseRotateStart MemberPhase = "RotateStart"
|
||||
// MemberPhaseUpgrading indicates that a member is in the process of upgrading its database data format
|
||||
MemberPhaseUpgrading MemberPhase = "Upgrading"
|
||||
)
|
||||
|
|
|
@ -42,6 +42,8 @@ const (
|
|||
MemberPhaseShuttingDown MemberPhase = "ShuttingDown"
|
||||
// MemberPhaseRotating indicates that a member is being rotated
|
||||
MemberPhaseRotating MemberPhase = "Rotating"
|
||||
// MemberPhaseRotateStart indicates that a member is being rotated but wont get up outside of plan
|
||||
MemberPhaseRotateStart MemberPhase = "RotateStart"
|
||||
// MemberPhaseUpgrading indicates that a member is in the process of upgrading its database data format
|
||||
MemberPhaseUpgrading MemberPhase = "Upgrading"
|
||||
)
|
||||
|
|
|
@ -92,7 +92,7 @@ func (a *actionRotateStartMember) Start(ctx context.Context) (bool, error) {
|
|||
}
|
||||
}
|
||||
// Update status
|
||||
m.Phase = api.MemberPhaseRotating
|
||||
m.Phase = api.MemberPhaseRotateStart
|
||||
|
||||
if err := a.actionCtx.UpdateMember(m); err != nil {
|
||||
return false, errors.WithStack(err)
|
||||
|
|
|
@ -141,13 +141,23 @@ func pvcResizePlan(log zerolog.Logger, group api.ServerGroup, groupSpec api.Serv
|
|||
api.NewAction(api.ActionTypePVCResize, group, memberID),
|
||||
}
|
||||
case api.PVCResizeModeRotate:
|
||||
return api.Plan{
|
||||
var plan api.Plan
|
||||
|
||||
if group == api.ServerGroupDBServers {
|
||||
plan = append(plan,
|
||||
api.NewAction(api.ActionTypeCleanOutMember, group, memberID),
|
||||
)
|
||||
}
|
||||
|
||||
plan = append(plan,
|
||||
api.NewAction(api.ActionTypeRotateStartMember, group, memberID),
|
||||
api.NewAction(api.ActionTypePVCResize, group, memberID),
|
||||
api.NewAction(api.ActionTypePVCResized, group, memberID),
|
||||
api.NewAction(api.ActionTypeRotateStopMember, group, memberID),
|
||||
api.NewAction(api.ActionTypeWaitForMemberUp, group, memberID),
|
||||
}
|
||||
)
|
||||
|
||||
return plan
|
||||
default:
|
||||
log.Error().Str("server-group", group.AsRole()).Str("mode", mode.String()).
|
||||
Msg("Requested mode is not supported")
|
||||
|
|
|
@ -33,7 +33,7 @@ const (
|
|||
renewTLSCACertificateTimeout = time.Minute * 30
|
||||
operationTLSCACertificateTimeout = time.Minute * 30
|
||||
rotateMemberTimeout = time.Minute * 15
|
||||
pvcResizeTimeout = time.Minute * 15
|
||||
pvcResizeTimeout = time.Minute * 30
|
||||
pvcResizedTimeout = time.Minute * 15
|
||||
backupRestoreTimeout = time.Minute * 15
|
||||
shutdownMemberTimeout = time.Minute * 30
|
||||
|
|
|
@ -56,7 +56,7 @@ func (r *Resilience) CheckMemberFailure() error {
|
|||
switch m.Phase {
|
||||
case api.MemberPhaseNone:
|
||||
continue
|
||||
case api.MemberPhaseUpgrading, api.MemberPhaseRotating, api.MemberPhaseCleanOut:
|
||||
case api.MemberPhaseUpgrading, api.MemberPhaseRotating, api.MemberPhaseCleanOut, api.MemberPhaseRotateStart:
|
||||
if len(status.Plan) == 0 {
|
||||
log.Error().Msgf("No plan but member is in phase %s - marking as failed", m.Phase)
|
||||
m.Phase = api.MemberPhaseFailed
|
||||
|
|
|
@ -248,7 +248,7 @@ func (r *Resources) InspectPods(ctx context.Context, cachedStatus inspector.Insp
|
|||
case api.MemberPhaseNone:
|
||||
// Do nothing
|
||||
log.Debug().Str("pod-name", podName).Msg("PodPhase is None, waiting for the pod to be recreated")
|
||||
case api.MemberPhaseShuttingDown, api.MemberPhaseUpgrading, api.MemberPhaseFailed:
|
||||
case api.MemberPhaseShuttingDown, api.MemberPhaseUpgrading, api.MemberPhaseFailed, api.MemberPhaseRotateStart:
|
||||
// Shutdown was intended, so not need to do anything here.
|
||||
// Just mark terminated
|
||||
wasTerminated := m.Conditions.IsTrue(api.ConditionTypeTerminated)
|
||||
|
|
Loading…
Reference in a new issue