BUG-2470: add trace of failed modification 82/13482/1
authorRobert Varga <rovarga@cisco.com>
Tue, 9 Dec 2014 17:01:10 +0000 (18:01 +0100)
committerRobert Varga <rovarga@cisco.com>
Tue, 9 Dec 2014 17:01:10 +0000 (18:01 +0100)
With this change, the InMemoryDOMDataStore trace logs should contain the
dump of failed modifications.

Change-Id: Iea3038169090a574030c5e03cf155089faa6e985
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java

index 4e01fa9..85134f1 100644 (file)
@@ -241,6 +241,11 @@ public class InMemoryDOMDataStore extends TransactionReadyPrototype implements D
                 LOG.warn("Store Tx: {} Data Precondition failed for {}.", transaction.getIdentifier(),
                         e.getPath(), e);
                 transaction.warnDebugContext(LOG);
+
+                // For debugging purposes, allow dumping of the modification. Coupled with the above
+                // precondition log, it should allow us to understand what went on.
+                LOG.trace("Store Tx: {} modifications: {}", modification);
+
                 return Futures.immediateFailedFuture(new TransactionCommitFailedException("Data did not pass validation.", e));
             } catch (Exception e) {
                 LOG.warn("Unexpected failure in validation phase", e);