Skip to content

Sanity check GC revision timeout#4245

Merged
knative-prow-robot merged 1 commit intoknative:masterfrom
greghaynes:sanity-check-gc-timeout
Jun 7, 2019
Merged

Sanity check GC revision timeout#4245
knative-prow-robot merged 1 commit intoknative:masterfrom
greghaynes:sanity-check-gc-timeout

Conversation

@greghaynes
Copy link
Copy Markdown
Contributor

If revision timeout is set below route resync period our gc controller
will GC revisions before they are able to receive a heartbeat.

Fixes: #4234

Release Note

NONE

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 4, 2019
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 4, 2019
Copy link
Copy Markdown
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@greghaynes: 1 warning.

Details

In response to this:

If revision timeout is set below route resync period our gc controller
will GC revisions before they are able to receive a heartbeat.

Fixes: #4234

Release Note

NONE

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Comment thread pkg/gc/config.go Outdated
@knative-prow-robot knative-prow-robot added area/API API objects and controllers area/networking labels Jun 4, 2019
@greghaynes greghaynes force-pushed the sanity-check-gc-timeout branch from 3518665 to 21c7e2b Compare June 4, 2019 17:30
@greghaynes greghaynes force-pushed the sanity-check-gc-timeout branch 2 times, most recently from 85f6868 to e51f97d Compare June 4, 2019 17:37
Comment thread pkg/gc/config.go Outdated
func SanityCheckedConfigMapLoader(minRevisionTimeout time.Duration) func(configMap *corev1.ConfigMap) (*Config, error) {
return func(configMap *corev1.ConfigMap) (*Config, error) {
cfg, err := NewConfigFromConfigMap(configMap)
if cfg != nil && cfg.StaleRevisionTimeout < minRevisionTimeout {
Copy link
Copy Markdown
Contributor

@nak3 nak3 Jun 5, 2019

Choose a reason for hiding this comment

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

We do not need to check cfg.StaleRevisionTimeout - cfg.StaleRevisionLastpinnedDebounce < minRevisionTimeout?

It looks like lastPinned annotation is skipped to update until StaleRevisionLastpinnedDebounce here:

// Enforce a delay before performing an update on lastPinned to avoid excess churn.
if lastPin.Add(lpDebounce).After(c.clock.Now()) {
return nil
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like this comment already warns about it.

# This minus lastpinned-debounce be longer than the controller resync period (10 hours)
stale-revision-timeout: "15h"

@nak3
Copy link
Copy Markdown
Contributor

nak3 commented Jun 5, 2019

I am prefer to this PR rather than mine (#4235). But I have one concern.
We will not able to test GC easily once this PR was merged(?) Whenever we would like to test GC and observe the behavior, we have to wait for 10 hours every time 😰

Comment thread pkg/gc/config.go Outdated
return &c, nil
}

// SanityCheckedConfigMapLoader provides sanity checking for minRevisionTimeout and returns an error if this value is invalid
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we just change NewConfigFromConfigMap to add this validation? This is generally where we do this sort of validation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The issue is ResyncPeriod is a variable and we need to supply a constructor to the ConfigStore which is of type func(*k8s.io/api/core/v1.ConfigMap) (*Config , error). The alternative way I can see Is to make NewConfigFromConfigMap a method on a struct which stores the ResyncPeriod.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am curious why NewConfigFromConfigMap needs this signature if the return value of this function does? Can't this just be curried? e.g. time.Duration -> *corev1.ConfigMap -> (*Config, error)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Curry made. :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can't wait for the haskell rewrite :)

@greghaynes
Copy link
Copy Markdown
Contributor Author

@nak3 #3910 should help with your testing issue - we should be able to adjust the resync period of that reconciler in that case.

@greghaynes greghaynes force-pushed the sanity-check-gc-timeout branch 3 times, most recently from 3734048 to b5ee977 Compare June 5, 2019 21:01
@greghaynes
Copy link
Copy Markdown
Contributor Author

/test pull-knative-serving-upgrade-tests

Comment thread pkg/gc/config.go Outdated
Comment thread pkg/gc/config.go Outdated
Comment thread pkg/gc/config.go Outdated
If revision timeout is set below route resync period our gc controller
will GC revisions before they are able to receive a heartbeat.

Fixes: knative#4234
@greghaynes greghaynes force-pushed the sanity-check-gc-timeout branch from b5ee977 to 4ab8a18 Compare June 6, 2019 17:30
@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 6, 2019
Copy link
Copy Markdown
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 7, 2019
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: greghaynes, mattmoor

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 7, 2019
@knative-prow-robot knative-prow-robot merged commit 73c274b into knative:master Jun 7, 2019
tcnghia pushed a commit to tcnghia/serving that referenced this pull request Mar 11, 2020
tcnghia pushed a commit to tcnghia/serving that referenced this pull request Mar 12, 2020
knative-prow-robot pushed a commit that referenced this pull request Mar 13, 2020
* Add nak3 to networking approvers.

From ROLES.md

1/ Reviewer of the codebase for at least 3 months.

#4245 is 9 months old.

2/ Primary reviewer for at least 10 substantial PRs to the codebase.

[4
XLs](https://github.com/knative/serving/pulls?q=is%3Apr++is%3Aclosed+reviewed-by%3Anak3+label%3Asize%2FXL+)
[13
Ls](https://github.com/knative/serving/pulls?q=is%3Apr++is%3Aclosed+reviewed-by%3Anak3+label%3Asize%2FL)

3/ [56 Reviewed
PRs](https://github.com/knative/serving/pulls?q=is%3Apr++is%3Aclosed+reviewed-by%3Anak3+)

4/ [116 Merged PRs](
https://github.com/knative/serving/pulls?q=is%3Apr+is%3Aclosed+author%3Anak3)

4/ Nominated by nghia@ with no objections from other leads

* Sort the lines.

* Sort lines alphabetically

* Remove merge conflict markers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/API API objects and controllers area/networking cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vanishing revisions even when they are still referred from route

6 participants