Table can be created with two indices with same key schema

Bug #1308964 reported by Andrii Ostapenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MagnetoDB
Fix Released
Low
Vivek Dhayaal

Bug Description

According to DynamoDB API, we expect that every index in table should have unique key schema. However now we can create table with indexes with the same schema:

2014-04-17 10:58:32,967 Request: POST http://127.0.0.1:8480/v1/default_tenant/data/tables
2014-04-17 10:58:32,967 Request Headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}
2014-04-17 10:58:32,967 Request Body: {"local_secondary_indexes": [{"key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": "attr_name"}], "index_name": "index_name1", "projection": {"projection_type": "ALL"}}, {"key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": "attr_name"}], "index_name": "index_name2", "projection": {"projection_type": "ALL"}}], "key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": "subject"}], "table_name": "testtempest327066401", "attribute_definitions": [{"attribute_type": "S", "attribute_name": "forum"}, {"attribute_type": "S", "attribute_name": "subject"}, {"attribute_type": "S", "attribute_name": "attr_name"}]}
2014-04-17 10:58:33,970 Response Status: 200
2014-04-17 10:58:33,970 Response Headers: {'date': 'Thu, 17 Apr 2014 10:58:33 GMT', 'content-length': '1168', 'content-type': 'application/json'}
2014-04-17 10:58:33,971 Response Body: {"table_description": {"key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": "subject"}], "creation_date_time": 0, "links": [{"href": "http://127.0.0.1:8480/v1/default_tenant/data/tables/testtempest327066401", "rel": "self"}, {"href": "http://127.0.0.1:8480/v1/default_tenant/data/tables/testtempest327066401", "rel": "bookmark"}], "local_secondary_indexes": [{"index_size_bytes": 0, "key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": "attr_name"}], "index_name": "index_name1", "projection": {"projection_type": "ALL"}, "item_count": 0}, {"index_size_bytes": 0, "key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": "attr_name"}], "index_name": "index_name2", "projection": {"projection_type": "ALL"}, "item_count": 0}], "table_name": "testtempest327066401", "table_size_bytes": 0, "table_status": "ACTIVE", "attribute_definitions": [{"attribute_type": "S", "attribute_name": "attr_name"}, {"attribute_type": "S", "attribute_name": "forum"}, {"attribute_type": "S", "attribute_name": "subject"}], "item_count": 0}}

Changed in magnetodb:
importance: Undecided → Low
milestone: none → 2.0.4
tags: added: data-api validation
Changed in magnetodb:
milestone: 2.0.4 → next
Changed in magnetodb:
milestone: next → none
Changed in magnetodb:
assignee: nobody → Vivek Dhayaal (vivekdhayaal)
status: New → In Progress
Changed in magnetodb:
milestone: none → kilo-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnetodb (master)

Reviewed: https://review.openstack.org/149600
Committed: https://git.openstack.org/cgit/stackforge/magnetodb/commit/?id=9bc0bcabfdf31c772fb9fc81978ae97f3d03b9d9
Submitter: Jenkins
Branch: master

commit 9bc0bcabfdf31c772fb9fc81978ae97f3d03b9d9
Author: Vivek Dhayaal <email address hidden>
Date: Fri Jan 23 17:21:12 2015 +0530

    Fix key schema validation for table and LSIs

    Table and its indices must have unique key schema

    Closes-Bug: 1308964
    Change-Id: Ib5f25f183881b9a342b982b28d8e21c7bdd10c88

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.