Bug 896552

Summary: Upgrade should set SEQUENCE number to the correct value.
Product: Red Hat Enterprise Virtualization Manager Reporter: Eli Mesika <emesika>
Component: ovirt-engineAssignee: Eli Mesika <emesika>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Stehlik <pstehlik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.2.0CC: acathrow, dyasny, hateya, iheim, lpeer, Rhev-m-bugs, sgrinber, yeylon, ykaul, yzaslavs
Target Milestone: ---   
Target Release: 3.2.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard: infra
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: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 915537    

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