db_api iscsi_target_create_safe() constraint violation

Bug #1187367 reported by Yuriy Zveryanskyy
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Yuriy Zveryanskyy

Bug Description

iscsi_target_create_safe() allows create multiple identical "target_num", "host" pair,
violate UniqueConstraint("target_num", "host") in model.
Reproduced in my test.
https://review.openstack.org/31640

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

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

Changed in cinder:
assignee: nobody → Yuriy Zveryanskyy (yzveryanskyy)
status: New → In Progress
description: updated
Changed in cinder:
assignee: Yuriy Zveryanskyy (yzveryanskyy) → nobody
status: In Progress → New
Changed in cinder:
assignee: nobody → Yuriy Zveryanskyy (yzveryanskyy)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/31640
Committed: http://github.com/openstack/cinder/commit/34e649e065099626d0b1b8ccc1f0e9da1b64fa1d
Submitter: Jenkins
Branch: master

commit 34e649e065099626d0b1b8ccc1f0e9da1b64fa1d
Author: Yuriy Zveryanskyy <email address hidden>
Date: Tue Jun 4 15:56:54 2013 +0300

    Add missing tests for iscsi_* methods

    There was no tests in test_db_api for iscsi_*
    methods.

    Bug 1187367 found.

    blueprint db-api-tests

    Change-Id: Ia554e6030307a0c4f0510ab74fe0881ee160f743

Changed in cinder:
status: New → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: havana-2 → 2013.2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to cinder (master)

Reviewed: https://review.openstack.org/111760
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=331071a3e2f1ee6783e6a908789af40835818eed
Submitter: Jenkins
Branch: master

commit 331071a3e2f1ee6783e6a908789af40835818eed
Author: Ivan Kolodyazhny <email address hidden>
Date: Mon Aug 4 18:16:10 2014 +0300

    Catch DBDuplicateEntry instead of IntegrityError

    'iscsi_target_create_safe' method didn't catch DB exceptions
    correct.

    Need to catch both db_exc.DBError and db_exc.DBDuplicateEntry
    due to current oslo.db limitations: it doesn't handle correct
    DBDuplicateEntry with different SQLite versions

    Related-Bug: #1187367

    Change-Id: Ie412ecabd3cbcac301340c82b4275adb7a7206c3

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.