[BUG]ClusterNode Map clear problem.
- Dominant language
- Java
- Stars
- 23.1k
- Forks
- 8.1k
- PR merge metrics
- No merged PRs in 30d
Description
## Issue Description
*bug report*
### Describe what happened (or what feature you want)
When I made CommonFilter support http method and test the function, I found the test case fail at:

After I have gone through the test code, I found the reason laid in here:

The code "ClusterBuilderSlot.getClusterNodeMap().clear()" clear all the cluster node in the global map of ClusterBuilderSlot class, but the specific cluster node hold by one ClusterBuilderSlot instance can not be clean. You can see the relationship here:

When the client try to access resource of the same name after clearing the cluster node map, the statistics can be accumulated but the node can not be added to the cluster node map any more because the cluster node is not null in the "IF" JUDGEMENT. So when get cluster node from map and assert is not null, that should fail.
### Describe what you expected to happen
When the cluster node map got clean, the specific cluster node in one ClusterBuilderSlot should be clean either.
One way to do this is add a volatile flag in cluster node to denote whether it should be clean or rebuild, and add the flag judge in ClusterBuilderSlot. However this makes cluster node more complex and hard to understand.
### How to reproduce it (as minimally and precisely as possible)
1.
2.
3.
### Tell us your environment
### Anything else we need to know?
Contributor guide
Research direction
Start by reading ClusterBuilderSlot and ClusterNode, then reproduce the CommonFilter test failure described in the issue. Trace how getClusterNodeMap().clear() affects the global map versus the node held by a ClusterBuilderSlot instance. Done means clearing the map also removes or rebuilds the instance-held node so a later lookup can add it again.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100