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

Add multiple update selectors #383

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wilwell
Copy link
Contributor

@wilwell wilwell commented Nov 4, 2024

No description provided.

@wilwell wilwell force-pushed the wilwell/multiple-update-selectors branch from eae94b0 to 3be85ec Compare November 5, 2024 12:02
@wilwell wilwell force-pushed the wilwell/multiple-update-selectors branch from 3be85ec to e9c2100 Compare November 5, 2024 12:08
return ytv1.UpdateFlowFull
}
return ytv1.UpdateFlowStateless
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see this PR is raw yet, but just want to emphasize some things.
Obviously to add updateSelectors field is not challenging part of the issue, but to correctly update each component (or combination of components) selected by it, so all required pre and post steps were executed.

Currently we have some flows for component updates:
master

  • PossibilityCheck
  • WaitingForSafeModeEnabled
  • WaitingForSnapshots
  • WaitingForPodsRemoval
  • WaitingForPodsCreation
  • WaitingForMasterExitReadOnly
  • WaitingForSafeModeDisabled

tablet nodes

  • PossibilityCheck
  • WaitingForTabletCellsSaving
  • WaitingForTabletCellsRemovingStart
  • WaitingForTabletCellsRemoved
  • WaitingForPodsRemoval
  • WaitingForPodsCreation
  • WaitingForTabletCellsRecovery

stateless

  • WaitingForPodsRemoval
  • WaitingForPodsCreation
  • WaitingForOpArchiveUpdatingPrepare
  • WaitingForOpArchiveUpdate
  • WaitingForQTStateUpdatingPrepare
  • WaitingForQTStateUpdate

everything

  • PossibilityCheck
  • WaitingForSafeModeEnabled
  • WaitingForTabletCellsSaving
  • WaitingForTabletCellsRemovingStart
  • WaitingForTabletCellsRemoved
  • WaitingForSnapshots
  • WaitingForPodsRemoval
  • WaitingForPodsCreation
  • WaitingForMasterExitReadOnly
  • WaitingForTabletCellsRecovery
  • WaitingForOpArchiveUpdatingPrepare
  • WaitingForOpArchiveUpdate
  • WaitingForQTStateUpdatingPrepare
  • WaitingForQTStateUpdate
  • WaitingForSafeModeDisabled

As you see everything includes (basically copy-pastes) parts master,tnds,stateless flows.
And
if you want implement UpdateSelectors = {component=scheduler} you have to add flow for scheduler with WaitingForOpArchiveUpdatingPrepare/WaitingForOpArchiveUpdate/WaitingForQTStateUpdatingPrepare/WaitingForQTStateUpdate
if you want to implement UpdateSelectors = {component=qt} you have to add flow with WaitingForQTStateUpdatingPrepare/WaitingForQTStateUpdate
and so on.
So this predefined flows code is a dead end way if we want to achieve update granularity we want. So we should somehow concatenate workflows for particular components.

And i think the most simplest way here is to do this change with introducing Linear update (#115).
I assume the flow in the code should look something like that:

# update flow
if discoveryType in toUpdateList: // updatable by selector and require update
	remove/create discovery pods

if httpProxy in updateList:
       remove/create hp pods
// tcp proxy
// rpc proxy
// data nodes
// exec nodes
// master cache

if tabletNodes in updateList:
     - PossibilityCheck
     - WaitingForTabletCellsSaving
     - WaitingForTabletCellsRemovingStart
     - WaitingForTabletCellsRemoved
     - WaitingForPodsRemoval
     - WaitingForPodsCreation
     - WaitingForTabletCellsRecovery

// ui
// ca
// yqla (but soon also will have pre-update jobs)
// sch with its flow
// qt with its flow
// qa with its flow
// strawberry
// master with its flow (updating in the end, because it should never be newer than other components)

Initializing flow is the same, but master in the beginning.

So basically I think we need here to:

  1. resolve updateSelectors in a list of allowed components, match it with all component's statuses so we have a list of components we plan to update, sort it according to predefined order, choose first one we will update in this reconcillation loop, put it in UpdateStatus.Components
  2. check current UpdateStatus.State and UpdateStatus.Conditions and either call components.sync and requeue or set next State of this component flow and requeue.

I understand it is a bit vague overview, but maybe it helps.

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