Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-201

PATCH does not report 409 on OptimisticLockFailedException

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • restconf-nb
    • None
    • Operating System: All
      Platform: All

    • 5909

    Description

      Current Beryllium implementation of PATCH method does not seem to report errors correctly.
      This Python utility https://git.opendaylight.org/gerrit/#/c/37150/30/tools/odl-mdsal-clustering-tests/patch_cars_sr2.py
      can be used to rapidly send multiple PATCH requests to ODL (odl-restconf and odl-clustering-test=-app features are assumed to be installed and ready).

      Sending two small requests (especially when ODL is not yet "warmed up") may end up in only the first request being applied:

      $ python patch_cars_sr2.py --iterations=2
      $ curl -u'admin:admin' 127.0.0.1:8181/restconf/config/car:cars ;echo

      {"cars":{"car-entry":[

      {"id":"car-1"}

      ]}}

      Karaf.log contains exceptions, which should result in http code 409 (the Python utility would report that).

      2016-05-18 11:23:51,589 | INFO | config-pusher | ConfigPusherImpl | 120 - org.opendaylight.control
      ler.config-persister-impl - 0.4.3.SNAPSHOT | Successfully pushed configuration snapshot 20-clustering-test-app.xml(odl
      -clustering-test-app,odl-clustering-test-app)
      2016-05-18 11:24:59,395 | WARN | lt-dispatcher-22 | SimpleShardDataTreeCohort | 168 - org.opendaylight.control
      ler.sal-distributed-datastore - 1.3.3.SNAPSHOT | Store Tx member-1-txn-1-1463570699343: Conflicting modification for p
      ath /(urn:opendaylight:params:xml:ns:yang:controller:config:sal-clustering-it:car?revision=2014-08-18)cars/car-entry.
      2016-05-18 11:24:59,404 | ERROR | lt-dispatcher-24 | LocalThreePhaseCommitCohort | 168 - org.opendaylight.control
      ler.sal-distributed-datastore - 1.3.3.SNAPSHOT | Failed to prepare transaction member-1-txn-1-1463570699343 on backend
      OptimisticLockFailedException

      {message=Optimistic lock failed., errorList=[RpcError [message=Optimistic lock failed., severity=ERROR, errorType=APPLICATION, tag=resource-denied, applicationTag=null, info=null, cause=org.opendaylight.yangtools.yang.data.api.schema.tree.ConflictingModificationAppliedException: Node was created by other transaction.]]}

      at org.opendaylight.controller.cluster.datastore.SimpleShardDataTreeCohort.canCommit(SimpleShardDataTreeCohort.java:54)[168:org.opendaylight.controller.sal-distributed-datastore:1.3.3.SNAPSHOT]

      Attachments

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

        Activity

          People

            ivan.hrasko@pantheon.tech Ivan Hrasko
            vrpolak Vratko Polak
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: