2 Replies Latest reply on Jan 2, 2009 10:05 AM by manik

    Data gravitation not work if you create two nodes with same

      Hi

      I have two cluster nodes, nodeA and nodeB deployed on WLS 10.3, the demo code is very simple, I list the step is follow:

      1. create a FQN using: Fqn.fromString("/testRegion");
      2. create a Cache with default "total-replication.xml" configuration, and store it in a servelet property, so all the request can use the same Cache instance.
      3. create a war of this app and deploy it into WLS.
      4. send requests to the cluster, Node A and B receive requests and save data with the Cache created in step2 and FQN created in step1.


      Then my question comes out, I put (key=A, value=11) on nodeA and then put (key=B, value=22) on nodeB, so the cluster will have the following data description:

      NodeA [(key=A, value=11)]
      NodeB [(key=B, value=22)]

      OK, then I'm going to try to get B on NodeA by calling method:
      Cache.get(testRegion, "B")

      I was hope that data can be retrieved from NodeB, but nothing happen, I did set dataGravitation auto="true" before doing this test.

      By tracing the code I found that there is a nodeDoesNotExist method in DataGravitatorInterceptor, only when it returns true the Interceptor should do the job -- Gravitation.

      I'm not sure is this a right behavior? Because I think it's common that different cluster nodes can have the same FQN node but with different items, when they have set to be buddy and data gravitation, one cluster node down, the other cluster node should try to retrieve data from the backup no matter it has the FQN or not.

      Am i wrong? Please correct me.


        • 1. Re: Data gravitation not work if you create two nodes with s

          Please, anyone, I need help.

          • 2. Re: Data gravitation not work if you create two nodes with s
            manik

            Data gravitation takes place on a per-node level (and by node, I mean a node in the cache's tree structure such as /testRegion). Since both servers in your case (what you call NodeA and NodeB) are putting things in the same tree node in the cache (/testRegion) you have a problem.

            Each server should use a different FQN such as /testRegion/ServerA and /testRegion/ServerB

            Also, if you have only 2 servers, don't waste your time with buddy replication - you will find that total, synchronous replication is more efficient. The benefits of BR is only seen in larger clusters.