Skip to content

Skip update when endpoints resource version equal#19775

Merged
istio-testing merged 1 commit intoistio:masterfrom
hzxuzhonghu:endpoints-update
Dec 28, 2019
Merged

Skip update when endpoints resource version equal#19775
istio-testing merged 1 commit intoistio:masterfrom
hzxuzhonghu:endpoints-update

Conversation

@hzxuzhonghu
Copy link
Copy Markdown
Member

@hzxuzhonghu hzxuzhonghu commented Dec 24, 2019

No description provided.

@hzxuzhonghu hzxuzhonghu requested a review from a team as a code owner December 24, 2019 10:24
@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Dec 24, 2019
@istio-testing istio-testing added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 24, 2019
curE := cur.(*v1.Endpoints)

if !compareEndpoints(oldE, curE) {
if curE.ResourceVersion != oldE.ResourceVersion || !compareEndpoints(oldE, curE) {
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.

nit: can we move this condition also to the top of compareEndpoints before subset len check and add a test case for it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

no, they are different stuff.

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.

is there ever any time the resource version is the same but the endpoints are different?

Is there ever a time when compareEndpoints gives a different response than the resource version check?

Why is update func even called if resource version changes?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The version will not change when resynced

is there ever any time the resource version is the same but the endpoints are different?

No

Is there ever a time when compareEndpoints gives a different response than the resource version check?

The compareEndpoints is a little costly, and it is definitely a subset of version compare

Why is update func even called if resource version changes?

I think you mean resource version not change, it is the k8s mechanism, to make sure client do not miss an object update as k8s is eventual consistent, and event may get lost for many resons.

@hzxuzhonghu
Copy link
Copy Markdown
Member Author

ping @howardjohn

@istio-testing istio-testing merged commit a42d9e7 into istio:master Dec 28, 2019
howardjohn added a commit that referenced this pull request Dec 28, 2019
@hzxuzhonghu hzxuzhonghu deleted the endpoints-update branch December 30, 2019 01:31
istio-testing pushed a commit that referenced this pull request Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/networking cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants