chesnokoff commented on code in PR #13261:
URL: https://github.com/apache/ignite/pull/13261#discussion_r3451786246
##########
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/continuous/GridCacheContinuousQueryMultiNodesFilteringTest.java:
##########
@@ -419,7 +420,7 @@ private NodeFilterByRegexp(String regExp) {
/** {@inheritDoc} */
@Override public boolean apply(ClusterNode clusterNode) {
- return pattern.matcher(clusterNode.id().toString()).matches();
+ return
pattern.matcher(clusterNode.attribute(ATTR_IGNITE_INSTANCE_NAME)).matches();
Review Comment:
Root cause is that the test used `ClusterNode.id()` in the node filter. This
worked for normal test nodes, because their UUIDs end with `0`, `1`, `2`. But
during baseline affinity calculation Ignite can also call this filter for a
`DetachedClusterNode`. This is a special baseline node representation, and its
UUID is random. Because of that, the filtered `grid2` could sometimes pass the
regex as a detached node.
After that Ignite mapped this detached node back to the real `grid2` by
`consistentId`, so affinity expected `grid2` to own some partitions. But the
cache was not actually started on the real `grid2`, because the real node did
not pass the filter. So `awaitPartitionMapExchange()` kept seeing
`affNodesCnt=2` and `ownersCnt=1` and timed out.
The fix is to use stable `ATTR_IGNITE_INSTANCE_NAME` instead of runtime node
UUID in the filter.
From BaselineTopology#createBaselineView
```java
for (ClusterNode node : aliveNodes) {
if (nodeMap.containsKey(node.consistentId()) && (nullNodeFilter ||
CU.affinityNode(node, nodeFilter)))
consIdMap.put(node.consistentId(), node);
}
for (Map.Entry<Object, Map<String, Object>> e : nodeMap.entrySet()) {
Object consId = e.getKey();
if (!consIdMap.containsKey(consId)) {
DetachedClusterNode node = new DetachedClusterNode(consId,
e.getValue());
if (nullNodeFilter || CU.affinityNode(node, nodeFilter))
consIdMap.put(consId, node);
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]