ignite-2.0 - Properly handle DhtInvalidPartitionException in GridDhtGetFuture
@@ -291,6 +291,7 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
* @return {@code True} if mapped.
*/
private boolean map(KeyCacheObject key) {
+ try {
GridDhtLocalPartition part = topVer.topologyVersion() > 0 ?
cache().topology().localPartition(cctx.affinity().partition(key), topVer, true) :
cache().topology().localPartition(key, false);
@@ -313,6 +314,14 @@ public final class GridDhtGetFuture<K, V> extends GridCompoundIdentityFuture<Col
else
return true;
}
+ catch (GridDhtInvalidPartitionException e) {
+ if (log.isDebugEnabled())
+ log.debug("Attempted to create a partition which does not belong to local node, will remap " +
+ "[key=" + key + ", part=" + e.partition() + ']');
+
+ return false;
+ }
+ }
/**
* @param keys Keys to get.
