Index hash key must coincide with table hash key

Bug #1308971 reported by Andrii Ostapenko
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MagnetoDB
Fix Released
Low
Andrii Ostapenko

Bug Description

According to DynamoDB API, index hash key must coincide with table hash key, but now we can create a table with index, which hash key differs from table hash key:

2014-04-17 11:16:38,710 Request: POST http://127.0.0.1:8480/v1/default_tenant/data/tables
2014-04-17 11:16:38,711 Request Headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}
2014-04-17 11:16:38,711 Request Body: {"local_secondary_indexes": [{"key_schema": [{"key_type": "HASH", "attribute_name": "attr_name1"}, {"key_type": "RANGE", "attribute_name": "attr_name2"}], "index_name": "index_name", "projection": {"projection_type": "ALL"}}], "key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": "subject"}], "table_name": "testtempest700888849", "attribute_definitions": [{"attribute_type": "S", "attribute_name": "forum"}, {"attribute_type": "S", "attribute_name": "subject"}, {"attribute_type": "S", "attribute_name": "attr_name1"}, {"attribute_type": "S", "attribute_name": "attr_name2"}]}
2014-04-17 11:16:39,766 Response Status: 200
2014-04-17 11:16:39,767 Response Headers: {'date': 'Thu, 17 Apr 2014 11:16:39 GMT', 'content-length': '994', 'content-type': 'application/json'}
2014-04-17 11:16:39,767 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/testtempest700888849", "rel": "self"}, {"href": "http://127.0.0.1:8480/v1/default_tenant/data/tables/testtempest700888849", "rel": "bookmark"}], "local_secondary_indexes": [{"index_size_bytes": 0, "key_schema": [{"key_type": "HASH", "attribute_name": "forum"}, {"key_type": "RANGE", "attribute_name": "attr_name2"}], "index_name": "index_name", "projection": {"projection_type": "ALL"}, "item_count": 0}], "table_name": "testtempest700888849", "table_size_bytes": 0, "table_status": "ACTIVE", "attribute_definitions": [{"attribute_type": "S", "attribute_name": "attr_name2"}, {"attribute_type": "S", "attribute_name": "attr_name1"}, {"attribute_type": "S", "attribute_name": "forum"}, {"attribute_type": "S", "attribute_name": "subject"}], "item_count": 0}}

tags: added: data-api validation
Changed in magnetodb:
importance: Undecided → Low
milestone: none → 2.0.4
Changed in magnetodb:
milestone: 2.0.4 → next
Changed in magnetodb:
assignee: nobody → Andrei V. Ostapenko (aostapenko)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnetodb (master)

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

Changed in magnetodb:
status: New → In Progress
Changed in magnetodb:
milestone: next → juno-3
Changed in magnetodb:
milestone: juno-3 → juno-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnetodb (master)

Reviewed: https://review.openstack.org/114556
Committed: https://git.openstack.org/cgit/stackforge/magnetodb/commit/?id=23e9050694a77e0b3fbe00b88b985016a5f2d833
Submitter: Jenkins
Branch: master

commit 23e9050694a77e0b3fbe00b88b985016a5f2d833
Author: Andrei V. Ostapenko <email address hidden>
Date: Mon Aug 18 23:22:20 2014 -0400

    Fixes bug with index hash key

    Fixes bug, that allowed to pass index hash
    key that differs with primary hash key on
    table creation.

    Closes-bug: #1356584
    Closes-bug: #1308971
    Change-Id: I7b3cc2da926eb1b446de2ff212141beb38faccaf

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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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