Skip to content

fix(cache): remove stale service address indexes - #1955

Open
sivakumar-mahalingam wants to merge 3 commits into
kmesh-net:mainfrom
sivakumar-mahalingam:fix/1954-service-cache-stale-addresses
Open

sivakumar-mahalingam wants to merge 3 commits into
kmesh-net:mainfrom
sivakumar-mahalingam:fix/1954-service-cache-stale-addresses

Conversation

@sivakumar-mahalingam

Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does / why we need it:

Cleans up address indexes belonging to the previous version of a service before indexing an updated service. This prevents removed addresses from continuing to resolve through servicesByAddr or servicesByIP while preserving addresses reassigned to another service.

Adds regression tests covering stale index removal and address reassignment.

Which issue(s) this PR fixes:

Fixes #1954

Special notes for your reviewer:

The update path reuses the existing deleteAddr ownership checks. Tests cover both network-address and IP-only lookups.

Does this PR introduce a user-facing change?:

Yes.

Fixed stale service address lookups after a service's addresses are updated.

@kmesh-bot kmesh-bot added the kind/bug Something isn't working label Sep 20, 2026
@kmesh-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hzxuzhonghu for approval. For more information see the Kubernetes Code Review Process.

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

Details 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

Signed-off-by: Sivakumar Mahalingam <36898056+sivakumar-mahalingam@users.noreply.github.com>
@sivakumar-mahalingam
sivakumar-mahalingam force-pushed the fix/1954-service-cache-stale-addresses branch from 5585e63 to b298c47 Compare September 20, 2026 18:16
@codecov

codecov Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.72%. Comparing base (09e96d3) to head (de5ec90).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Coverage Δ
pkg/controller/workload/cache/service_cache.go 83.92% <100.00%> (+9.41%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60881fc...de5ec90. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Sivakumar Mahalingam <36898056+sivakumar-mahalingam@users.noreply.github.com>
@sivakumar-mahalingam

Copy link
Copy Markdown
Author

The Istio 1.27 IPv6 E2E check failed in TestMixNsAndServiceWaypoint because X-Request-Id was missing. The same test passed on the preceding run with identical code. Could a maintainer rerun the failed job?

Signed-off-by: Sivakumar Mahalingam <36898056+sivakumar-mahalingam@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Service updates leave stale address indexes in ServiceCache

2 participants