Skip to content
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

CLM could wait forever for node decommissioning #533

Open
AlexanderYastrebov opened this issue Nov 15, 2021 · 1 comment
Open

CLM could wait forever for node decommissioning #533

AlexanderYastrebov opened this issue Nov 15, 2021 · 1 comment

Comments

@AlexanderYastrebov
Copy link
Member

AlexanderYastrebov commented Nov 15, 2021

CLM could wait forever for node decommissioning (if there is some kind of problem)

func (c *CLCUpdateStrategy) PrepareForRemoval(ctx context.Context, nodePoolDesc *api.NodePool) error {
c.logger.Infof("Preparing for removal of node pool '%s'", nodePoolDesc.Name)
for {
nodePool, err := c.nodePoolManager.GetPool(ctx, nodePoolDesc)
if err != nil {
return err
}
err = c.nodePoolManager.MarkPoolForDecommission(nodePoolDesc)
if err != nil {
return err
}
for _, node := range nodePool.Nodes {
err := c.nodePoolManager.DisableReplacementNodeProvisioning(ctx, node)
if err != nil {
return err
}
}
nodes, err := c.markNodes(ctx, nodePool, func(_ *Node) bool {
return true
})
if err != nil {
return err
}
if nodes == 0 {
return nil
}
c.logger.WithField("node-pool", nodePoolDesc.Name).Infof("Waiting for decommissioning of the nodes (%d left)", nodes)
// wait for CLC to finish removing the nodes
select {
case <-ctx.Done():
return ctx.Err()
case <-time.After(c.pollingInterval):
}
}
}

func (c *CLCUpdateStrategy) doUpdate(ctx context.Context, nodePoolDesc *api.NodePool) error {
for {
if err := ctx.Err(); err != nil {
return err
}
nodePool, err := c.nodePoolManager.GetPool(ctx, nodePoolDesc)
if err != nil {
return err
}
oldNodes, err := c.markNodes(ctx, nodePool, func(node *Node) bool {
return node.Generation != nodePool.Generation
})
if err != nil {
return err
}
if oldNodes == 0 {
return nil
}
c.logger.WithField("node-pool", nodePoolDesc.Name).Infof("Waiting for decommissioning of old nodes (%d left)", oldNodes)
// wait for CLC to finish rolling the nodes
select {
case <-ctx.Done():
return ctx.Err()
case <-time.After(c.pollingInterval):
}
}
}

and therefore does not update other node pools.

See also #154

@AlexanderYastrebov AlexanderYastrebov changed the title CLM could wait forever for old node decommissioning CLM could wait forever for node decommissioning Nov 16, 2021
@AlexanderYastrebov
Copy link
Member Author

Some ideas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant