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

change priorty of reboot queue cancel #715

Merged
merged 3 commits into from
Apr 1, 2024
Merged

change priorty of reboot queue cancel #715

merged 3 commits into from
Apr 1, 2024

Conversation

YZ775
Copy link
Contributor

@YZ775 YZ775 commented Mar 26, 2024

In the current CKE, the dequeue operation of cancelled reboot queue entry has lower priority than other operations like drain, reboot, ...etc.
This implementation causes the dequeue operation not to work correctly when we cancel an entry whose node is under operation.
This PR solves the problem by following changes.

  • separating dequeue operation between cancelled entry and completed entry
  • set dequeue operation of cancelled entry higher

@YZ775 YZ775 requested a review from masa213f March 26, 2024 06:37
@YZ775 YZ775 marked this pull request as ready for review March 26, 2024 06:46
@@ -346,13 +346,15 @@ func (c Controller) runOnce(ctx context.Context, leaderKey string, tick <-chan t
newlyDrained := op.ChooseDrainedNodes(cluster, apiServers, rqEntries)
drainCompleted, drainTimedout, _ := op.CheckDrainCompletion(ctx, inf, nf.HealthyAPIServer(), cluster, rqEntries)
rebootDequeued := op.CheckRebootDequeue(ctx, cluster, rqEntries)
RebootCancelled := op.CheckRebootCancelled(ctx, cluster, rqEntries)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use lowercase.

Suggested change
RebootCancelled := op.CheckRebootCancelled(ctx, cluster, rqEntries)
rebootCancelled := op.CheckRebootCancelled(ctx, cluster, rqEntries)

@@ -883,6 +884,11 @@ func rebootOps(c *cke.Cluster, constraints *cke.Constraints, rebootArgs DecideOp
return nil, false
}

if len(rebootArgs.RebootCancelled) > 0 {
phaseReboot = true
ops = append(ops, op.RebootDequeueOp(rebootArgs.RebootCancelled))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to change the display name of the op to reboot-cancel.
Is it possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can change the display name by duplicating RebootDequeueOp and changing Name() method.
The logic of Op is identical. so I created RebootCancelOp which has embedded RebootDequeueOp and override Name() method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@YZ775 YZ775 requested a review from masa213f April 1, 2024 05:15
@@ -523,6 +523,25 @@ func (c rebootDequeueCommand) Command() cke.Command {
}
}

//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to write?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//

//

There are // between code block of Op, so I added it same as other Op.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see.

@@ -883,6 +884,11 @@ func rebootOps(c *cke.Cluster, constraints *cke.Constraints, rebootArgs DecideOp
return nil, false
}

if len(rebootArgs.RebootCancelled) > 0 {
phaseReboot = true
ops = append(ops, op.RebootDequeueOp(rebootArgs.RebootCancelled))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@YZ775 YZ775 requested a review from masa213f April 1, 2024 07:48
Copy link
Contributor

@masa213f masa213f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@YZ775 YZ775 merged commit e50e9fd into main Apr 1, 2024
7 checks passed
@YZ775 YZ775 deleted the change-cancel branch April 1, 2024 08:03
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

Successfully merging this pull request may close these issues.

2 participants