Possible to create multiple stacks with the same name

Bug #1370185 reported by Jason Dunsmore
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Triaged
Medium
Ethan Lynn

Bug Description

Multiple simultaneous requests can result in creation of multiple stacks with the same name:

Reproduce with:

$ heat stack-create -f test.template wps1 & heat stack-create -f test.template wps1 & heat stack-create -f test.template wps1

Result:

+--------------------------------------+------------+--------------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+------------+--------------------+----------------------+
| 9de917bd-7a75-48f7-967b-acad469b6b86 | wps1 | CREATE_IN_PROGRESS | 2014-09-16T17:52:39Z |
| dffd201a-f63c-4802-bb6b-a3b13c31095a | wps1 | CREATE_IN_PROGRESS | 2014-09-16T17:53:34Z |
| b3023867-ce5c-4120-bf49-c85312011e7e | wps1 | CREATE_IN_PROGRESS | 2014-09-16T17:54:06Z |
+--------------------------------------+------------+--------------------+----------------------+

This should not be possible. If you follow-up with another request, the service responds with the correct error:

$ heat stack-create -f test.template wps1
ERROR: The Stack (wps1) already exists.

Changed in heat:
assignee: nobody → Ishant Tyagi (ishant-tyagi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
assignee: Ishant Tyagi (ishant-tyagi) → Visnusaran Murugan (visnusaran-murugan)
status: New → In Progress
Changed in heat:
status: In Progress → Triaged
importance: Undecided → High
milestone: none → juno-rc1
Changed in heat:
status: Triaged → In Progress
Revision history for this message
Visnusaran Murugan (visnusaran-murugan) wrote :

raw_temlate delete:

1. expose db_api so that template can be deleted upon exception 2. delete both user_creds and raw_template in db_api.stack_create before raising exception.

Please let me know on how to proceed. The second one is crude, but will not try and add anything new. first one in a cleaner approach, not sure why template.delete was not exposed in the first place.

Zane Bitter (zaneb)
Changed in heat:
milestone: juno-rc1 → next
Revision history for this message
Visnusaran Murugan (visnusaran-murugan) wrote :

tenant id length normalization bug #1352260 is still open. reducing tenant length from 256 to 255 to make it part of composite unique key. Making tenant/stack_name composite unique key to resolve duplicate stack name validation.

Angus Salkeld (asalkeld)
Changed in heat:
milestone: next → kilo-rc1
Angus Salkeld (asalkeld)
tags: added: kilo-rc-potential
Changed in heat:
milestone: kilo-rc1 → next
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

The current proposed change looks too stale for this to be regarded In Progress

Changed in heat:
status: In Progress → Triaged
Revision history for this message
Avi Vachnis (avi-vachnis) wrote :

More info that may help with fix coverage, I run the 3 stack-create calls as described and got the result below on my devstack.
This devstack runs only a standalone heat and my template includes an inner heat::Stack resource. the resources are successfully created on a remote region full devstack installation.

[stack@avachnis-devstack-2 devstack(keystone_admin)]$ heat stack-list
+--------------------------------------+-----------------------------+-----------------+----------------------+
| id | stack_name | stack_status | creation_time |
+--------------------------------------+-----------------------------+-----------------+----------------------+
| 40613e0b-606d-4a60-9970-76c53aa9c19f | wps1 | CREATE_COMPLETE | 2015-04-21T13:11:41Z |
| 7dc2354e-79ed-4f09-8ee9-7c6431ef8e4b | wps1 | CREATE_COMPLETE | 2015-04-21T13:11:41Z |
| d23d4baa-8689-4f54-a463-d267975aa982 | wps1 | CREATE_COMPLETE | 2015-04-21T13:11:41Z |
| 7e6e4e84-1810-4050-9e07-df4054382479 | wps1-stack_one-mxuaujd7elgq | CREATE_COMPLETE | 2015-04-21T13:11:46Z |
| 935117ca-f9a5-47f4-9f33-25143d759107 | wps1-stack_one-lxgzsecfo6id | CREATE_COMPLETE | 2015-04-21T13:11:46Z |
| ffdad7d8-be34-47ec-8fb6-2dee4d012434 | wps1-stack_one-lsu3gj4jdhpe | CREATE_COMPLETE | 2015-04-21T13:11:46Z |
+--------------------------------------+-----------------------------+-----------------+----------------------+

I guess standalone should not make any different that let the 3 stacks be successfully created instead of staying in progress.

Angus Salkeld (asalkeld)
tags: removed: kilo-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in heat:
assignee: Visnusaran Murugan (visnusaran-murugan) → Ethan Lynn (ethanlynn)
status: Triaged → In Progress
Changed in heat:
importance: High → Medium
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

Feel free to put this back In Progress if you are actively working on it.

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

Change abandoned by Ethan Lynn (<email address hidden>) on branch: master
Review: https://review.openstack.org/180903
Reason: Abandon this patch until find a new way to solve it.

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

Change abandoned by Steve Baker (<email address hidden>) on branch: master
Review: https://review.openstack.org/123397
Reason: This is a very old review which has unaddressed review feedback, failing tests, or merge conflicts.

For this reason it is being abandoned to make the review queue more maintainable. It can be restored and refreshed at any time.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers