-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Enable leader election in ws-manager-mk2 #18511
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
Conversation
/gh run recreate-vm=true Comment triggered a workflow runStarted workflow run: 5858026990
|
/gh run recreate-vm=true Comment triggered a workflow runStarted workflow run: 5858423705
|
1a95c59
to
765d4cc
Compare
/gh run recreate-vm=true Comment triggered a workflow runStarted workflow run: 5870929595
|
/gh run recreate-vm=true Comment triggered a workflow runStarted workflow run: 5871222912
|
/gh run recreate-vm=true Comment triggered a workflow runStarted workflow run: 5875956095
|
/gh run recreate-vm=true Comment triggered a workflow runStarted workflow run: 5877356816
|
/gh run recreate-vm=true Comment triggered a workflow runStarted workflow run: 5878388959
|
/gh run recreate-vm=true Comment triggered a workflow runStarted workflow run: 5879474569
|
b58232d
to
04c44f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, some questions
Also coming back to a question on the previous PR, how do we ensure workspaces don't timeout when a pod gets elected as leader after it had been running for a while?
We use the controller's startup time as the workspace's last activity in
return &w.ManagerStartedAt |
We could change ManagerStartedAt
to e.g. ControllerActiveAt
, and set this once a pod becomes elected?
This is similar to when we restart ws-manager-mk2 or we deploy a new version. The worst-case scenario is workspaces will run for more time than it should due to the lost state. |
I don't think it is though, on a restart the |
components/ws-manager-mk2/main.go
Outdated
go func() { | ||
for { | ||
<-mgr.Elected() | ||
activity.ManagerStartedAt = time.Now() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is though, on a restart the ManagerStartedAt field also gets reset, but not on leader election. Unless I'm missing something I do believe that pods will timeout after an old standby pod gets elected
Here
Description
Replaces #18419
Description
Replaces #18419
This introduces an edge case when the maintenance mode is triggered, and we deploy a new version. The standby replica never gets the configmap update. We change the strategy to have one or more stand-by replicas waiting to be the leader and all the replicas watch the configuration configmap.
Summary generated by Copilot
🤖 Generated by Copilot at ae677ea
This pull request adds leader election for the
ws-manager-mk2
component using the Kubernetes API and aLease
object. It removes the--leader-elect
argument from the component and its deployment files, as it is no longer needed. It also reorders some imports in thesample-workspace
command.Preview status
Gitpod was successfully deployed to your preview environment.
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
. If enabled,with-preview
andwith-large-vm
will be enabled./hold