[NETCONF-201] PATCH does not report 409 on OptimisticLockFailedException Created: 18/May/16  Updated: 15/Mar/19  Resolved: 05/Aug/16

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Vratko Polak Assignee: Ivan Hrasko
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 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]



 Comments   
Comment by Ivan Hrasko [ 12/Jul/16 ]

Patch: https://git.opendaylight.org/gerrit/#/c/41703/

Comment by Ivan Hrasko [ 19/Jul/16 ]

Merged to Be, needs port to Boron.

Comment by Ivan Hrasko [ 27/Jul/16 ]

Cherry pick to Boron old Restconf:
https://git.opendaylight.org/gerrit/#/c/42462/

Comment by Ivan Hrasko [ 05/Aug/16 ]

patch for new restconf has been merged to master:
https://git.opendaylight.org/gerrit/#/c/41833/

Generated at Wed Feb 07 20:14:25 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.