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

Finish implementing deferred input rollouts #148

Merged
merged 7 commits into from
Jun 17, 2024
Merged

Finish implementing deferred input rollouts #148

merged 7 commits into from
Jun 17, 2024

Conversation

jveski
Copy link
Collaborator

@jveski jveski commented Jun 13, 2024

Replaces the existing rollout controller with a new implementation that implements slightly nicer semantics (see reference docs for details).

@jveski jveski enabled auto-merge (squash) June 13, 2024 20:32
@@ -91,6 +92,10 @@ type Synthesis struct {

// InputRevisions contains the versions of the input resources that were used for this synthesis.
InputRevisions []InputRevisions `json:"inputRevisions,omitempty"`

// Deferred is true when this synthesis was the result of a deferred rollout,
// caused by a synthesizer of (deferred) input change.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: This phrasing is a bit unclear

@@ -64,7 +64,7 @@ func runController() error {
flag.StringVar(&synconf.PodServiceAccount, "synthesizer-pod-service-account", "", "Service account name to be assigned to synthesizer Pods.")
flag.BoolVar(&debugLogging, "debug", true, "Enable debug logging")
flag.DurationVar(&watchdogThres, "watchdog-threshold", time.Minute*5, "How long before the watchdog considers a mid-transition resource to be stuck")
flag.DurationVar(&rolloutCooldown, "rollout-cooldown", time.Second*2, "How long before an update to related resource (synthesizer, bindings, etc.) will trigger a composition's re-synthesis")
flag.DurationVar(&rolloutCooldown, "rollout-cooldown", time.Minute, "How long before an update to a related resource (synthesizer, bindings, etc.) will trigger a second composition's re-synthesis")
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the "second" here means to imply that it only affects compositions that have been synthesized at least once?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right- the first synthesis will always be non-deferred, essentially because the composition's generation will transition from zero to one.


- All effected compositions are marked as pending resynthesis immediately
- A maximum of one composition pending resynthesis can begin resynthesis per cooldown period
- The next pending composition can start after the cooldown period has expired AND all resynthesis has completed or been retried at least once
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd assume we can also move on to the next one if there's a terminal error? I'll probably find this out when I read the code 😄

}

oldComp, ok := ue.ObjectOld.(*apiv1.Composition)
if !ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this ever happen?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The previous resource isn't sent from the server in watch events, so (if memory serves 😬 ) it's populated with the last version in the informer cache when the new version is received. So it can be nil if the process has crashed.

@jveski jveski merged commit 3a0e7e2 into main Jun 17, 2024
12 checks passed
@jveski jveski deleted the rollouts branch January 31, 2025 17:41
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