Skip to content

Conversation

@Arvindthiru
Copy link
Contributor

@Arvindthiru Arvindthiru commented Dec 19, 2024

Description of your changes

Fixes #

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Special notes for your reviewer

Added uncached reader for eviction controller to ensure PDB can be read directly from API server if it exists to avoid cache miss

@Arvindthiru
Copy link
Contributor Author

Addressed comment from #959 (comment)

@Arvindthiru Arvindthiru marked this pull request as ready for review December 31, 2024 01:40
@Arvindthiru Arvindthiru force-pushed the rolloutEvictionE2E branch 2 times, most recently from 70f5a4f to bbb380e Compare January 3, 2025 22:34
@Arvindthiru Arvindthiru force-pushed the rolloutEvictionE2E branch 2 times, most recently from e104b7d to 5abf54a Compare January 7, 2025 20:48
}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi Arvind! Just a nit here: since we have switched to uncached reader here; there might no longer be any need to check for DB existence here any more. (Successful creation should guarantee successful DB reads)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm thinking of leaving it there, to ensure the E2E test itself is not the cause for any future flaky behavior

Copy link
Contributor

Choose a reason for hiding this comment

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

I concur with Chen, this is a guaranteed behavior by k8s, no need to check regardless.

Copy link
Contributor

@michaelawyu michaelawyu left a comment

Choose a reason for hiding this comment

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

Added some comments, PTAL.

@michaelawyu
Copy link
Contributor

A note for the uncached reader change: when we have more time on hand it might be interesting to explore a bit why the DB objects are being watched and cached by the clients.

type Reconciler struct {
client.Client
// UncachedReader is only used to read disruption budget objects directly from the API server to ensure we can enforce the disruption budget for eviction.
UncachedReader client.Reader
Copy link
Contributor

Choose a reason for hiding this comment

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

i am not sure why we need this

Copy link
Contributor Author

@Arvindthiru Arvindthiru Jan 15, 2025

Choose a reason for hiding this comment

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

I noticed flaky behavior when I was writing E2Es where I create an PDB followed by an eviction, but the eviction would successfully execute saying no PDB exists. After ruling all possible E2E related flaky behavior scenarios @michaelawyu helped me figure out it's a cache miss hence the uncached reader to ensure disruption budget is found by the eviction controller by reading from API server when reconciling an eviction object

}
Expect(hubClient.Create(ctx, &crpdb)).To(Succeed(), "Failed to create CRP Disruption Budget %s", crpName)

ensureCRPDisruptionBudgetExists := ensureCRPDisruptionBudgetExists(crpName)
Copy link
Contributor

Choose a reason for hiding this comment

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

I concur with Chen, this is a guaranteed behavior by k8s, no need to check regardless.

@ryanzhang-oss ryanzhang-oss merged commit 04da89b into Azure:main Jan 17, 2025
12 checks passed
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.

3 participants