Bug 896552 - Upgrade should set SEQUENCE number to the correct value.
Upgrade should set SEQUENCE number to the correct value.
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.2.0
Unspecified Linux
unspecified Severity medium
: ---
: 3.2.0
Assigned To: Eli Mesika
Pavel Stehlik
infra
:
Depends On:
Blocks: 915537
  Show dependency treegraph
 
Reported: 2013-01-17 09:23 EST by Eli Mesika
Modified: 2016-02-10 14:43 EST (History)
10 users (show)

See Also:
Fixed In Version: sf5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 11153 None None None Never

  None (edit)
Description Eli Mesika 2013-01-17 09:23:57 EST
Description of problem:
Table sequences may get out of sync after database is restored.
We had that in  a customer database, the sequence value for generating option_id for vdc_options was 238 while the max(option_id) was 399. That resulted of course with PK violation.

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


How reproducible:
Sometimes (hard to reproduce)


Steps to Reproduce:
1.
2.
3.
  
Actual results:
PK violation

Expected results:
We must validate correct SEQUENCE numbers in pre-upgrade step

Additional info:
http://www.postgresql.org/docs/8.4/static/sql-createsequence.html

Update the sequence value after a COPY FROM:

BEGIN;
COPY distributors FROM 'input_file';
SELECT setval('serial', max(id)) FROM distributors;
END;
Comment 1 Eli Mesika 2013-01-17 09:39:35 EST
http://gerrit.ovirt.org/#/c/11153/
Comment 4 Eli Mesika 2013-01-20 06:00:29 EST
fixed in commit: f3d3f85
Comment 6 Itamar Heim 2013-06-11 05:49:25 EDT
3.2 has been released
Comment 7 Itamar Heim 2013-06-11 05:49:32 EDT
3.2 has been released
Comment 8 Itamar Heim 2013-06-11 05:57:44 EDT
3.2 has been released

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