[racktables-users] Re: [racktables-users] Errors upgrading from 0.19.11 → 0.19.12 → 0.19.13

  • From: Denis Ovsienko <infrastation@xxxxxxxxx>
  • To: "racktables-users@xxxxxxxxxxxxx" <racktables-users@xxxxxxxxxxxxx>
  • Date: Tue, 21 Aug 2012 15:20:38 +0400

Hello, Tyler and list.

10.08.2012, 14:27, "Tyler J. Wagner" <tyler@xxxxxxxxxxx>:
> I upgraded from 0.19.11 to 0.19.13 yesterday. Attached are the upgrade
> errors. I manually resolved these, but they should be addressed.
>
> Executing batch '0.19.12' The following queries failed:
> INSERT INTO AttributeMap (objtype_id, attr_id, chapter_id) VALUES (965, 4,
> 37) -- Duplicate entry '965-4' for key 'objtype_id'
>
> This happens because "Wireless" objects previously used the Router OS
> dictionary, but now seem to have their own dictionary. One solution is to
> have the upgrade forceable switch this dictionary, unless the user has
> actually used entries. Otherwise there is no fix. At minimum it should be
> in the changelog to warn people.

AttributeMap upgrades don't always go smooth in the presence of local changes. 
There is no good idea how this can be ruled once and forever. How often does 
this specific error reproduce?

>
> Executing batch 'dictionary' The following queries failed:
>
> INSERT INTO Dictionary (dict_key, chapter_id, dict_value) VALUES (1691, 11,
> 'Dell PowerEdge%GPASS%R715'), (1692, 11, 'Dell PowerEdge%GPASS%R720'),
> (1693, 11, 'Dell PowerEdge%GPASS%R720xd'), (1694, 11, 'Dell
> PowerEdge%GPASS%R810'), (1695, 11, 'Dell PowerEdge%GPASS%R815'), (1696, 11,
> 'Dell PowerEdge (blade)%GPASS%M620'), (1697, 11, 'Dell PowerEdge
> (blade)%GPASS%M710HD'), (1698, 11, 'Dell PowerEdge (blade)%GPASS%M915'),
> (1699, 12, 'Dell PowerConnect (blade)%GPASS%M6348'), (1700, 12, 'Dell
> PowerConnect (blade)%GPASS%M8428'), (1701, 13, '[[RH Fedora%GSKIP%Fedora 16
> | http://docs.fedoraproject.org/en-US/Fedora/16/html/Release_Notes/]]'),
> (1702, 12, 'Dell PowerConnect%GPASS%8024'), (1703, 12, 'Dell
> PowerConnect%GPASS%8024F'), (1704, 13, 'Ubuntu%GSKIP%Ubuntu 10.04 LTS'),
> (1705, 13, 'Ubuntu%GSKIP%Ubuntu 10.10'), (1706, 13, 'Ubuntu%GSKIP%Ubuntu
> 11.04'), (1707, 13, 'Ubuntu%GSKIP%Ubuntu 11.10'), (1708, 13,
> 'Ubuntu%GSKIP%Ubuntu 12.04 LTS'), (1709, 13, '[[Debian%GSKIP%Debian 7.0
> (wheezy) | http://debian.org/releases/wheezy/]]'), (49999, 13, '[[RH
> Fedora%GSKIP%Fedora 15 |
> http://docs.fedoraproject.org/release-notes/f15/en-US/html/]]') --
> Duplicate entry '13-Ubuntu%GSKIP%Ubuntu 10.04 LTS' for key 'chap_to_val'
>
> This happened because I already had local entries for recent Ubuntu
> releases that exactly matched the text used in the new dictionary updates.
> Solutions:
>
> 1. Don't require unique dictionary entries.

Just dropping the unique constraint would break a lot of things and isn't an 
option right now. But this situation can be resolved with an additional field 
in the table and updated constraint, so that the rows are unique within their 
respective ranges (system/user) rather that in the whole table. I have filed 
ticket 593 on your behalf.

> 2. Identify textual collisions and append a " (local)" to existing entries
> before adding the new values.
> 3. Run the insert statements separately so only the collision insertion
> fails, instead of all of them. I had to manually insert all the missing
> entries.

These were run one-by-one before, and the whole process could take 30 seconds 
and more for a single release, even with a local MySQL server. This grouping 
made it fit into like 5 seconds. The change above should be the solution.

-- 
    Denis Ovsienko

Other related posts:

  • » [racktables-users] Re: [racktables-users] Errors upgrading from 0.19.11 → 0.19.12 → 0.19.13 - Denis Ovsienko