[ISSUE #6831] Fix stale entries accumulating during common multi-data refresh - #6958
Open
yykaue wants to merge 4 commits into
Open
[ISSUE #6831] Fix stale entries accumulating during common multi-data refresh#6958yykaue wants to merge 4 commits into
yykaue wants to merge 4 commits into
Conversation
Aias00
approved these changes
Aug 20, 2026
Aias00
left a comment
Contributor
There was a problem hiding this comment.
Summary
Fixes #6831 — during a REFRESH of common multi-data (e.g. selectors), stale entries accumulated because the REFRESH branch did nothing (empty break).
onCommonMultiChangednow handlesREFRESHby re-publishing each changed item and calling a newrefreshChangedMapToList, which:- reads the existing
*POINT_LISTnode, - removes the still-present ids (
oldNodeList.removeAll(listIds)), - deletes the config nodes for any id no longer present,
- republishes the list with the current ids.
- reads the existing
- This mirrors the existing
putChangedMapToList/delChangedMapToListhelpers and keeps the*_LISTindex in sync with the actual data on refresh.
Verification
DefaultNodeConstants.JOIN_POINT/POINT_LISTare existing constants already used by sibling methods in the same class.- New
AbstractNodeDataChangedListenerTest.testOnSelectorChangedRefreshReplacesPluginSelectorIdsseeds two plugins with[RETAINED, STALE]ids, issues aREFRESHwith[RETAINED]+ a newADDEDfor plugin 1, and asserts: plugin-1 list becomes[RETAINED, ADDED], plugin-2 list becomes[RETAINED], and bothSTALEdata nodes are deleted. This is exactly the stale-entry cleanup the PR intends.
Conclusion
Clean fix for a real stale-cache bug, with a focused regression test. Approving.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6831
This PR fixes the stale configuration issue in
AbstractNodeDataChangedListener.onCommonMultiChanged().For
REFRESHevents, the listener now:REFRESHseparately from additive events.This prevents deleted selector, rule, proxy-selector, and discovery-upstream entries from remaining in Nacos, Apollo, or Polaris.
@Aias00, could you please help review this PR? Thanks!