-
Bug
-
Resolution: Done
-
Major
-
7.1.0.ER1
-
None
Since EAP 7.0.1 coming with the fix for JBEAP-4646 (upstream WFLY-6453), InfinispanSessionManager#getActiveSessions (active-sessions attribute on CLI) was changed to return active session count with current node locality.
However, it returns an incorrect count on a cluster coordinator node. For example, when two node cluster is configured, it returns total count of active sessions. This happens regardless of using "dist" cache or using "repl" cache.
—
The followings are the related code. It appears ConsistentHashLocality#isLocal(key) always returns true on a coordinator node and it causes incorrect active session count.
268 @Override 269 public Set<String> getActiveSessions() { 270 // Omit remote sessions (i.e. when using DIST mode) as well as passivated sessions 271 return this.getSessions(Flag.CACHE_MODE_LOCAL, Flag.SKIP_CACHE_LOAD); 272 } : 280 private Set<String> getSessions(Flag... flags) { 281 try (Stream<? extends Key<String>> keys = this.cache.getAdvancedCache().withFlags(flags).keySet().stream()) { 282 return keys.filter(this.filter.and(key -> this.locality.isLocal(key))).map(key -> key.getValue()).collect(Collectors.toSet()); 283 } 284 }
51 @Override 52 public boolean isLocal(Object key) { 53 if (this.localAddress == null) return true; 54 if (this.hash == null) return true; 55 return this.localAddress.equals(this.hash.locatePrimaryOwner(key)); 56 }
- is cloned by
-
JBEAP-11499 [GSS](7.0.z) InfinispanSessionManager#getActiveSessions (active-sessions attribute in CLI) returns an incorrect count on a coordinator node in cluster
- Closed
-
WFLY-8931 InfinispanSessionManager#getActiveSessions (active-sessions attribute in CLI) returns an incorrect count on a coordinator node in cluster
- Closed