Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
None
-
None
-
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
at org.opendaylight.controller.cluster.datastore.SimpleShardDataTreeCohort.canCommit(SimpleShardDataTreeCohort.java:54)[168:org.opendaylight.controller.sal-distributed-datastore:1.3.3.SNAPSHOT]