Bug 1320774 - [RFE] Add support to specify metadata on column to be able to use comma separated list of values during search
Summary: [RFE] Add support to specify metadata on column to be able to use comma separ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.6.3
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ovirt-4.1.1
: ---
Assignee: Ravi Nori
QA Contact: Lucie Leistnerova
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-24 01:07 UTC by Germano Veit Michel
Modified: 2019-10-10 11:42 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-04-25 00:55:34 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:
lsvaty: testing_plan_complete+


Attachments (Terms of Use)
Screenshot of the bug (75.89 KB, image/png)
2016-03-24 01:07 UTC, Germano Veit Michel
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:0997 0 normal SHIPPED_LIVE Red Hat Virtualization Manager (ovirt-engine) 4.1 GA 2017-04-18 20:11:26 UTC
oVirt gerrit 59123 0 master MERGED core: comma separated list of values in search 2016-06-22 10:28:47 UTC
oVirt gerrit 59621 0 ovirt-engine-4.0 ABANDONED core: comma separated list of values in search 2016-06-22 12:17:13 UTC

Description Germano Veit Michel 2016-03-24 01:07:05 UTC
Created attachment 1139807 [details]
Screenshot of the bug

Description of problem:
When using shared ISO Domain among 2+ Data Centers, the ISO domain itself does not appear under the storage tab for each data center. Please see attached screenshot. I am unable to thing of any reason for not showing it, is there one or this is indeed a bug?

Version-Release number of selected component (if applicable):
Red Hat Enterprise Virtualization Manager Version: 3.6.3.4-0.1.el6

How reproducible:
Always

Steps to Reproduce:
1. Create two Data Centers
2. Attach same ISO domain to Both
3. Using the Tree View, click on storage for a specific cluster

Actual results:
ISO Domain not shown in storage tab

Expected results:
ISO Domain shows in storage tab

Comment 1 Germano Veit Michel 2016-03-24 22:51:21 UTC
Hello Tal,

Thanks for looking at this.

Do you need anything from me? I see the needinfo flag. Perhaps your message did not come through.

Regards,
Germano

Comment 2 Tal Nisan 2016-03-28 07:02:52 UTC
Hi Germano,
It was set by mistake, I will try to reproduce soon and will contact you if I will have any further questions, thanks!

Comment 3 Yaniv Lavi 2016-05-09 11:05:22 UTC
oVirt 4.0 Alpha has been released, moving to oVirt 4.0 Beta target.

Comment 8 Maor 2016-06-06 16:45:40 UTC
looks like the table storage_domains_for_search we use in the search backend is "array_to_string(array_agg(storage_pool.name), ','::text) AS pool_names"

So the Data Center names for a shared ISO returns multiple names like "DC1,DC2"

The search query uses this kind of search :
  WHERE storage_domains_for_search.storage_pool_name::text ILIKE '%SomeName%'

and since the storage_pool_name is DC1,DC2 it never returns true.

Comment 9 Maor 2016-06-06 16:59:45 UTC
The select phrase should be as follow: 

SELECT * FROM ((SELECT distinct storage_domains_for_search.* FROM  storage_domains_for_search   WHERE 'DataCenter' ILIKE  ANY(string_to_array(storage_domains_for_search.storage_pool_name, ',')) )  ORDER BY storage_name ASC ) as T1 OFFSET (1 -1) LIMIT 100;

Comment 10 Maor 2016-06-06 17:02:39 UTC
(In reply to Maor from comment #9)
> The select phrase should be as follow: 
> 
> SELECT * FROM ((SELECT distinct storage_domains_for_search.* FROM 
> storage_domains_for_search   WHERE 'DataCenter' ILIKE 
> ANY(string_to_array(storage_domains_for_search.storage_pool_name, ',')) ) 
> ORDER BY storage_name ASC ) as T1 OFFSET (1 -1) LIMIT 100;

Eli, any chance the serachbackend can support that?

Comment 11 Eli Mesika 2016-06-07 09:28:22 UTC
I have consulted with Martin P about that.
Seems as an engine issue that should be addressed generally by core
We will add an option to define additional metadata on columns that defined them as delimiter separated values and then we will apply the syntax that will make the query match with ANY of those values

Comment 12 Eli Mesika 2016-06-09 11:51:12 UTC
After reproducing the problem and debugging, it seems not correct to solve it in the Search Engine domain:

When selecting a storage under a data center dc1 for example from the tree, the tree constructs a search request with the following parameters :

SearchParameters:{refresh='true', filtered='false', searchType='StorageDomain', searchPattern='Storage: datacenter = dc1 ', caseSensitive='false', from='0', max='100'}

So, datacenter = dc1 is passed by the tree...
It will be not correct to hack this value in the content of the Search Engine code 

The real origin of the problem is the definition of the storage_domains_for_search view which in the case described in BZ description field has the following record 

id                             | c377718f-afaf-4a98-8dc3-74ac1dfd4f93
storage                        | e5ff1244-36d4-4aa7-af6c-95f454da33e2
storage_name                   | ISO
storage_description            |
storage_comment                |
storage_type                   | 1
storage_domain_type            | 2
storage_domain_format_type     | 0
last_time_used_as_master       | 0
wipe_after_delete              | f
status                         |
storage_pool_id                |
storage_pool_name              | dc1,dc2
available_disk_size            | 93
used_disk_size                 | 5
commited_disk_size             |
actual_images_size             |
storage_domain_shared_status   | 2
recoverable                    | t
contains_unregistered_entities | f
warning_low_space_indicator    | 10
critical_space_action_blocker  | 5
external_status                | 0

The problem is actually in the storage_pool_name field where we have the value 'dc1,dc2'

IMO, the view should be changed to generate one record per DC , for example , for the data above :

id                             | c377718f-afaf-4a98-8dc3-74ac1dfd4f93
storage                        | e5ff1244-36d4-4aa7-af6c-95f454da33e2
storage_name                   | ISO
storage_description            |
storage_comment                |
storage_type                   | 1
storage_domain_type            | 2
storage_domain_format_type     | 0
last_time_used_as_master       | 0
wipe_after_delete              | f
status                         |
storage_pool_id                |
storage_pool_name              | dc1
available_disk_size            | 93
used_disk_size                 | 5
commited_disk_size             |
actual_images_size             |
storage_domain_shared_status   | 2
recoverable                    | t
contains_unregistered_entities | f
warning_low_space_indicator    | 10
critical_space_action_blocker  | 5
external_status                | 0

id                             | c377718f-afaf-4a98-8dc3-74ac1dfd4f93
storage                        | e5ff1244-36d4-4aa7-af6c-95f454da33e2
storage_name                   | ISO
storage_description            |
storage_comment                |
storage_type                   | 1
storage_domain_type            | 2
storage_domain_format_type     | 0
last_time_used_as_master       | 0
wipe_after_delete              | f
status                         |
storage_pool_id                |
storage_pool_name              | dc2
available_disk_size            | 93
used_disk_size                 | 5
commited_disk_size             |
actual_images_size             |
storage_domain_shared_status   | 2
recoverable                    | t
contains_unregistered_entities | f
warning_low_space_indicator    | 10
critical_space_action_blocker  | 5
external_status                | 0

This will solve the issue and show the shared ISO domain in both DC storage tab.

Allon, what do you think ?

Comment 13 Eli Mesika 2016-06-09 14:36:49 UTC
We found another place in which this occur, when a disk is shared by 2 VMs
I will try to find a solution in the context of the Search Engine

Comment 14 Lucie Leistnerova 2017-01-10 14:55:19 UTC
relevant test cases: RHEVM-17577, RHEVM-17578

Comment 16 Lucie Leistnerova 2017-01-23 13:10:12 UTC
Search with '=' operator works fine, shared storage/disk is shown and only once. So the link on Storages from left tree menu works.

Search with '!=' operator fails on Storage: datacenter != Default and datacenter != dc2 - shared storage is shown in result, but should not be.
The same is for shared disk and search Disks: vm_names != vm-test1 and vm_names != vm-test2 fails.

tested in ovirt-engine-4.1.0.2-0.1.el7.noarch

Comment 18 Martin Perina 2017-01-26 20:49:39 UTC
Negated comparisons fix is tracked by BZ1252906 currently targeted to 4.2. Original reasoning of this bug doesn't mention negated comparisons, so moving back to ON_QA.

Comment 19 Lucie Leistnerova 2017-01-27 09:44:25 UTC
according to Comment 18

verified in ovirt-engine-4.1.0.2-0.1.el7.noarch


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