<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Good summary, Mircea. &nbsp;Breaking it down - and the specific design as well in the JIRAs - makes it seem almost trivial to implement. &nbsp;;)<div><br><div><div>On 24 May 2011, at 22:36, Mircea Markus wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>This is re:&nbsp;<a href="http://community.jboss.org/wiki/PossibleLockingImprovements">http://community.jboss.org/wiki/PossibleLockingImprovements</a></div><div><br></div><div>I've created JIRAs for the locking optimisations as follows:</div><div><br></div><div>#1:&nbsp;<a href="https://issues.jboss.org/browse/ISPN-1131">https://issues.jboss.org/browse/ISPN-1131</a></div></div></blockquote><div><br></div><div>Keep in mind the LockingInterceptor delegates a lot of the copyOnWrite (of CacheEntries) and the corresponding locking to the EntryFactoryImpl. &nbsp;This too would probably need to be subclassed.</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>#2: this seems to be just a particular case of #4&nbsp;</div><div>#3:&nbsp;<a href="https://issues.jboss.org/browse/ISPN-1132">https://issues.jboss.org/browse/ISPN-1132</a></div></div></blockquote><div><br></div><div>Looks good, however I'm concerned about the key comparator and how this would deterministically order keys. &nbsp;Basing order on hashcode can lead to collisions (and if using the default Object.hashcode breaks down completely). &nbsp;And we can't *require* that users provide one; we'd need to provide a sensible - if suboptimal - default.</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><a href="https://issues.jboss.org/browse/ISPN-1132"></a>#4:&nbsp;<a href="https://issues.jboss.org/browse/ISPN-1137">https://issues.jboss.org/browse/ISPN-1137</a></div></div></blockquote><div><br></div><div>Paolo's concerns are very valid. &nbsp;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. &nbsp;And the primary owner then has the responsibility of propagating prepares and commits to other peers. &nbsp;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.</div><div><br></div><div>Another potential problem here is failover. &nbsp;You should discuss how you intend to deal with failure in the primary owner, with different transactions at various stages of completion.</div><div><br></div><div>Cheers</div><div>Manik</div><div>--</div></div><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><div>Manik Surtani</div><div><a href="mailto:manik@jboss.org">manik@jboss.org</a></div><div><a href="http://twitter.com/maniksurtani">twitter.com/maniksurtani</a></div><div><br></div><div>Lead, Infinispan</div><div><a href="http://www.infinispan.org">http://www.infinispan.org</a></div><div><br></div></div></span><br class="Apple-interchange-newline">
</div>
<br></div></body></html>