4 Replies Latest reply on Dec 18, 2008 9:47 AM by Jason Greene

    How PojoCache handles List when disconnected

    Nachiket Patel Newbie

      Hello guys,
      I started 2 instance of CacheApp say A and B

      I added one element Element1 in cached list using A, it added to B [i am printing events] on 0th index.

      I added one more element Element2 using B, it is replicated to A.

      But say now both app instance[A & B] are adding Element3[By A] and Element4[By B] at the same time in cached list.

      What will happen? Ideally both will get same sequence in List right??


      ----Test I did-----
      I actually removed network cable, add added Element3 [by A] and Element4[by B], Then connect my network back.

      What should be expected output????
      [I am using REPL_ASYNC as cache mode]

      Cheers,
      Nachiket

        • 1. Re: How PojoCache handles List when disconnected
          Jason Greene Master

           

          "nachiket_patel" wrote:

          But say now both app instance[A & B] are adding Element3[By A] and Element4[By B] at the same time in cached list.

          What will happen? Ideally both will get same sequence in List right??


          Yes



          ----Test I did-----
          I actually removed network cable, add added Element3 [by A] and Element4[by B], Then connect my network back.

          What should be expected output????
          [I am using REPL_ASYNC as cache mode]


          ASYNC does not guarantee that all nodes will receive the change, so expected behavior in this condition would be inconsistent state. If you want guaranteed consistency, you want SYNC replication.

          • 2. Re: How PojoCache handles List when disconnected
            Nachiket Patel Newbie

            Hi Jason,
            Thanks for reply.

            I understood. As timestamps are not being used. And only way to make sure is SYNC update (Locking write) in cluster.

            Regards,
            Nachiket

            • 3. Re: How PojoCache handles List when disconnected
              Nachiket Patel Newbie

              Hi jason,
              Can you please elaborate on your point that,
              ----------------------------
              ASYNC does not guarantee that all nodes will receive the change, so expected behavior in this condition would be inconsistent state. If you want guaranteed consistency, you want SYNC replication.
              -----------------------------

              If Computer B is not declared as disconnected by FD (still FD is trying to communicate), and Computer B is connected back then All the data will be replicated to B or it is not guaranteed in ASYNC??

              If this is the case, then normal messages replication is also not guaranteed????

              • 4. Re: How PojoCache handles List when disconnected
                Jason Greene Master

                No what ASYNC means is that all other nodes assume the message was sent and processed successfully, allowing the transaction to commit. This means that if jgroups can't deliver the message (server never recovers in time), your client doesn't know about it. Wheras with Sync, if an expected node is unavailable for a certain amount of time, your client operation will timeout unsuccessfully, and your transaction will be rolled back.