4 Replies Latest reply on Apr 10, 2013 4:51 AM by Matthew Wellard

    Handle data merge after connection is lost

    NB C Newbie

      Hi,

       

      Is there an infinispan configuration to handle data merge after the cluster connection is temporary lost?

       

      For example:

      Current situation

      1. Node1 and Node2 connection is lost.

      2. New data is inserted into Node1.

      3. Node1 and Node2 connection is restored.

      4. Node1 and Node2 data is not merged and thus new data is not found in Node2.

       

      Is there a way to make Node1 data sync to Node2 after connection is restored?

       

      Thanks a lot!

       

      Regards,

      NB

        • 1. Re: Handle data merge after connection is lost
          Dan Berindei Expert

          No, at the moment Infinispan doesn't copy data from one partition to another, because it doesn't know which data is the latest. For instance, it can't differentiate from you inserting new data on Node1 and you deleting existing data on Node2.

           

          We are planning to add support for merging data in version 6.0.

          • 2. Re: Handle data merge after connection is lost
            Matthew Wellard Newbie

            Hi,

             

            We're getting around this (for replicated caches) by adding the contents back in to the cache on a Merge event, from one node in each sub-cluster. This ensures that all the content (as we can't tell what has been updated since the split) is spread around the cluster.

             

            A custom interceptor is then used to check the updated value against the cache value using a timestamp (nodes must be reasonably time synchronised) in our object. If the update is newer, take it, otherwise broadcast out the cache copy as it's newer.

             

            Obviously this generates a lot of traffic but for us, data consistency is quite important.

             

            This doesn't currently cope with deletes but that could be fixed with some sort of tombstone on the object.

             

            Hope that helps,

            Matt

            • 3. Re: Handle data merge after connection is lost
              wei lee Newbie

              Hi Matthew Wellard,

               

              I am novice in Infinispan. I wonder what mode you use to interact with Infinispan, p2p or c/s?

              Because I have a issue with form p2p clustering(distribution) in different Machine, but when the infinispan nodes in the same machine, they are working fine and detecting each other.

              Furthermore, forming c/s clustering(distribution) with the same configuration in different Machine,  also working fine and detecting each other.

               

              Attached are the files that I have used for clustering

              Please let me know, Is there I have to change any configurations in the attached files to achieve p2p clustering in different machines. So that it can detect the infinispan node that is running in another machine.

               

              Many thanks,

              wei

              PS, this is using Infinispan 5.1.6 and JGroups 3.0

              • 4. Re: Handle data merge after connection is lost
                Matthew Wellard Newbie

                Hi Wei,

                 

                You should probably start a new discussion for this. You might get some more expert eyes over it that way...

                 

                Having a had a quick look, I can suggest you check the IP addresses of your jgroups.xml on both nodes.

                 

                Also, I note you're using "cache.keySet()" to list your cache content. Be wary of this with Distributed Caches as entries may not be available on the current node depending on your configuration.

                 

                Hope that helps a bit but I'm no expert ;-)

                 

                Matt