2 Replies Latest reply on Dec 17, 2008 7:41 AM by Nachiket Patel

    About Merging States on Merge of two sub groups.

    Nachiket Patel Newbie

      Hello,
      I am getting more familiar with JBoss Cache.
      I got very much confused and scared in past 3 to 4 days.
      Because of zero knowledge of JBoss Cache as well as JGroups.
      And i was trying to avoid JGroup internals initially, lately ended in poor understanding. But now (I feel) i am much clear in basics of PojoCache and JGroups, still don't know much about Core Cache.

      Thank you all who helped me, and sorry for putting lots of messages and configuration stacks, i know it's annoying sometimes.
      I am writing this stuff because i really appreciated your help, and i want to thank you for that, Finally my fear of JBoss is gone.

      Anyways,

      What mechanism should be used when i want to copy (or sync to) a particular cache instance (AppInstance 'A') which is initial_host in TCPPING on MERGE. (Because 'B' AppInstance was disconnected from network and come back after Splitting of Cluster) ..

      ViewChange event of CacheListener should be used?? or some special ReplicationInterceptor ??

      And how to re-sync with 'A'? By stopping and starting Cache? or some other option is available??

      Regards,
      Nachiket

        • 1. Re: About Merging States on Merge of two sub groups.
          Manik Surtani Master

          Re-syncing is pretty tough and very application-dependent. If you are caching data that can be retrieved externally or recalculated externally, then your best bet is to simply wipe the cache and start again.

          Otherwise, you could pick one instance as the "correct" version, and shut down and restart all other caches in the cluster so they wipe their "incorrect" state and retrieve state from the one correct instance.

          Anything beyond these two simplistic approaches will involve actually understanding what is in your state and perhaps attempting to merge and consolidate the data manually.

          • 2. Re: About Merging States on Merge of two sub groups.
            Nachiket Patel Newbie

            Thanks Manik,
            I think Shutting down and restarting will work in our case, as there is only one writer server, which will be initial host, and only one who will write to cache, so server instance of cache will be correct one always. Only disconnected instance (reader) needs to restart itself, not all others.

            Which event should be used for this,
            viewChanged(ViewChangedEvent newView)??,

            How to identify that i am joined back in cluster???

            i think i can use getCreator() (returns Address class, but it does not have getIP or getPort kind of methods..)

            Regards,
            Nachiket