Bug 1362459

Summary: Fix our own implementation uuid_generate_v1() to produce more random values
Product: [oVirt] ovirt-engine Reporter: Eli Mesika <emesika>
Component: Database.CoreAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: Eli Mesika <emesika>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.0.0CC: bugs, emesika, gklein, mgoldboi, mperina
Target Milestone: ovirt-4.0.4Keywords: CodeChange
Target Release: 4.0.4Flags: rule-engine: ovirt-4.0.z+
rule-engine: ovirt-4.1+
mgoldboi: planning_ack+
mperina: devel_ack+
pstehlik: testing_ack+
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: 2016-09-26 10:55:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eli Mesika 2016-08-02 09:04:04 UTC
Description of problem:

Current implementation of UUID generation can generate duplicate UUIDs.

We used our own UUID generation since in the past we had to support both PG 8.x and PG 9.x 
Since now we are supporting only PG 9.x, we can go back to use PG native support of UUID generation.


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


How reproducible:

Happens from time to time in Jenkins CI tests, no exact scenario 


Steps to Reproduce:
1.
2.
3.

Actual results:
Algorithm may generate duplicate UUIDs 

Expected results:
Algorithm should not generate duplicate UUIDs 


Additional info:

Comment 1 Eli Mesika 2016-08-14 08:12:49 UTC
Using PG native uuid_generate_vX() functions requires installing an extension to PG which can be done only with an admin user on the database.
This is relatively complex and can be done only on a local provisioned database.
I would suggest instead to improve the randomness of our UUID generation function such that it will not generate duplicate values.

Changing the bug subject accordingly

Comment 2 Martin Perina 2016-08-25 19:45:04 UTC
Removing RFE as we have only reimplemented our own uuid_generate_v1() implementation to produce more random values (instead of replacing it with postgresql extension uuid-ossp) and targeting to 4.0.4 to suppress regular duplicate UUID issues seen on db upgrade jobs on Jenkins.

Comment 3 Pavel Stehlik 2016-09-06 12:10:39 UTC
So this looks like CodeChange - if so nothing for QE.

Comment 4 Martin Perina 2016-09-07 06:56:34 UTC
This issue of duplicate UUIDs during db upgrade is visible only on Jenkins, so yeah no need for QA testing, marking as CodeChange.

Comment 5 Gil Klein 2016-09-26 10:55:47 UTC
Closed as a Code change based on comment #4