[jboss-dev-forums] [Design of JBossCache] - Re: Locking tree before setting initial state

bstansberry@jboss.com do-not-reply at jboss.com
Thu Sep 14 00:19:00 EDT 2006


OK, so there's no "unblock" call.  That seems a minor flaw in FLUSH, as it doesn't give the application an opportunity to make any kind of state transition upon completion of the whole FLUSH cycle.  The only knowledge the app has that the FLUSH is finished is that suddenly messages start flowing up/down the channel again.

No matter; that's an issue for another day and I don't think an issue for the current problem.  Refining what I proposed last time.  I'll use the pull model, although TreeCache implements MembershipListener so I think it would get the block() call.

1) Receive BlockEvent on all nodes
a) set a flag or something that will block any ACTIVE transactions from proceeding (i.e. entering prepare() phase of 2PC)
b) wait for complete / rollback any transactions that are beyond ACTIVE
c) call Channel.blockOk().
d) reverse the flag set in a) so transactions can now enter prepare().  But, the channel will prevent the prepare() call going out on the cluster

2) In getState() on node that's providing state, execute something pretty much like what I already wrote to deal with ACTIVE transactions on that node or any leftover locks held by sick nodes.

3) No need for #3. Flag already reversed in 1d; when FLUSH is done, the blocked prepare() calls will start to flow.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971462#3971462

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971462



More information about the jboss-dev-forums mailing list