Bug 7818: xTR-ID timestamp updated only when merging 68/52868/1
authorLorand Jakab <lojakab@cisco.com>
Mon, 6 Mar 2017 10:10:18 +0000 (12:10 +0200)
committerLorand Jakab <lojakab@cisco.com>
Mon, 6 Mar 2017 10:10:18 +0000 (12:10 +0200)
A warning was shown on the Map-Register fast path with default setting,
saying somthing "Could not update timestamp for EID 192.0.2.0/24 xTR-ID
E073DF027BF20605DC9B9518BA753345, no mapping found". Default settings
mean that mapping merge is not on and xTR-ID mappings are not stored, so
the warning is not warranted. And it's not just the warning, the extra
lookup at EVERY fast path Map-Register timestamp upadte has a
performance cost, so make sure it only happens when merge is on.

Change-Id: Id7a66ff8c3309bbcb4ef0bf014f2987149f02fe7
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/MappingSystem.java

index fae45a32a68e5abd9526d6448fa6f2fb65a34f35..3446930da7b84be1c409bde73c528247f39e6bb4 100644 (file)
@@ -199,7 +199,7 @@ public class MappingSystem implements IMappingSystem {
         } else {
             LOG.warn("Could not update timestamp for EID {}, no mapping found", LispAddressStringifier.getString(key));
         }
-        if (xtrId != null) {
+        if (mappingMerge && xtrId != null) {
             MappingData xtrIdMappingData = (MappingData) smc.getMapping(key, xtrId);
             if (xtrIdMappingData != null) {
                 xtrIdMappingData.setTimestamp(new Date(timestamp));