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

Allow follower to start with empty initial resource list #6295

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

tsaarni
Copy link
Member

@tsaarni tsaarni commented Mar 20, 2024

This change fixes a bug that caused follower instance of Contour not reach the ready state when started under following condition:

  1. Namespace(s) configured with --watched-namespaces do not contain any resources.
  2. Resources that informer sends during initial synchronization are not triggering DAG rebuild because Contour decides those resources were not relevant.

As result, XDS server is not started at all and those Contour instances will not reach ready state.

Note that leader instance still worked correctly even when the conditions were true. This is because leader election triggers "fake" DAG update and therefore the same code path gets executed as if informer delivered some relevant resources that necessitated DAG rebuild - and therefore XDS server start.

The change adds explicit checks to cover the conditions (1) and (2).

Background:

Prior to #5672 we had hardcoded timer that triggered start of XDS server regardless of DAG rebuild status - even if it was not built at all. Starting from 1.27.0 we wait until all relevant resources have been received from the API server and then build the initial DAG. Back then it was not considered that there might not be initial resources and no initial DAG to build at all.

Fixes #6291

@tsaarni tsaarni requested a review from a team as a code owner March 20, 2024 09:59
@tsaarni tsaarni requested review from skriss and sunjayBhatia and removed request for a team March 20, 2024 09:59
@sunjayBhatia sunjayBhatia requested review from a team, rajatvig and davinci26 and removed request for a team March 20, 2024 09:59
Signed-off-by: Tero Saarni <tero.saarni@est.tech>
@tsaarni tsaarni force-pushed the start-with-empty-initial-list branch from 497ef40 to 81b2a2d Compare March 20, 2024 10:00
@tsaarni tsaarni added the release-note/small A small change that needs one line of explanation in the release notes. label Mar 20, 2024
Copy link

codecov bot commented Mar 20, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 81.55%. Comparing base (5f1b981) to head (81b2a2d).
Report is 11 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6295      +/-   ##
==========================================
- Coverage   81.56%   81.55%   -0.01%     
==========================================
  Files         133      133              
  Lines       15801    15805       +4     
==========================================
+ Hits        12888    12890       +2     
- Misses       2617     2619       +2     
  Partials      296      296              
Files Coverage Δ
internal/contour/handler.go 77.06% <50.00%> (-1.04%) ⬇️

@izturn
Copy link
Member

izturn commented Mar 21, 2024

LGTM

Copy link

github-actions bot commented Apr 8, 2024

The Contour project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 14d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, the PR is closed

You can:

  • Ensure your PR is passing all CI checks. PRs that are fully green are more likely to be reviewed. If you are having trouble with CI checks, reach out to the #contour channel in the Kubernetes Slack workspace.
  • Mark this PR as fresh by commenting or pushing a commit
  • Close this PR
  • Offer to help out with triage

Please send feedback to the #contour channel in the Kubernetes Slack

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 8, 2024
@sunjayBhatia sunjayBhatia removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 8, 2024
Copy link
Member

@skriss skriss left a comment

Choose a reason for hiding this comment

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

👍 LGTM, thanks for the fix @tsaarni!

@skriss skriss merged commit d72f4c6 into projectcontour:main Apr 10, 2024
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/small A small change that needs one line of explanation in the release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contour does not get ready when routing config is not present
4 participants