Bug 1167284

Summary: [Pools] > New pool > double clicking on 'ok' will create the same pool twice with wrong calculation of vm's in pool
Product: Red Hat Enterprise Virtualization Manager Reporter: Michael Burman <mburman>
Component: ovirt-engineAssignee: Shmuel Melamud <smelamud>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Burman <mburman>
Severity: high Docs Contact:
Priority: medium    
Version: 3.5.0CC: gklein, lpeer, lsurette, mburman, michal.skrivanek, rbalakri, Rhev-m-bugs, smelamud, srevivo, ykaul
Target Milestone: ovirt-3.6.0-rc   
Target Release: 3.6.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 3.6.0-4 alpha3 Doc Type: Bug Fix
Doc Text:
Previously, when user quickly pressed "OK" button twice in the VM pool creation dialog, two identical pools were created. This issue was resolved and now only one VM pool is created even if "OK" button was clicked several times.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-20 01:11:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1167327, 1249631    
Bug Blocks:    
Attachments:
Description Flags
engine log
none
new engine log none

Description Michael Burman 2014-11-24 11:27:04 UTC
Created attachment 960674 [details]
engine log

Description of problem:
[GUI]>[Pools] > New pool > double clicking on 'ok' will create the same pool twice with wrong calculation of vm's in pool. In the event log will be error about creating the pool, but the pool will be created twice, with the same name and wrong number of vm's in the pool. 

Version-Release number of selected component (if applicable):
3.5.0-0.21.el6ev

How reproducible:
always

Steps to Reproduce:
1. [Pools] > new pool> create new pool(can be from template) with 50 vm's in pool
2. click double click on 'ok' to approve operation 
3.

Actual results:
The same pool will be created twice with the same name, and wrong number of vm's.
each pool will get something like 27-28 vm's per pool.

Expected results:
Pool should be created once with the right amount of vm's.

Comment 1 Michal Skrivanek 2014-11-25 09:19:52 UTC
Occe the UI is solved it's going to solve this bug too.

Comment 2 Michal Skrivanek 2014-11-25 09:21:30 UTC
regarding REST API calls..well, for 2 same requests you would get twice as many VMs...but that's basically what you would have asked for - so it works. Not worth adding any code around it...

Comment 3 Michal Skrivanek 2015-06-02 10:51:37 UTC
seems the UI issue is fixed? can you confirm if there is no other issue?

Comment 4 Michael Burman 2015-06-02 14:27:16 UTC
Hi Michael,

No, i can't confirm. 

Double click on 'ok' created 4 pool entities named 'mb' with a different number of assigned VMs. attaching engine.log

Comment 5 Michael Burman 2015-06-02 14:39:01 UTC
Created attachment 1033838 [details]
new engine log

Comment 6 Michael Burman 2015-06-02 14:41:19 UTC
tested on - 3.6.0-0.0.master.20150519172219.git9a2e2b3.el6

Comment 7 Omer Frenkel 2015-07-07 15:12:20 UTC
Shmuel, is this fixed by https://gerrit.ovirt.org/#/c/40557 ?
we might be able to fix this now that we have locking group for vm pools

Comment 8 Shmuel Melamud 2015-07-07 16:14:53 UTC
No. VM_POOL lock can be taken when the pool is already created and we know its guid. This is ok for pool updates. To avoid creation of two pools with the same name in the same time we need to lock pool name. So we need VM_POOL_NAME lock in addition to VM_POOL lock like we have VM_NAME lock in addition to VM lock.

Comment 9 Michael Burman 2015-08-23 10:42:27 UTC
Verified on - 3.6.0-0.12.master.el6