[
https://issues.jboss.org/browse/AS7-3976?page=com.atlassian.jira.plugin.s...
]
jaikiran pai commented on AS7-3976:
-----------------------------------
Yes, this needs to fixed/improved. Currently the implementation doesn't allow any way
to make the initial node selection (from among the available ones) deterministic, if all
the nodes can handle the same deployment. I've seen other users asking for this
enhancement too. So as a first step I'm going to introduce a way where an node
selection implementation can be used if multiple receivers can handle the same deployment.
Here's what I've added:
{code}
package org.jboss.ejb.client;
/**
* A selector which selects and returns a node, from among the passed eligible nodes, that
can handle a specific
* deployment within a EJB client context. Typical usage of {@link DeploymentNodeSelector}
involves load balancing
* calls to multiple nodes which can all handle the same deployment. This allows the
application to have a deterministic
* node selection policy while dealing with multiple nodes with same deployment.
*
* @author Jaikiran Pai
*/
public interface DeploymentNodeSelector {
/**
* Selects and returns a node from among the <code>eligibleNodes</code> to
handle the invocation on a deployment
* represented by the passed <code>appName</code>,
<code>moduleName</code> and <code>distinctName</code>
combination.
* Implementations of this method must <b>not</b> return null or any other
node name which isn't in the
* <code>eligibleNodes</code>
*
* @param eligibleNodes The eligible nodes which can handle the deployment. Will not
be empty.
* @param appName The app name of the deployment
* @param moduleName The module name of the deployment
* @param distinctName The distinct name of the deployment
* @return
*/
String selectNode(final String[] eligibleNodes, final String appName, final String
moduleName, final String distinctName);
}
{code}
This will be similar to the existing org.jboss.ejb.client.ClusterNodeSelector which helps
in node selection within a cluster (independent of the deployment).
For 1.0.x versions, we'll be using a RandomDeploymentNodeSelector which will randomly
return one of the many eligible nodes for the deployment. This will help is (randomly)
distributing the invocations to different nodes and will prevent the current issue where
the chances of it going to the same node are high.
For 1.1.x we'll add support for configuring a different implementation for this
selector (I am not planning to add the configuration for 1.0.x since it will involve
adding a new API on the client configuration interface).
EJB client sometimes does not loadbalance
-----------------------------------------
Key: AS7-3976
URL:
https://issues.jboss.org/browse/AS7-3976
Project: Application Server 7
Issue Type: Bug
Components: Clustering, EJB
Affects Versions: 1.0.3.Final
Reporter: Radoslav Husar
Assignee: jaikiran pai
Priority: Critical
I noticed that with a 2 node cluster, sometimes all sessions are created only on one
node.
Looks like cluster view is not updating properly on the client.
See
https://hudson.qa.jboss.com/hudson/view/EAP6/view/EAP6-Performance-Cluste...
for logs.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira