Subscription patching to duplicate in Redis should return 409 response

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

Bug Description

Now, when use redis as the storage backend, if users update a subscription in a queue. It doesn't check the legality of the new
subscriber and doesn't update the subscriber section in redis as well.

Reproduce:
1. use redis backend and ensure there is a queue (we can name it test-queue)already.
2. create a subscription :
{
    'subscriber': 'http://test-ip:8000',
    'ttl': '3600',
    'options': {}
}
3. create an other subscription:
{
    'subscriber': 'http://test-ip:8001',
    'ttl': '3600',
    'options': {}
}
4. update the second subscription:
{
    'subscriber': 'http://test-ip:8000'
}

expect: we can't update it because the subscriber is used by the first subscription.
actual: it's updated successfully.

and an other bug:
in step 4, we update the subscription:
{
    'subscriber': 'http://test-ip:8002'
}
5. create the third subscription:
{
    'subscriber': 'http://test-ip:8001'
}

expect: the third subscription should be created. because the 8001 does not be used
actual: it cant' be created.

6. create the forth subscription:
{
    'subscriber': 'http://test-ip:8002'
}
expect: the forth subscription should not be created. because the 8002 is used by the second subscription
actual: it is created successfully.

wangxiyuan (wangxiyuan)
Changed in zaqar:
assignee: nobody → wangxiyuan (wangxiyuan)
Changed in zaqar:
status: New → In Progress
Revision history for this message
wangxiyuan (wangxiyuan) wrote :
Feilong Wang (flwang)
Changed in zaqar:
importance: Undecided → High
milestone: none → mitaka-rc1
tags: added: release-critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to zaqar (master)

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

Eva Balycheva (ubershy)
summary: - The subscriber should be unique in redis backend.
+ Subscription patching to duplicate should return 409 response
description: updated
Eva Balycheva (ubershy)
description: updated
summary: - Subscription patching to duplicate should return 409 response
+ Subscription patching to duplicate in Redis should return 409 response
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: In Progress → 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.