Bug 2002642

Summary: [RFE] ovsdb-server: Use table indexes (other than UUID) for ovsdb_query()
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Ilya Maximets <i.maximets>
Component: ovsdb2.16Assignee: OVS RFE <ovs-rfe>
Status: CLOSED EOL QA Contact: ovs-qe
Severity: medium Docs Contact:
Priority: medium    
Version: RHEL 8.0CC: ctrautma, jhsiao, ralongi
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-10-08 17:49:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ilya Maximets 2021-09-09 12:21:48 UTC
While executing transaction, OVSDB needs to find a row where changes
need to be applied.  Currently, if condition is not a match on a
row UUID, linear lookup through the table will be performed.  See the
implementation of 'ovsdb_query()' function.

However, ovsdb-server maintains hash tables for client-side indexes
specified in the database schema, and these can be used instead of a
linear lookup, if condition contains exact match on one of the indexed
columns.

Though conventional database utilities based on C and Python IDL are
using UUIDs in most cases in transaction, some other clients may perform
transactions with arbitrary conditions.  So, it would be nice to have
this use case better optimized.

Example of operation that triggers an indexed lookup:

 "where":[["_uuid","==",["uuid","<UUID of the logical switch row>"]]],
 "mutations":[["ports","insert",["set",[["named-uuid","rowUUID"]]]]],
 "op":"mutate","table":"Logical_Switch"

And operation that triggers a linear lookup even if the 'name' will be a
client-side index according to a database schema ("indexes": [["name"]]):

 "where":[["name","==","<host-name>"]],
 "mutations":[["ports","insert",["set",[["named-uuid","rowUUID"]]]]],
 "op":"mutate","table":"Logical_Switch"

Comment 1 ovs-bot 2024-10-08 17:49:14 UTC
This bug did not meet the criteria for automatic migration and is being closed.
If the issue remains, please open a new ticket in https://issues.redhat.com/browse/FDP