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

Add check for endpoint counts equal #1836

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

sawsa307
Copy link
Contributor

@sawsa307 sawsa307 commented Oct 13, 2022

Add check to make sure the total number of endpoints from EndpointDataequals to the number of endpoints from endpointPodMap. If not, the syncer will enter the error state.
EndpointData may contain duplicated endpoint, but endpointPodMap removes the duplicated endpoints, and dupCount stores the number of duplicated it removed. We compare the endpoint counts with duplicates.
Change the function definition of NetworkEndpointsCalculator.CalculateEndpoints() to return another variable that represents the count of duplicated endpoints.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 13, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @sawsa307. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 13, 2022
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 13, 2022
@sawsa307
Copy link
Contributor Author

/assign @swetharepakula

@sawsa307 sawsa307 changed the title Ep counts differ Added equality check for endpoint counts Oct 13, 2022
@aojea
Copy link
Member

aojea commented Oct 14, 2022

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 14, 2022
@aojea
Copy link
Member

aojea commented Oct 19, 2022

the syncer will enter the error state.

What does the syncer does in error state? Because it seems it just reset the value , so we just flip the state, or am I missing something?

@sawsa307
Copy link
Contributor Author

the syncer will enter the error state.

What does the syncer does in error state? Because it seems it just reset the value , so we just flip the state, or am I missing something?

When the syncer is in error state, we will do degraded mode procedures, which we will redo endpoint calculations and send attach/detach calls with correct endpoint information.

@sawsa307 sawsa307 changed the title Added equality check for endpoint counts Added check for endpoint counts Oct 20, 2022
@sawsa307 sawsa307 changed the title Added check for endpoint counts Add check for endpoint counts Oct 20, 2022
@sawsa307 sawsa307 force-pushed the ep-counts-differ branch 3 times, most recently from 0ca0398 to 2b88427 Compare October 20, 2022 21:02
@aojea
Copy link
Member

aojea commented Oct 20, 2022

When the syncer is in error state, we will do degraded mode procedures,

ah, but that is in a follow up right? I can't see how it is done here 😄

@sawsa307 sawsa307 changed the title Add check for endpoint counts Add check for endpoint counts equal Oct 27, 2022
@sawsa307
Copy link
Contributor Author

sawsa307 commented Nov 2, 2022

When the syncer is in error state, we will do degraded mode procedures,

ah, but that is in a follow up right? I can't see how it is done here 😄

Yes you're right. For now we reset the inError boolean so it is a no-op, but in the future when we implement the degraded mode functionality(which will be in a separate PR), it will be used to trigger degraded mode if the syncer is in error state.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 2, 2022
pkg/neg/syncers/transaction.go Outdated Show resolved Hide resolved
pkg/neg/syncers/transaction.go Outdated Show resolved Hide resolved
pkg/neg/syncers/transaction_test.go Show resolved Hide resolved
pkg/neg/syncers/transaction_test.go Outdated Show resolved Hide resolved
pkg/neg/syncers/transaction_test.go Show resolved Hide resolved
pkg/neg/syncers/transaction_test.go Outdated Show resolved Hide resolved
pkg/neg/syncers/utils.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Nov 8, 2022
@sawsa307 sawsa307 force-pushed the ep-counts-differ branch 3 times, most recently from f618819 to 965cd0e Compare November 9, 2022 00:45
Copy link
Member

@swetharepakula swetharepakula left a comment

Choose a reason for hiding this comment

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

couple nits. Otherwise lgtm!

/approve

pkg/neg/syncers/transaction_test.go Show resolved Hide resolved
pkg/neg/syncers/transaction_test.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 23, 2022
@sawsa307 sawsa307 force-pushed the ep-counts-differ branch 4 times, most recently from 9101e17 to ed35cb7 Compare November 23, 2022 08:23
Add check to make sure the total number of endpoints from endpointData/EPS
equals to the number of endpoints from endpointPodMap. If not, the
syncer will enter the error state.
EndpointData may contain duplicated endpoint, but endpointPodMap removes
duplicated endpoints, and dupCount stores the number of duplicated it removed.
We compare the endpoint counts with duplicates.
Change the function definition of NetworkEndpointsCalculator.CalculateEndpoints()
to return another variable that represents the count of duplicated endpoints.
@swetharepakula
Copy link
Member

/lgtm

Thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 23, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sawsa307, swetharepakula

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot merged commit e776188 into kubernetes:master Nov 23, 2022
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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

4 participants