This is an automated email from the ASF dual-hosted git repository.
alexpl pushed a commit to branch ignite-2.15
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/ignite-2.15 by this push:
new 472765858bb IGNITE-18766 Fix incorrect id check in
ClusterGroupAdapter.forNodeId - Fixes #10640.
472765858bb is described below
commit 472765858bb590b7f23fed1427fc739a6fa10093
Author: Denis Kuznetsov <[email protected]>
AuthorDate: Fri Apr 14 10:48:06 2023 +0300
IGNITE-18766 Fix incorrect id check in ClusterGroupAdapter.forNodeId -
Fixes #10640.
Signed-off-by: Aleksey Plekhanov <[email protected]>
(cherry picked from commit 91e66669ffc11950fe4a4358c04893a71aa98953)
---
.../ignite/internal/cluster/ClusterGroupAdapter.java | 2 +-
.../ignite/internal/GridProjectionForCachesSelfTest.java | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
index b6d07ece704..880a2b0460f 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/cluster/ClusterGroupAdapter.java
@@ -458,7 +458,7 @@ public class ClusterGroupAdapter implements ClusterGroupEx,
Externalizable {
nodeIds = U.newHashSet(ids.length + 1);
for (UUID id0 : ids) {
- if (contains(id))
+ if (contains(id0))
nodeIds.add(id0);
}
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionForCachesSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionForCachesSelfTest.java
index e68b9a07472..ebec6bd4ddf 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionForCachesSelfTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/GridProjectionForCachesSelfTest.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import java.util.UUID;
import org.apache.ignite.Ignite;
@@ -281,6 +282,19 @@ public class GridProjectionForCachesSelfTest extends
GridCommonAbstractTest {
}
}
+ /**
+ * @throws Exception If failed.
+ */
+ @Test
+ public void testProjectionWithBadId() {
+ ClusterNode locNode = ignite.cluster().localNode();
+
+ ClusterGroup prj = ignite.cluster().forNodeId(UUID.randomUUID(),
locNode.id());
+ Collection<ClusterNode> nodes = prj.nodes();
+
+ assertEquals(1, nodes.size());
+ }
+
/**
*
*/