Skip to content
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
32 changes: 23 additions & 9 deletions internal/cluster/redkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -1764,18 +1764,32 @@ func (rc *RedKeyCluster) stabilizeOpenSlots(ctx context.Context, counter map[int
}

for _, clusterNode := range clusterNodes {
if clusterNode.ID == node.ID && len(clusterNode.Migrating) > 0 {
for slot := range clusterNode.Migrating {
if count, ok := counter[slot]; ok {
if count+1 > threshold {
slotsToStabilize = append(slotsToStabilize, MigratingSlot{Slot: slot, From: clusterNode.ID, To: clusterNode.Migrating[slot]})
if clusterNode.ID == node.ID {
if len(clusterNode.Migrating) > 0 {
for slot := range clusterNode.Migrating {
if count, ok := counter[slot]; ok {
if count+1 > threshold {
slotsToStabilize = append(slotsToStabilize, MigratingSlot{Slot: slot, From: clusterNode.ID, To: clusterNode.Migrating[slot]})
} else {
updatedCounter[slot] = count + 1
}
} else {
updatedCounter[slot] = count + 1
updatedCounter[slot] = 1
}
} else {
updatedCounter[slot] = 1
}
}
} else if len(clusterNode.Importing) > 0 {
for slot := range clusterNode.Importing {
if count, ok := counter[slot]; ok {
if count+1 > threshold {
slotsToStabilize = append(slotsToStabilize, MigratingSlot{Slot: slot, From: clusterNode.Importing[slot], To: clusterNode.ID})
} else {
updatedCounter[slot] = count + 1
}
} else {
updatedCounter[slot] = 1
}
}
}
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions internal/reconciler/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ func (r *RedKeyClusterReconciler) reconcileScalingDownStatus() error {

// reconcileUpgradingStatus reconciles the RedKey cluster when it is in the Upgrading status.
func (r *RedKeyClusterReconciler) reconcileUpgradingStatus() error {
// Check if the cluster needs to be upgraded
if r.cluster.IsUpgraded() {
return nil
}

// Upgrade the cluster
if err := r.cluster.Upgrade(true); err != nil {
Expand Down
Loading