Always save to local copy in IdIntsListener 47/78347/2
authorTom Pantelis <tompantelis@gmail.com>
Sun, 2 Dec 2018 20:49:16 +0000 (15:49 -0500)
committerTom Pantelis <tompantelis@gmail.com>
Tue, 4 Dec 2018 17:06:33 +0000 (17:06 +0000)
The Listener Stability CSIT fails intermittently due to the
IdIntsListener reporting that its local view of the data
tree as captured from DTCNs does not match the final read
of the data after the writes are done and the leader change
is complete. On DTCN, the IdIntsListener only stores the new
data if the data before in the DTCN matches its stored copy of
the data from the previous DTCN. When the test fails, this
check fails early on and after that it will never match. A
prior patch added a diff of the data nodes that failed the check
which shows that the id-int entry for "prefix-1" was missing
in the stored copy. This is added at the start of the test
(each node adds its own entry). It's unclear to me if it's
actually valid to ensure that the stored copy matches the
current DTCN's data before so I removed the check - let's see
if there's any further tests failures.

Change-Id: I7b861fc85b42586832072fdc19de103733e4fbf5
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/IdIntsListener.java

index 0f7e4a31c9da74f4c9f0716344d1c72b6e6b12e5..60d624442b1f9d4b4bd7f303a75b944fa958df17 100644 (file)
@@ -21,7 +21,6 @@ import java.util.concurrent.Future;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicLong;
 import javax.annotation.Nonnull;
 import org.opendaylight.controller.md.sal.dom.api.ClusteredDOMDataTreeChangeListener;
@@ -43,7 +42,6 @@ public class IdIntsListener implements ClusteredDOMDataTreeChangeListener {
     private final AtomicLong lastNotifTimestamp = new AtomicLong(0);
     private ScheduledExecutorService executorService;
     private ScheduledFuture<?> scheduledFuture;
-    private final AtomicBoolean loggedIgnoredNotificationDiff = new AtomicBoolean();
 
     @Override
     public void onDataTreeChanged(@Nonnull final Collection<DataTreeCandidate> changes) {
@@ -63,13 +61,7 @@ public class IdIntsListener implements ClusteredDOMDataTreeChangeListener {
                                 ? change.getRootNode().getDataBefore().get() : "",
                         change.getRootNode().getDataAfter().get());
 
-                if (localCopy == null || checkEqual(change.getRootNode().getDataBefore().get())) {
-                    localCopy = change.getRootNode().getDataAfter().get();
-                } else {
-                    LOG.warn("Ignoring notification {}", loggedIgnoredNotificationDiff.compareAndSet(false, true)
-                        ? diffWithLocalCopy(change.getRootNode().getDataBefore().get()) : "");
-                    LOG.trace("Ignored notification content: {}", change);
-                }
+                localCopy = change.getRootNode().getDataAfter().get();
             } else {
                 LOG.warn("getDataAfter() is missing from notification. change: {}", change);
             }