When we remove local shard, make sure we invalidate the associated
cache entry.
Change-Id: I83d6320e7308fe9bdf9c66c928fa91198674eae1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
if (failure != null) {
LOG.debug("Resolution of cookie {} shard {} failed, removing state", cookie, shardName, failure);
backends.remove(cookie, toInsert);
+
+ // Remove cache state in case someone else forgot to invalidate it
+ flushCache(shardName);
}
});
}
self().tell((RunnableMessage) () -> {
+ // At any rate, invalidate primaryShardInfo cache
+ primaryShardInfoCache.remove(shardName);
+
shardActorsStopping.remove(shardName);
notifyOnCompleteTasks(failure, result);
}, ActorRef.noSender());