Subscription patching to duplicate in mongodb should return 409 response

Bug #1547131 reported by Eva Balycheva
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zaqar
Fix Released
High
Eva Balycheva

Bug Description

What happens:

Now when I try to patch subscription to make it duplicate of other subscription, Zaqar returns 400 response code with body like this:
{
    "title": "Unable to update subscription",
    "description": "Subscription 56c5fe4292d7024058d831fe could not be updated."
}

As you can see it's not very informative for the user. And also there is definitely conflict
And Zaqar server is showing log messages of ERROR level during this event, which is wrong: http://paste.openstack.org/show/JDK4TR2gNG5nLBrJFxnI/

Possible solution:

On such event make Zaqar return response code 409 with body:
{
    "title": "Unable to update subscription",
    "description": "Such subscription already exists"
}

And make zaqar just log this event on DEBUG level.

Eva Balycheva (ubershy)
Changed in python-zaqarclient:
assignee: nobody → Eva Balycheva (ubershy)
Eva Balycheva (ubershy)
affects: python-zaqarclient → zaqar
Eva Balycheva (ubershy)
summary: - Subscription patching to duplicate should return 409 response
+ Subscription patching to duplicate in mongo should return 409 response
summary: - Subscription patching to duplicate in mongo should return 409 response
+ Subscription patching to duplicate in mongodb should return 409 response
Feilong Wang (flwang)
Changed in zaqar:
milestone: none → mitaka-rc1
status: New → Confirmed
importance: Undecided → High
Feilong Wang (flwang)
tags: added: release-critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to zaqar (master)

Reviewed: https://review.openstack.org/279946
Committed: https://git.openstack.org/cgit/openstack/zaqar/commit/?id=f94a9ee4cee28e79fbb4af1da66ab876f2c3079f
Submitter: Jenkins
Branch: master

commit f94a9ee4cee28e79fbb4af1da66ab876f2c3079f
Author: wangxiyuan <email address hidden>
Date: Sun Feb 14 17:30:35 2016 +0800

    Forbid update subscription to duplicate

    Now if users update a subscription in a queue, it doesn't check the
    legality of the new subscriber. We should forbid update subscription to
    duplicate and return 409 response in such case.

    This patch modifies Redis and MongoDB storage controllers and API v2.
    It also adds unit tests for them.

    The functional test will be updated in zaqar client.

    APIimpact
    Closes-Bug: #1545548
    Closes-Bug: #1547131
    Co-Authored-By: wangxiyuan <email address hidden>
    Co-Authored-By: Eva Balycheva <email address hidden>
    Change-Id: I28fe7a114860488c503642417690bf5bfbd99678

Changed in zaqar:
status: Confirmed → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/zaqar 2.0.0.0rc1

This issue was fixed in the openstack/zaqar 2.0.0.0rc1 release candidate.

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.