diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/CachingAsyncConsistentMap.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/CachingAsyncConsistentMap.java
index 5c0eaef..cedd810 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/CachingAsyncConsistentMap.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/CachingAsyncConsistentMap.java
@@ -50,7 +50,7 @@
     private final Logger log = getLogger(getClass());
 
     private final LoadingCache<K, CompletableFuture<Versioned<V>>> cache;
-
+    private final AsyncConsistentMap<K, V> backingMap;
     private final MapEventListener<K, V> cacheUpdater;
     private final Consumer<Status> statusListener;
 
@@ -71,6 +71,7 @@
      */
     public CachingAsyncConsistentMap(AsyncConsistentMap<K, V> backingMap, int cacheSize) {
         super(backingMap);
+        this.backingMap = backingMap;
         cache = CacheBuilder.newBuilder()
                             .maximumSize(cacheSize)
                             .build(CacheLoader.from(CachingAsyncConsistentMap.super::get));
@@ -111,6 +112,23 @@
     }
 
     @Override
+    public CompletableFuture<Versioned<V>> getOrDefault(K key, V defaultValue) {
+        return cache.getUnchecked(key).thenCompose(r -> {
+            if (r == null) {
+                CompletableFuture<Versioned<V>> versioned = backingMap.getOrDefault(key, defaultValue);
+                cache.put(key, versioned);
+                return versioned;
+            } else {
+                return CompletableFuture.completedFuture(r);
+            }
+        }).whenComplete((r, e) -> {
+            if (e != null) {
+                cache.invalidate(key);
+            }
+        });
+    }
+
+    @Override
     public CompletableFuture<Versioned<V>> computeIf(K key,
             Predicate<? super V> condition,
             BiFunction<? super K, ? super V, ? extends V> remappingFunction) {
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/MeteredAsyncConsistentMap.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/MeteredAsyncConsistentMap.java
index ccffead..4b9ff98 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/MeteredAsyncConsistentMap.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/MeteredAsyncConsistentMap.java
@@ -54,6 +54,7 @@
     private static final String CONTAINS_KEY = "containsKey";
     private static final String CONTAINS_VALUE = "containsValue";
     private static final String GET = "get";
+    private static final String GET_OR_DEFAULT = "getOrDefault";
     private static final String COMPUTE_IF = "computeIf";
     private static final String PUT = "put";
     private static final String PUT_AND_GET = "putAndGet";
@@ -119,6 +120,13 @@
     }
 
     @Override
+    public CompletableFuture<Versioned<V>> getOrDefault(K key, V defaultValue) {
+        final MeteringAgent.Context timer = monitor.startTimer(GET_OR_DEFAULT);
+        return super.getOrDefault(key, defaultValue)
+                .whenComplete((r, e) -> timer.stop(e));
+    }
+
+    @Override
     public CompletableFuture<Versioned<V>> computeIfAbsent(K key,
                                                            Function<? super K, ? extends V> mappingFunction) {
         final MeteringAgent.Context timer = monitor.startTimer(COMPUTE_IF_ABSENT);
