Bug 2051462 - Unable to correctly search for User field in Advanced view of Events pane
Summary: Unable to correctly search for User field in Advanced view of Events pane
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Search-Backend
Version: 4.4.10.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.5.0
: 4.5.0.1
Assignee: Eli Mesika
QA Contact: Guilherme Santos
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-07 10:13 UTC by Gianluca Cecchi
Modified: 2022-04-28 09:26 UTC (History)
3 users (show)

Fixed In Version: ovirt-engine-4.5.0.1
Doc Type: Bug Fix
Doc Text:
Cause: search by user not supported in advanced event view due to value mismatch in DB Consequence: Fix: Add search vy user_and_domain in advanced event view Result: problem solved
Clone Of:
Environment:
Last Closed: 2022-04-28 09:26:34 UTC
oVirt Team: Infra
Embargoed:
mperina: ovirt-4.5+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt ovirt-engine pull 175 0 None Merged fix BZ 2051462 tests 2022-03-21 12:59:39 UTC
Github oVirt ovirt-engine pull 83 0 None Merged Fix advanced event search by user 2022-03-21 12:59:53 UTC
Red Hat Issue Tracker RHV-44632 0 None None None 2022-02-07 10:16:42 UTC

Description Gianluca Cecchi 2022-02-07 10:13:34 UTC
Description of problem:

In web admin GUI every event in Advanced view has a field "User".
I'm trying to compose a search in web admin of events with user different from myuser@internal
It seems I'm not able to get what I want.

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


How reproducible:


Steps to Reproduce:
1. login in web admin
2. select Events pane and then advanced view
3. try to search for users or not users

Actual results:

you get nothing

Expected results:

filtered events based on positive or negative searches about username


Additional info:

Comment 1 RHEL Program Management 2022-02-07 10:22:21 UTC
The documentation text flag should only be set after 'doc text' field is provided. Please provide the documentation text and set the flag to '?' again.

Comment 2 Eli Mesika 2022-02-09 10:41:05 UTC
The cause of this problem is that the events advanced view get its data from two tables :

audit_log
vdc_users_with_tags

The search engine joins those tables based on the user_id  
However while in audit_log the user_name column is of the format <username@domain> (for example admin@internal) 
in vdc_users_with_tags the corresponding name column is of the format <username> only (without @domain for example admin)
This cause empty results when searching for a <user@domain> format because only <user> exists in the vdc_users_with_tags joined table 

I see no easy fix for that.

I am thinking about 

Option A

1. Adjusting name in vdc_users_with_tags to have  <username@domain> format
2. Remove the domain from vdc_users_with_tags
3. Handle DB upgrade 
4. Adjusting search engine to work with that



Option B

1. Renaming the current "User" in events advanced view to domain and display only the domain name (i.e. "internal" for example)
2. renaming audit_log:user_name to be something like user_name_and_domain (this will not be retrieved)
3. Adding a computed user_name  DB column on audit_log table displaying only the user part of user_name_and_domain
4. Adding a computed user_domain  DB column on audit_log table displaying only the domain part of user_name_and_domain
5. Handle DB upgrade
6. Adjusting search engine to work with that

Any other idea ?


In both we should do cross project tests to verify that we don't have backward compatibility issues

Comment 3 Eli Mesika 2022-02-16 09:32:27 UTC
Solution suggests adding a 'user_and_domain' column to the users table , include it in 'vdc_users' and 'vdc_users_with_tags' views and enhance the search engine mechanism to support this column.
In addition, renaming for clarity the 'User' column in the Events Advance View to be 'User & Domain'

Comment 6 Sandro Bonazzola 2022-04-28 09:26:34 UTC
This bugzilla is included in oVirt 4.5.0 release, published on April 20th 2022.

Since the problem described in this bug report should be resolved in oVirt 4.5.0 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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