-
1. How does one wait for a cluster to form?
pmuir Feb 16, 2011 12:03 PM (in response to stevenll)I wrote https://github.com/infinispan/examples/blob/master/tutorial/clustered/src/main/java/org/infinispan/examples/tutorial/clustered/util/ClusterValidation.java a couple of weeks ago for this exact purpose - just call waitForClusterToForm with the relevant cluster size/node id and it should work.
-
2. How does one wait for a cluster to form?
brenuart Feb 17, 2011 4:41 AM (in response to stevenll)According to my experience, your cache won't be usuable until it is fully started. This means:
- if configured as a cluster member, it waits until it has succesfully joined the cluster;
- if configured with stateRetrieval, it waits until the state is retrieved from other members;
This should be enough to guarantee that your first cache operation is made on a cache whose content is insync with the rest of the cluster. If not the case, I suspect a problem in your configuration.
On the other hand, Pete's proposed solution requires that you know the size of your cluster in advance and that all members are up and running before you can do anything... This seems to be against the HA behavior you want to achieve.
/bertrand
-
3. How does one wait for a cluster to form?
galder.zamarreno Feb 17, 2011 12:02 PM (in response to brenuart)Stevenll, fyi, we're gonna be implementing an optional interceptor that basically stops invocations until a weak or strict clustering requirement has been fulfilled: - https://issues.jboss.org/browse/ISPN-928
This is similar to Pete's code with the benefit that it'll be just a config switch, without requiring any code from you.