-
1. Re: State transfer retrieval and transaction processing
belaban Jul 11, 2005 8:53 AM (in response to jarquey)We have to lock the cache during state transfer, otherwise you would get inconsistent state.
If you can transfer the state into the underlying CacheLoader yourself, e.g. though the application, you could turn transferring persistent state off, and then wouldn't have to incur locking of the cache -
2. Re: State transfer retrieval and transaction processing
jarquey Jul 11, 2005 11:28 AM (in response to jarquey)In the solution you suggest it will be application responsibility to manage the cache consistency during transfer ? I don?t see how to manage it ?
About cache lock during transfer :
Is it stupid to imagine that the JbossCache coordinator will manage only iterative Treecache nodes locks (for instance at Treecache root level) instead of a global cache lock during synchronization ? Sync time could be longer but the sync could remain secure, allow concurrent transactions and avoid application unavailability. -
3. Re: State transfer retrieval and transaction processing
belaban Jul 11, 2005 11:59 AM (in response to jarquey)"jarquey" wrote:
In the solution you suggest it will be application responsibility to manage the cache consistency during transfer ? I don?t see how to manage it ?
The application could for example communicate with all members to stop modifying the cache until the state transfer (e.g. DB copy) is done. However, this boils down to what we already have.
There is no way around locking the entire tree until the state has been copied, at least not IMO.
About cache lock during transfer :
Is it stupid to imagine that the JbossCache coordinator will manage only iterative Treecache nodes locks (for instance at Treecache root level) instead of a global cache lock during synchronization ? Sync time could be longer but the sync could remain secure, allow concurrent transactions and avoid application unavailability.
The problem here is that you can get inconsistencies when you lock node X to get its state, then unlock, but before you transfer the state, someone else modifies X.
I'm not sure it *cannot* be done, but it would have to result on consistent state snapshots.
Note that this problem will somewhat be mitigated with optimistic locking (scheduled for 1.2.5, Oct 2005): we will still need to lock the entire tree, but because there are no other locks in the tree (except when a TX commits), this should be okay.