Skip to content

fix: scope discovery informer known objects to each mesh - #1638

Open
AsperforMias wants to merge 3 commits into
apache:developfrom
AsperforMias:fix-zk-service-catalog
Open

AsperforMias wants to merge 3 commits into
apache:developfrom
AsperforMias:fix-zk-service-catalog

Conversation

@AsperforMias

Copy link
Copy Markdown
Contributor

Please provide a description of this PR:

Discovery informers list resources for one mesh, but use a resource store shared across meshes. During a list replacement, an informer can therefore treat another mesh's resources as deleted. For example, a Nacos refresh can remove ZooKeeper service metadata from the Admin catalog even though the ZooKeeper nodes still exist.

Scope each discovery informer's known-object view to its mesh. Both ListKeys and GetByKey use exact mesh identity, while stale-resource deletion and watch updates/deletions within the same mesh remain unchanged. The change stays within discovery and does not modify the shared controller.

Tests cover both cross-mesh ordering directions, mesh names containing slashes, stale-resource deletion, watch updates/deletions, and relisting. The regression fails on the original implementation and passes with this change. Targeted tests, race tests, vet, and lint for the changed package pass.

Real Nacos/ZooKeeper checks passed after two independent Admin restarts using this patch. Service lists, details, methods, and non-IDL invocation remained available.

The adapter scans the existing per-kind List view. It does not change the store's existing list-error handling contract.

To help us figure out who should review this PR, please put an X in all the areas that this PR affects.

  • Docs
  • Installation
  • User Experience
  • Dubboctl
  • Console
  • Core Component

Please check any characteristics that apply to this pull request.

@robocanic robocanic left a comment

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.

I traced the relist through DeltaFIFO.KnownObjects and the discovery store adapter. Filtering both ListKeys and GetByKey by exact mesh identity keeps another registry’s metadata out of replacement tombstones, while a missing key in the same mesh can still generate a delete. The regression tests cover both registry orderings and same-mesh stale deletion. I found no blocking issue in this change. The discovery package passed in Actions; the failing metric dashboard assertion is addressed separately in #1642.

@sonarqubecloud

Copy link
Copy Markdown

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.

2 participants