On 24 May 2011, at 22:36, Mircea Markus wrote:
Hi,
I've created JIRAs for the locking
optimisations as follows:
Keep in mind the LockingInterceptor delegates a
lot of the copyOnWrite (of CacheEntries) and the
corresponding locking to the EntryFactoryImpl. This
too would probably need to be subclassed.
#2: this seems to be just a particular case
of #4
Looks good, however I'm concerned about the key
comparator and how this would deterministically
order keys. Basing order on hashcode can lead to
collisions (and if using the default Object.hashcode
breaks down completely). And we can't *require*
that users provide one; we'd need to provide a
sensible - if suboptimal - default.
Paolo's concerns are very valid. Vector clocks
to determine order of application on non-primary
owner node is one mechanism that would work; another
may be that each node only ever communicates with
the primary owner. And the primary owner then has
the responsibility of propagating prepares and
commits to other peers. This will mean eventual
consistency though, since concurrent readers would
always have to read from the primary owner since
reading from other owners of an entry may result in
stale data.
Another potential problem here is failover. You
should discuss how you intend to deal with failure
in the primary owner, with different transactions at
various stages of completion.
Cheers
Manik
--