DynamoDB denies put and delete request of the same item in one batch write request. However now it is allowed in magnetodb rest api:
2014-04-16 08:10:59,405 Request: POST http://127.0.0.1:8480/v1/default_tenant/data/batch_write_item
2014-04-16 08:10:59,405 Request Headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}
2014-04-16 08:10:59,405 Request Body: {"request_items": {"testtempest1552223522": [{"put_request": {"item": {"message": {"S": "message text"}, "replies": {"N": "10"}, "last_posted_by": {"S": "John"}, "forum": {"S": "forum1"}, "subject": {"S": "subject2"}}}}, {"delete_request": {"key": {"forum": {"S": "forum1"}, "subject": {"S": "subject2"}}}}]}}
2014-04-16 08:10:59,427 Response Status: 200
2014-04-16 08:10:59,428 Response Headers: {'date': 'Wed, 16 Apr 2014 08:10:59 GMT', 'content-length': '25', 'content-type': 'application/json'}
2014-04-16 08:10:59,428 Response Body: {"unprocessed_items": {}}
Server side:
2014-04-16 08:10:59.407 3736 DEBUG routes.middleware [-] Matched POST /v1/default_tenant/data/batch_write_item __call__ /usr/local/lib/python2.7/dist-packages/routes/middleware.py:100
2014-04-16 08:10:59.408 3736 DEBUG routes.middleware [-] Route path: '/v1/{project_id}/data/batch_write_item', defaults: {'action': u'process_request', 'controller': <magnetodb.common.wsgi.Resource object at 0x1d76e10>} __call__ /usr/local/lib/python2.7/dist-packages/routes/middleware.py:102
2014-04-16 08:10:59.408 3736 DEBUG routes.middleware [-] Match dict: {'action': u'process_request', 'controller': <magnetodb.common.wsgi.Resource object at 0x1d76e10>, 'project_id': u'default_tenant'} __call__ /usr/local/lib/python2.7/dist-packages/routes/middleware.py:103
2014-04-16 08:10:59.417 3736 DEBUG magnetodb.storage.impl.cassandra_impl [-] Executing query <SimpleStatement query="INSERT INTO "user_default_tenant"."user_testtempest1552223522" ("user_forum","user_subject",extra_attr_data,extra_attr_types,attr_exist) VALUES('forum1','subject2',{'message':0x226d657373616765207465787422,'replies':0x22313022,'last_posted_by':0x224a6f686e22},{'message':'text','replies':'decimal','last_posted_by':'text'},{'message','replies','last_posted_by','forum','subject'})", consistency=QUORUM> _execute_query /opt/stack/magnetodb/magnetodb/storage/impl/cassandra_impl.py:271
2014-04-16 08:10:59.422 3736 DEBUG magnetodb.storage.impl.cassandra_impl [-] Executing query <SimpleStatement query="DELETE FROM "user_default_tenant"."user_testtempest1552223522" WHERE "user_forum"='forum1' AND "user_subject"='subject2'", consistency=QUORUM> _execute_query /opt/stack/magnetodb/magnetodb/storage/impl/cassandra_impl.py:271
Fix proposed to branch: master /review. openstack. org/131384
Review: https:/