X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatabroker%2Factors%2Fdds%2FLocalReadWriteProxyTransaction.java;h=a41bef9c9e992518c672c418da82769ea6cfdfc9;hp=e2e93de98ccf671df3dab6d4bd4a5148d5abcb53;hb=e7da6f458d9278b2276671dc3164c9cde24ac9ef;hpb=b9678cbed2d6e08d0a14fba265da216488f183ab diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalReadWriteProxyTransaction.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalReadWriteProxyTransaction.java index e2e93de98c..a41bef9c9e 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalReadWriteProxyTransaction.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalReadWriteProxyTransaction.java @@ -103,7 +103,13 @@ final class LocalReadWriteProxyTransaction extends LocalProxyTransaction { return; } - mod.delete(path); + try { + mod.delete(path); + } catch (Exception e) { + LOG.debug("Transaction {} delete on {} incurred failure, delaying it until commit", getIdentifier(), path, + e); + recordedFailure = e; + } } @Override @@ -115,7 +121,13 @@ final class LocalReadWriteProxyTransaction extends LocalProxyTransaction { return; } - mod.merge(path, data); + try { + mod.merge(path, data); + } catch (Exception e) { + LOG.debug("Transaction {} merge to {} incurred failure, delaying it until commit", getIdentifier(), path, + e); + recordedFailure = e; + } } @Override @@ -127,7 +139,13 @@ final class LocalReadWriteProxyTransaction extends LocalProxyTransaction { return; } - mod.write(path, data); + try { + mod.write(path, data); + } catch (Exception e) { + LOG.debug("Transaction {} write to {} incurred failure, delaying it until commit", getIdentifier(), path, + e); + recordedFailure = e; + } } private RuntimeException abortedException() { @@ -142,7 +160,7 @@ final class LocalReadWriteProxyTransaction extends LocalProxyTransaction { CommitLocalTransactionRequest commitRequest(final boolean coordinated) { final CursorAwareDataTreeModification mod = getModification(); final CommitLocalTransactionRequest ret = new CommitLocalTransactionRequest(getIdentifier(), nextSequence(), - localActor(), mod, coordinated); + localActor(), mod, recordedFailure, coordinated); closedException = this::submittedException; return ret; } @@ -185,11 +203,11 @@ final class LocalReadWriteProxyTransaction extends LocalProxyTransaction { final @Nullable Consumer> callback) { for (final TransactionModification mod : request.getModifications()) { if (mod instanceof TransactionWrite) { - getModification().write(mod.getPath(), ((TransactionWrite)mod).getData()); + write(mod.getPath(), ((TransactionWrite)mod).getData()); } else if (mod instanceof TransactionMerge) { - getModification().merge(mod.getPath(), ((TransactionMerge)mod).getData()); + merge(mod.getPath(), ((TransactionMerge)mod).getData()); } else if (mod instanceof TransactionDelete) { - getModification().delete(mod.getPath()); + delete(mod.getPath()); } else { throw new IllegalArgumentException("Unsupported modification " + mod); }