Hi guys,

I configured my ConcurrentDistributedMap with a HashcodeLockStrategy
allowing "NonCoherentReadsForLocalEntries": my understanding is that
after calling ConcurrentDistributedMap#get(key) method, it will
locally check if there's an object at the given key, and if it is
found and is not an ObjectID, it gets returned, otherwise (if not
found or instanceof ObjectID), it gets loaded from the tc master.

However, it sometimes returns null *without* ever trying to load from master.
That's apparently because there seems to be a bug in
ConcurrentDistributedMapDso#get() method.
The following if-clause:

      if (val == null &&
lockStrategy.allowNonCoherentReadsForNonExistentMapping()) {
        // Mapping not present and we are allowed to perform fast
non-coherent reads for non-existent mapping.
        return null;
      } else if (! (val instanceof ObjectID) &&
lockStrategy.allowNonCoherentReadsForLocalEntries()) {
        // Mapping present and is faulted in and we are allowed to
perform fast non-coherent reads for locally present mapping.
        return (V) val;
      }

Actually returns null (on second if) when val is null even if
allowNonCoherentReadsForNonExistentMapping is false but
allowNonCoherentReadsForLocalEntries is true.

Is that correct?

Thanks,
Cheers,

Sergio B.

-- 
Sergio Bossa
Software Passionate and Open Source Enthusiast.
URL: http://www.linkedin.com/in/sergiob
_______________________________________________
tc-dev mailing list
tc-dev@lists.terracotta.org
http://lists.terracotta.org/mailman/listinfo/tc-dev

Reply via email to