Skip to content

Bug fix/scale up error #275

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 5 commits into from
Oct 26, 2018
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Don't updated the agency if not required. This may overwrites changes…
… made by the user.
  • Loading branch information
lamai93 committed Oct 23, 2018
commit 18cff92b44d10e93ffc22f22a9fb6dfb6b741e7c
16 changes: 12 additions & 4 deletions pkg/deployment/cluster_scaling_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,19 @@ func (ci *clusterScalingIntegration) updateClusterServerCount(ctx context.Contex
}
coordinatorCount := spec.Coordinators.GetCount()
dbserverCount := spec.DBServers.GetCount()
if err := arangod.SetNumberOfServers(ctx, c.Connection(), coordinatorCount, dbserverCount); err != nil {
if expectSuccess {
log.Debug().Err(err).Msg("Failed to set number of servers")

ci.lastNumberOfServers.mutex.Lock()
lastNumberOfServers := ci.lastNumberOfServers.NumberOfServers
ci.lastNumberOfServers.mutex.Unlock()

// This is to prevent unneseccary updates that may override some values written by the WebUI (in the case of a update loop)
if coordinatorCount != lastNumberOfServers.GetCoordinators() && dbserverCount != lastNumberOfServers.GetDBServers() {
if err := arangod.SetNumberOfServers(ctx, c.Connection(), coordinatorCount, dbserverCount); err != nil {
if expectSuccess {
log.Debug().Err(err).Msg("Failed to set number of servers")
}
return false, maskAny(err)
}
return false, maskAny(err)
}

// Success, now update internal state
Expand Down