Bug 896552 - Upgrade should set SEQUENCE number to the correct value.
Summary: Upgrade should set SEQUENCE number to the correct value.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.2.0
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
: 3.2.0
Assignee: Eli Mesika
QA Contact: Pavel Stehlik
URL:
Whiteboard: infra
Depends On:
Blocks: 915537
TreeView+ depends on / blocked
 
Reported: 2013-01-17 14:23 UTC by Eli Mesika
Modified: 2016-02-10 19:43 UTC (History)
10 users (show)

Fixed In Version: sf5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 11153 0 None None None Never

Description Eli Mesika 2013-01-17 14:23:57 UTC
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 14:39:35 UTC
http://gerrit.ovirt.org/#/c/11153/

Comment 4 Eli Mesika 2013-01-20 11:00:29 UTC
fixed in commit: f3d3f85

Comment 6 Itamar Heim 2013-06-11 09:49:25 UTC
3.2 has been released

Comment 7 Itamar Heim 2013-06-11 09:49:32 UTC
3.2 has been released

Comment 8 Itamar Heim 2013-06-11 09:57:44 UTC
3.2 has been released


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