md-meta with case insensitive string has problem when creating

Bug #1535231 reported by hgangwx
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
Pankaj Mishra

Bug Description

[Summary]
md-meta with case sensitive has problem when creating

[Topo]
devstack all-in-one node

[Description and expect result]
can create case sensitive md-meta

[Reproduceable or not]
reproduceable

[Recreate Steps]
1) there is a md-tag named "ab" for namespace "new-ns":
stack@45-59:~/devstack$ glance md-tag-create --name ab new-ns
+------------+----------------------+
| Property | Value |
+------------+----------------------+
| created_at | 2016-01-18T16:36:13Z |
| name | ab |
| updated_at | 2016-01-18T16:36:13Z |
+------------+----------------------+
stack@45-59:~/devstack$ glance md-tag-list new-ns
+------+
| name |
+------+
| ab |
+------+

2)if create a new md-tag named "AB", conflict occur: >>>ISSUE
stack@45-59:~/devstack$ glance md-tag-create --name AB new-ns
409 Conflict: A metadata tag with name=AB already exists in namespace=new-ns.
stack@45-59:~/devstack$

3)but if there is no md-tag "ab", the md-tag "AB" can be created.
stack@45-59:~/devstack$ glance md-tag-delete new-ns ab
stack@45-59:~/devstack$
stack@45-59:~/devstack$ glance md-tag-list new-ns
+------+
| name |
+------+
+------+
stack@45-59:~/devstack$ glance md-tag-create --name AB new-ns
+------------+----------------------+
| Property | Value |
+------------+----------------------+
| created_at | 2016-01-18T16:37:20Z |
| name | AB |
| updated_at | 2016-01-18T16:37:20Z |
+------------+----------------------+

[Configration]
reproduceable bug, no need

[logs]
reproduceable bug, no need

[Root cause anlyze or debug inf]
reproduceable bug

[Attachment]
None

Changed in python-glanceclient:
assignee: nobody → Bharath Krishna (bharathkrishna)
Revision history for this message
Bharath Krishna (bharathkrishna) wrote :
Revision history for this message
Bharath Krishna (bharathkrishna) wrote :

The implementation in glance metadata is such that the information is case insensitive. What does the title meta data case sensitive mean?

Revision history for this message
hgangwx (hgangwx) wrote :

Hi Bharath,
I just updated the title.
I mean, in step 2, there is a md-tag "ab" existing, if I create a md-tag "AB",
should return a message "A metadata tag with name=ab already exists"
but not "A metadata tag with name=AB already exists"

summary: - md-meta with case sensitive has problem when creating
+ md-meta with case insensitive string has problem when creating
Revision history for this message
Bharath Krishna (bharathkrishna) wrote :

 I believe this bug is created under the impression that case sensitive is not working for md-tags.(At least the description points to that.) As long it is case insensitive, it is a choice to display the name in any CASE. I believe it will be an overhead to have code to get the case-sensitive name from the database to be displayed in debug info in case-insensitive context. On a lighter note, this doesn't seem like a bug to me. Share your thoughts.

Revision history for this message
hgangwx (hgangwx) wrote :

Hi Bharath,
I think I can't agree this sentence:
" As long it is case insensitive, it is a choice to display the name in any CASE"
I think if it is case insensitive, it should display the name always in upper case or in lower case.
For instance, if always display in lower case, if an tag "ABc" created, should be displayed and stored
as "abc", after this is created, if try to create other tag like "ABC", "abc","abC" , can throw a conflict
info says that "'abc' is already created".
Or says that "md-tag is case insensitive, 'ABc' is created"
Otherwise, it is confusing to user.

Changed in python-glanceclient:
assignee: Bharath Krishna (bharathkrishna) → nobody
Revision history for this message
Kairat Kushaev (kkushaev) wrote :

We can add some additional info about case-insensitivity to exception message but that must be fixed in glance.

no longer affects: python-glanceclient
Changed in glance:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Kairat Kushaev (kkushaev)
Changed in glance:
assignee: Kairat Kushaev (kkushaev) → Pankaj Mishra (pankaj-mishra)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

Changed in glance:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (master)

Change abandoned by Pankaj Mishra (<email address hidden>) on branch: master
Review: https://review.openstack.org/302544
Reason: Created different review id, so closing it. I will take care in different patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Pankaj Mishra (<email address hidden>) on branch: master
Review: https://review.openstack.org/302216

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/302652
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=385ffab06f1657d10a8a7284bb83945d236bd6d7
Submitter: Jenkins
Branch: master

commit 385ffab06f1657d10a8a7284bb83945d236bd6d7
Author: Pankaj Mishra <email address hidden>
Date: Thu Apr 7 15:56:22 2016 +0530

    Modified message of exception and log

    Metadata tag names are case insensitive, that confuses
    the user. So we added additional information about metadata
    tag duplication to clarify the point.

    Change-Id: Ib58a9d0b9cc95a831981de0cc19456f0c6713dbb
    Closes-Bug: #1535231

Changed in glance:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (master)

Change abandoned by Kairat Kushaev (<email address hidden>) on branch: master
Review: https://review.openstack.org/275093

Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/glance 13.0.0.0b1

This issue was fixed in the openstack/glance 13.0.0.0b1 development milestone.

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.