Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-370

InMemoryDOMDataStore cannot be instantiated with CONFIGURATION dataTree

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: Fluorine
    • Fix Version/s: 3.0.0, Fluorine SR1
    • Component/s: None
    • Labels:
      None

      Description

      The class org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore is deprecated in fluorine, but in this class is constructor, which have used in previous releases LogicalDatastoreType for choosing if the in-memory dataStore will have config dataTree or operational dataTree. In fluorine version, the constructor is present, but the mdsal version of InMemoryDOMDataStore is used and type is ignored. Mdsal version of InMemoryDOMDataStore is by default only with operational dataTree.

      This is causing issues, when you want to have config datastore and have config false mandatory leaf, which you don't want to setup. The put operation works, but merge operation fails on preCommit phase:

      09:50:22,940 [pool-3-thread-1] WARN  org.opendaylight.controller.md.sal.dom.broker.impl.CommitCoordinationTask  - Tx: DOM-21 Error during phase preCommit, starting Abort
      TransactionCommitFailedException{message=preCommit execution failed, errorList=[RpcError [message=preCommit execution failed, severity=ERROR, errorType=APPLICATION, tag=operation-failed, applicationTag=null, info=null, cause=java.lang.IllegalArgumentException: Node (urn:example?revision=2018-09-18)int-interface[

      {(urn:example?revision=2018-09-18)name=int1}

      ] is missing mandatory descendant /(urn:urn:example?revision=2018-09-18)oper-status]]}
          at org.opendaylight.controller.md.sal.dom.broker.impl.TransactionCommitFailedExceptionMapper.newWithCause(TransactionCommitFailedExceptionMapper.java:37)
          at org.opendaylight.controller.md.sal.dom.broker.impl.TransactionCommitFailedExceptionMapper.newWithCause(TransactionCommitFailedExceptionMapper.java:19)
          at org.opendaylight.yangtools.util.concurrent.ExceptionMapper.apply(ExceptionMapper.java:91)
          at org.opendaylight.controller.md.sal.dom.broker.impl.TransactionCommitFailedExceptionMapper.apply(TransactionCommitFailedExceptionMapper.java:43)
          at org.opendaylight.controller.md.sal.dom.broker.impl.CommitCoordinationTask.preCommitBlocking(CommitCoordinationTask.java:150)
          at org.opendaylight.controller.md.sal.dom.broker.impl.CommitCoordinationTask.call(CommitCoordinationTask.java:65)
          at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:127)
          at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
          at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:80)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.IllegalArgumentException: Node (urn:example?revision=2018-09-18)int-interface[

      {(urn:example?revision=2018-09-18)name=int1}

      ] is missing mandatory descendant /(urn:example?revision=2018-09-18)oper-status
          at com.google.common.base.Preconditions.checkArgument(Preconditions.java:434)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.MandatoryLeafEnforcer$Strict.enforceOnData(MandatoryLeafEnforcer.java:44)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.MandatoryLeafEnforcer.enforceOnTreeNode(MandatoryLeafEnforcer.java:59)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.ListEntryModificationStrategy.applyTouch(ListEntryModificationStrategy.java:56)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.applyMerge(AbstractNodeContainerModificationStrategy.java:168)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.ListEntryModificationStrategy.applyMerge(ListEntryModificationStrategy.java:40)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.apply(SchemaAwareApplyOperation.java:223)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.mutateChildren(AbstractNodeContainerModificationStrategy.java:137)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.applyTouch(AbstractNodeContainerModificationStrategy.java:251)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.applyMerge(AbstractNodeContainerModificationStrategy.java:168)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.apply(SchemaAwareApplyOperation.java:223)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.mutateChildren(AbstractNodeContainerModificationStrategy.java:137)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.applyTouch(AbstractNodeContainerModificationStrategy.java:251)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.applyMerge(AbstractNodeContainerModificationStrategy.java:168)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.apply(SchemaAwareApplyOperation.java:223)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.StructuralContainerModificationStrategy.apply(StructuralContainerModificationStrategy.java:72)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.mutateChildren(AbstractNodeContainerModificationStrategy.java:137)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.applyTouch(AbstractNodeContainerModificationStrategy.java:251)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.apply(SchemaAwareApplyOperation.java:210)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.RootModificationApplyOperation.apply(RootModificationApplyOperation.java:77)
          at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractDataTreeTip.prepare(AbstractDataTreeTip.java:54)
          at org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore.prepare(InMemoryDOMDataStore.java:175)
          at org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMStoreThreePhaseCommitCohort.preCommit(InMemoryDOMStoreThreePhaseCommitCohort.java:93)
          at org.opendaylight.controller.sal.core.compat.DOMStoreThreePhaseCommitCohortAdapter.preCommit(DOMStoreThreePhaseCommitCohortAdapter.java:31)
          at org.opendaylight.controller.md.sal.dom.broker.impl.CommitCoordinationTask.preCommitAll(CommitCoordinationTask.java:171)
          at org.opendaylight.controller.md.sal.dom.broker.impl.CommitCoordinationTask.preCommitBlocking(CommitCoordinationTask.java:144)
          ... 7 more

       

      The model looks as follows:

      container int-node {
          list int-interface {
              key "name";
              leaf name

      {             type string;         }
              leaf oper-status {
                  type enumeration {
                    enum up {                 value 1;                 description                   "Ready to pass packets.";               }
                    enum down {                 value 2;                 description                   "The interface does not pass any packets.";               }
                  }
                  config false;
                  mandatory true;
              }
              leaf info {             type string;         }

          }
      }

       

      Input data:

      new IntNodeBuilder().setIntInterface(Collections.singletonList(new IntInterfaceBuilder().setName("int1").setInfo("Info1").build())).build();

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              rovarga Robert Varga
              Reporter:
              apuchyova Anna Bencurova
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: