Bug 1468313 - Creating a new Pool fails if 'Auto select target' check box is enabled and the created Pool is based on a Template with at least two disks from the same Data Domain
Summary: Creating a new Pool fails if 'Auto select target' check box is enabled and th...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ovirt-4.1.5
: 4.1.5.2
Assignee: Sharon Gratch
QA Contact: Nisim Simsolo
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-06 16:17 UTC by Sharon Gratch
Modified: 2017-08-23 08:07 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-08-23 08:07:01 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.1+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 79301 0 master MERGED core: create Pool with 'auto select target' on disks with identical DD 2021-02-19 16:08:32 UTC

Description Sharon Gratch 2017-07-06 16:17:39 UTC
Description of problem:
Trying to create new Pool based on a Template with at least two disks from the same Data Domain (same Target) and checking the 'Auto select target' check box (in 'Resource Allocation' side tab), causes the whole pool creation to fail with the following error:
ERROR [org.ovirt.engine.core.bll.AddVmPoolCommand] (default task-61) [2cc7a883-e071-4198-98af-868344152e44] Error during ValidateFailure.: java.lang.IllegalStateException: Duplicate key StorageDomain


Version-Release number of selected component (if applicable):
4.2 master

How reproducible:
100%

Steps to Reproduce:
1.Open a new Pool dialog
2.Select a Template with at least two disks from the same Data Domain (Target).
3. Go to 'Resource Allocation' side tab and check the 'Auto select target' check box.

Actual results:
The Pool creation fails.

Expected results:
Pool creation should succeed. 


Additional info:
This bug is because of invalid using of Java Streams in ImagesHandler (done as part of a re-factoring patch in 6/6/17):
stream().collect(Collectors.toMap(<non unique/distinct keys list>, values)) - it was assumed it will take the last key in the stream, but instead it fails the whole state with "Duplicate key" error.

Comment 1 Sharon Gratch 2017-07-06 16:18:37 UTC
I have a patch ready for master branch for fixing this bug

Comment 2 Tomas Jelinek 2017-07-12 06:38:43 UTC
patch seems to be trivial - targeting 4.1.6

Comment 3 Sharon Gratch 2017-07-16 10:34:49 UTC
Tomas, 
can we set Target Milestone to 4.1.5 (since a patch for master was merged already)?

Comment 4 Sharon Gratch 2017-07-19 12:04:20 UTC
This bug was caused due to a re-factoring patch - commit number: a6d29adf20b905.
Since this re-factoring patch was not back-ported to 4.1, the problem is not reproduced on 4.1.z and therefor this bug can me marked as MODIFIED without the need to back-port.
So changing status to MODIFIED.

Comment 5 rhev-integ 2017-07-28 12:16:10 UTC
INFO: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[No relevant external trackers attached]

For more info please contact: infra

Comment 6 Nisim Simsolo 2017-08-17 13:07:43 UTC
Verification builds:
ovirt-engine-4.1.5.2-0.1.el7
libvirt-client-3.2.0-14.el7_4.2.x86_64
vdsm-4.19.28-1.el7ev.x86_64
qemu-kvm-rhev-2.9.0-16.el7_4.3.x86_64
sanlock-3.5.0-1.el7.x86_64


Note You need to log in before you can comment on or make changes to this bug.