Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Z. Othersmajoralways2008-07-21 10:472008-11-21 13:06
ReporterplujanView Statuspublic 
Assigned Toalostale 
PriorityurgentResolutionno change requiredFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version2.50
OSWindowsDatabasePostgreSQLJava versiondon't know
OS VersionXPsp2Database version8.3.3Ant versiondon't know
Product VersionpiSCM revision 
Review Assigned To
Web browser
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0004462: QA-UUID: Generated numbers are not unique on Windows/PostgreSQL

DescriptionAs reported here: [^]

there is an issue for PostgreSQL on Windows so UUIDs are not unique if generator function is called on a 15ms interval.
Steps To Reproduceon PGAdmin run next query:
select get_uuid()
select get_uuid();

on a Windows computer and on a Linux computer. On Linux, you will see two records (that means you got two different IDs) but on Windows you will see just one.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00050062.50 closedgmauleon Error: duplicate key value violates unique constraint "ad_field_trl_key" 
has duplicate defect 00053192.50 closedcromero Initial client setup process fails due duplicate key value ad_sequence_key 

-  Notes
alostale (developer)
2008-11-05 10:07

This problem is caused by the postgreSQL contrib library for windows that generates duplicated UUIDs when it is called twice in short periods of time. The issue 0005006 is a workarround for this problem, but could cause a performance decrement for process doing big amounts of insertions in database.
pjuvara (reporter)
2008-11-12 07:15

Downgrading severity since we have a workaround in place which enables basic functionality of the product and the alpha release of the product.
plujan (manager)
2008-11-13 17:14

This is not an actual Openbravo ERP issue but a PostgreSQL bug. It was solved since 8.3.5.
rafaroda (developer)
2008-11-21 13:04

Testing function:

CREATE OR REPLACE FUNCTION test_uuidgen(countmax INTEGER) RETURNS character varying AS
  countmin INTEGER := 1;
  distinctuuid bigint;
  v_message VARCHAR(2000) := '';
    drop table if exists uuid_gen;
    CREATE TABLE uuid_gen
      uuid_gen_col uuid NOT NULL
        INSERT INTO uuid_gen (uuid_gen_col) VALUES (uuid_generate_v1());
        countmin := countmin + 1;
        EXIT WHEN countmin > countmax;
    SELECT COUNT(DISTINCT uuid_gen_col) INTO distinctuuid FROM uuid_gen;
    IF distinctuuid <> countmax THEN
        v_message := 'Repeated UUID: FAILS';
        v_message := 'NO repeated UUID: OK';
    END IF;
    RETURN v_message;
$BODY$ LANGUAGE 'plpgsql';
rafaroda (developer)
2008-11-21 13:06

Add the previous function to your PostgreSQL database and execute:

select test_uuidgen(100000);

If no UUID are repeated you get as result 'NO repeated UUID: OK'

- Issue History
Date Modified Username Field Change
2008-07-21 10:47 plujan New Issue
2008-07-21 10:47 plujan Assigned To => cromero
2008-07-21 10:47 plujan sf_bug_id 0 => 2023360
2008-07-21 10:48 plujan Assigned To cromero => alostale
2008-07-21 10:48 plujan Summary QA-UUID: Generated numbers are not unique => QA-UUID: Generated numbers are not unique on Windows/PostgreSQL
2008-07-21 16:11 cromero Status new => scheduled
2008-07-21 16:11 cromero Target Version => 2.50
2008-10-10 11:31 cromero Relationship added has duplicate 0005006
2008-10-10 11:31 cromero Relationship deleted has duplicate 0005006
2008-10-10 11:32 cromero Relationship added has duplicate 0005319
2008-10-22 09:54 pjuvara Priority normal => immediate
2008-11-05 10:04 alostale Relationship added related to 0005006
2008-11-05 10:07 alostale Note Added: 0009988
2008-11-05 10:08 alostale Priority immediate => high
2008-11-12 07:15 pjuvara Note Added: 0010186
2008-11-12 07:15 pjuvara Priority high => urgent
2008-11-12 07:15 pjuvara Severity critical => major
2008-11-13 17:14 plujan Regression testing => No
2008-11-13 17:14 plujan Status scheduled => closed
2008-11-13 17:14 plujan Note Added: 0010253
2008-11-13 17:14 plujan Resolution open => no change required
2008-11-21 13:04 rafaroda Note Added: 0010502
2008-11-21 13:06 rafaroda Note Added: 0010503

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker