Fix findbugs warnings
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / databroker / actors / dds / ModuleShardBackendResolver.java
index f0775ba289fcae321fce46132290e9f32faaa6a1..b79a5ab88ec8af82e4ded27b937de4044f48e117 100644 (file)
@@ -108,6 +108,9 @@ final class ModuleShardBackendResolver extends AbstractShardBackendResolver {
             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);
             }
         });
 
@@ -126,7 +129,7 @@ final class ModuleShardBackendResolver extends AbstractShardBackendResolver {
             LOG.debug("Invalidating backend information {}", staleInfo);
             flushCache(staleInfo.getShardName());
 
-            LOG.trace("Invalidated cache %s", staleInfo);
+            LOG.trace("Invalidated cache {}", staleInfo);
             backends.remove(cookie, existing);
         }