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

pilot: fix bug in endpoint updates #50746

Merged
merged 2 commits into from May 14, 2024

Conversation

howardjohn
Copy link
Member

TBH I am not sure how this isn't a bigger issue. Currently if an
endpoint changes we are not triggering a push at all. In this case, it
was port number, but could be others.

Implementation is bad right now, but if this is desired we can swap
for an optimized Equals implementation

@howardjohn howardjohn added the release-notes-none Indicates a PR that does not require release notes. label Apr 29, 2024
@istio-testing
Copy link
Collaborator

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@istio-testing istio-testing added do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 29, 2024
@howardjohn
Copy link
Member Author

/test all

@howardjohn
Copy link
Member Author

/test all

@howardjohn
Copy link
Member Author

@hzxuzhonghu @ramaraochavali wdyt? if desired ill write an optimized Equals function

@ramaraochavali
Copy link
Contributor

Yes. I agree we should compare. I think all of this used to be in SendUnhealthyEndpoints feature flag - later we have refactored. Only checking health status does not seem correct.

TBH I am not sure how this isn't a bigger issue. Currently if an
endpoint changes we are not triggering a push at all. In this case, it
was port number, but could be others.

Implementation is *bad* right now, but if this is desired we can swap
for an optimized Equals implementation
@istio-testing istio-testing 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 May 13, 2024
Comment on lines +245 to +251
// Endpoint update is triggered since its a brand new service
if ev := fx.WaitOrFail(t, "xds full"); !ev.Reason.Has(model.EndpointUpdate) {
t.Fatalf("xds push reason does not contain %v: %v", model.EndpointUpdate, ev)
}
// headless service update must trigger nds push, so we trigger a full push.
ev := fx.WaitOrFail(t, "xds full")
if !ev.Reason.Has(model.HeadlessEndpointUpdate) {
t.Fatalf("xds push reason does not contain %v", model.HeadlessEndpointUpdate)
if ev := fx.WaitOrFail(t, "xds full"); !ev.Reason.Has(model.HeadlessEndpointUpdate) {
t.Fatalf("xds push reason does not contain %v: %v", model.HeadlessEndpointUpdate, ev)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is NOT a production impact change. Only test.

Now our test properly mimics how the real istiod does pushes; in the real world we are triggering double pushes.

Note with debounce its mostly moot, though

@howardjohn howardjohn added cherrypick/release-1.21 Set this label on a PR to auto-merge it to the release-1.21 branch cherrypick/release-1.22 Set this label on a PR to auto-merge it to the release-1.22 branch labels May 13, 2024
@howardjohn howardjohn marked this pull request as ready for review May 13, 2024 19:53
@howardjohn howardjohn requested a review from a team as a code owner May 13, 2024 19:53
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label May 13, 2024
@istio-testing istio-testing merged commit 53a49fe into istio:master May 14, 2024
28 checks passed
@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new pull request created: #51025

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: #50746 failed to apply on top of branch "release-1.21":

Applying: pilot: fix bug in endpoint updates
Using index info to reconstruct a base tree...
M	pilot/pkg/model/endpointshards.go
M	pilot/pkg/serviceregistry/serviceregistry_test.go
Falling back to patching base and 3-way merge...
Auto-merging pilot/pkg/serviceregistry/serviceregistry_test.go
Auto-merging pilot/pkg/model/endpointshards.go
Applying: Prod impl
Using index info to reconstruct a base tree...
M	pilot/pkg/model/endpointshards.go
M	pilot/pkg/model/service.go
M	pilot/pkg/serviceregistry/serviceregistry_test.go
Falling back to patching base and 3-way merge...
Auto-merging pilot/pkg/serviceregistry/serviceregistry_test.go
Auto-merging pilot/pkg/model/service.go
Auto-merging pilot/pkg/model/endpointshards.go
CONFLICT (content): Merge conflict in pilot/pkg/model/endpointshards.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 Prod impl
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

@istio-testing
Copy link
Collaborator

In response to a cherrypick label: new issue created for failed cherrypick: #51026

howardjohn added a commit to howardjohn/istio that referenced this pull request May 14, 2024
* pilot: fix bug in endpoint updates

TBH I am not sure how this isn't a bigger issue. Currently if an
endpoint changes we are not triggering a push at all. In this case, it
was port number, but could be others.

Implementation is *bad* right now, but if this is desired we can swap
for an optimized Equals implementation

* Prod impl

(cherry picked from commit 53a49fe)
istio-testing pushed a commit that referenced this pull request May 15, 2024
* pilot: fix bug in endpoint updates

TBH I am not sure how this isn't a bigger issue. Currently if an
endpoint changes we are not triggering a push at all. In this case, it
was port number, but could be others.

Implementation is *bad* right now, but if this is desired we can swap
for an optimized Equals implementation

* Prod impl

(cherry picked from commit 53a49fe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick/release-1.21 Set this label on a PR to auto-merge it to the release-1.21 branch cherrypick/release-1.22 Set this label on a PR to auto-merge it to the release-1.22 branch release-notes-none Indicates a PR that does not require release notes. 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.

None yet

3 participants