Description of problem: wlovins reported on #spacewalk on freenode: I'm doing a Spacewalk 1.0 -> 1.2 ugprade and I've run into a problem. The schema upgrade failed on migration 210-rhnPackage-indexes.sql (in the spacewalk-schema-1.1-to-spacewalk-schema-1.2 directory). All of the 1.0 -> 1.1 migrations ran fine, but this one fails with: drop index rhn_package_path_idx with an ORA-02429 error (cannot drop index used for enforcement of unique/primary key). Version-Release number of selected component (if applicable): Upgrade 1.0 -> 1.2. How reproducible: wlovins has seen it. Steps to Reproduce: 1. Run spacewalk-schema-upgrade. Actual results: SQL> select 'spacewalk-schema-1.1-to-spacewalk-schema-1.2/209-rhnErrataClonedTmp-indexes.sql' from dual; 'SPACEWALK-SCHEMA-1.1-TO-SPACEWALK-SCHEMA-1.2/209-RHNERRATACLONEDTMP-INDEXES.SQ ------------------------------------------------------------------------------- spacewalk-schema-1.1-to-spacewalk-schema-1.2/209-rhnErrataClonedTmp-indexes.sql SQL> SQL> drop index rhn_eclonedtmp_teid_feid_idx; Index dropped. SQL> SQL> commit; Commit complete. SQL> set echo on SQL> spool /var/log/spacewalk/schema-upgrade/20101212-133124-to-spacewalk-schema-1.2.log append SQL> whenever sqlerror exit sql.sqlcode SQL> select 'spacewalk-schema-1.1-to-spacewalk-schema-1.2/210-rhnPackage-indexes.sql' from dual; 'SPACEWALK-SCHEMA-1.1-TO-SPACEWALK-SCHEMA-1.2/210-RHNPACKAGE-INDEXES.SQ ----------------------------------------------------------------------- spacewalk-schema-1.1-to-spacewalk-schema-1.2/210-rhnPackage-indexes.sql SQL> SQL> drop index rhn_package_id_nid_paid_idx; Index dropped. SQL> drop index rhn_package_path_idx; drop index rhn_package_path_idx * ERROR at line 1: ORA-02429: cannot drop index used for enforcement of unique/primary key Disconnected from Oracle Database 11g Release 11.2.0.1.0 - 64bit Production Upgrade failed, please see log in [/var/log/spacewalk/schema-upgrade/]. Expected results: No errors. Additional info:
John reports to have hit this issue during upgrade from 0.7 to 1.2: https://www.redhat.com/archives/spacewalk-list/2011-January/msg00028.html
I'm not sure why in some cases primary / unique constraint takes a different index than usually. Fixed in spacewalk git by commit 339c842924037eff31b50ec8ea490e4ed59ea3fe 662563 - in 0.7 rhn_sndpb_pid_ptype_idx was used for rhn_sndpb_probe_id_pk enforcement we need to disable and re-enable primary key so it will create it's own index instead of dropped one commit 676f5dbf2cae684a0a2a819a3c563cb8c1282603 662563 - in 0.7 rhn_efilectmp_cid_efid_idx was used for rhn_efilectmp_efid_cid_uq enforcement we need to disable and re-enable unique key so it will use a different index instead of dropped one commit db6631a53c328238d2189cabbf2221fbc70dfe79 662563 - in 0.7 web_contact_id_oid_cust_luc was used for web_contact_pk enforcement we need to disable and re-enable primary key so it will create it's own index instead of dropped one commit 76ea1d5ae412252d446b53c03ebab4601793168d 662563 - in 0.7 rhn_package_path_idx was used for rhn_package_id_pk enforcement we need to disable and re-enable rhn_package_id_pk so it will create it's own index instead of dropped one
Moving ON_QA ...
This bug has been fixed in Spacewalk 1.3.