[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Why have you reversed my changes on replication?
timfox
do-not-reply at jboss.com
Wed Mar 4 02:33:57 EST 2009
| +
| + 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.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4214778#4214778
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4214778
More information about the jboss-dev-forums
mailing list