Invalid response when put_item with "ALL_OLD" in returned section

Bug #1299037 reported by Oleksandr Minakov on 2014-03-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MagnetoDB
Medium
Andrei V. Ostapenko

Bug Description

16:31:02,420 Request: POST http://127.0.0.1:8080/v1/testtenantid/data/tables
16:31:02,420 Request Headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}
16:31:02,421 Request Body: {"key_schema": [{"key_type": "HASH", "attribute_name": "message"}], "table_name": "testtempest979567797", "attribute_definitions": [{"attribute_type": "S", "attribute_name": "message"}]}
16:31:03,308 Response Status: 200
16:31:03,309 Response Headers: {'date': 'Fri, 28 Mar 2014 14:31:03 GMT', 'content-length': '560', 'content-type': 'application/json'}
16:31:03,309 Response Body: {"table_description": {"key_schema": [{"key_type": "HASH", "attribute_name": "message"}, {"key_type": "RANGE", "attribute_name": null}], "creation_date_time": 0, "links": [{"href": "http://127.0.0.1:8080/v1/testtenantid/data/tables/testtempest979567797", "rel": "self"}, {"href": "http://127.0.0.1:8080/v1/testtenantid/data/tables/testtempest979567797", "rel": "bookmark"}], "table_name": "testtempest979567797", "table_size_bytes": 0, "table_status": "ACTIVE", "attribute_definitions": [{"attribute_type": "S", "attribute_name": "message"}], "item_count": 0}}
16:31:03,309 Request: POST http://127.0.0.1:8080/v1/testtenantid/data/tables/testtempest979567797/put_item
16:31:03,309 Request Headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}
16:31:03,310 Request Body: {"item": {"message": {"S": "message_text"}, "others": {"SS": ["qqqq", "wwww"]}, "authors": {"SS": ["Alice", "Bob"]}}}
16:31:03,319 Response Status: 200
16:31:03,320 Response Headers: {'date': 'Fri, 28 Mar 2014 14:31:03 GMT', 'content-length': '2', 'content-type': 'application/json'}
16:31:03,320 Response Body: {}
16:31:03,320 Request: POST http://127.0.0.1:8080/v1/testtenantid/data/tables/testtempest979567797/put_item
16:31:03,321 Request Headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}
16:31:03,321 Request Body: {"item": {"message": {"S": "message_text"}, "others": {"SS": ["zzzz", "xxxx"]}, "authors": {"SS": ["Kris", "Rob"]}}, "time_to_live": 0, "return_values": "ALL_OLD"}
16:31:03,340 Response Status: 200
16:31:03,340 Response Headers: {'date': 'Fri, 28 Mar 2014 14:31:03 GMT', 'content-length': '122', 'content-type': 'application/json'}
16:31:03,340 Response Body: {"attributes": {"message": {"S": "message_text"}, "authors": {"SS": ["Rob", "Kris"]}, "others": {"SS": ["zzzz", "xxxx"]}}}

Expected response body: {"attributes": {"message": {"S": "message_text"}, "authors": {"SS": ["Alice", "Bob"]}, "others": {"SS": ["qqqq", "wwww"]}}}

tags: added: data-api
Changed in magnetodb:
milestone: none → 2.0.2
importance: Undecided → Medium
Changed in magnetodb:
milestone: 2.0.2 → 2.0.3
Changed in magnetodb:
milestone: 2.0.3 → 2.0.4
Changed in magnetodb:
milestone: 2.0.4 → 2.0.5
Changed in magnetodb:
assignee: nobody → Andrei V. Ostapenko (aostapenko)

ALL_OLD is not supported for now. Now this parameter works as ALL_NEW, that we, actually, can't pass now because of validation bug. I suggest to add support of ALL_NEW by fixing this bug and restrict passing of ALL_OLD param.

Fix proposed to branch: master
Review: https://review.openstack.org/94935

Changed in magnetodb:
status: New → In Progress
Changed in magnetodb:
status: In Progress → Fix Committed
Changed in magnetodb:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers