6 Replies Latest reply on Mar 4, 2009 8:56 AM by Clebert Suconic

    Why have you reversed my changes on replication?

    Tim Fox Master

       

      +
      + private MessageReference removeReferenceOnBackup(final long id) throws Exception
      + {
      + // most of the times, the remove will work ok, so we first try it without any locks
      + MessageReference ref = messageQueue.removeFirstReference(id);
      
      + if (ref == null)
      + {
      + PagingStore store = pagingManager.getPageStore(binding.getAddress());
      +
      + while (true)
      + {
      + // Can't have the same store being depaged in more than one thread
      + synchronized (store)
      + {
      + // as soon as it gets the lock, it needs to verify if another thread couldn't find the reference
      + ref = messageQueue.removeFirstReference(id);
      + if (ref == null)
      + {
      + // force a depage
      + if (!store.readPage()) // This returns false if there are no pages
      + {
      + break;
      + }
      + }
      + else
      + {
      + break;
      + }
      + }
      + }
      + }
      +
      + return ref;
      +
      + }
      +
      +
      


      I removed that code for a reason. I changed replication to *guarantee* that order of all operations on backup is exactly the same as the order on the live node, so this is unnecessary.