Bug 1344112

Summary: Migration from 5.4 to 5.6.0.10 with replication fails
Product: Red Hat CloudForms Management Engine Reporter: luke couzens <lcouzens>
Component: ApplianceAssignee: Nick Carboni <ncarboni>
Status: CLOSED ERRATA QA Contact: luke couzens <lcouzens>
Severity: high Docs Contact:
Priority: high    
Version: 5.6.0CC: abellott, cpelland, gtanzill, jhardy, jkrocil, lcouzens, mfeifer, ncarboni, obarenbo, simaishi
Target Milestone: GA   
Target Release: 5.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: black:upgrade:replication
Fixed In Version: 5.6.0.11 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-29 16:07:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 3 Nick Carboni 2016-06-10 18:49:10 UTC
https://github.com/ManageIQ/manageiq/pull/9177 will fix the region 99 case

Comment 4 Nick Carboni 2016-06-10 19:23:49 UTC
https://github.com/ManageIQ/manageiq/pull/9178 will fix the region 0 case

Comment 6 CFME Bot 2016-06-13 18:28:12 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/72784547cbe2d624162ddb82aa209c0b8b52432a

commit 72784547cbe2d624162ddb82aa209c0b8b52432a
Author:     Nick Carboni <ncarboni>
AuthorDate: Fri Jun 10 14:42:17 2016 -0400
Commit:     Nick Carboni <ncarboni>
CommitDate: Fri Jun 10 15:19:35 2016 -0400

    Reset the column cache after adding default_miq_group_id to tenants
    
    Before this change, rails was not aware of the column if it was
    added in the same process that it was queried in.
    
    Specifically, the column cache is not reset after the `add_column` call;
    so for 20151021174140_assign_tenant_default_group.rb to work properly
    we need to reset the info manually via `Tenant.reset_column_information`.
    
    For example, the column would be added, but when we tried to set the
    value in 20151021174140_assign_tenant_default_group.rb we would
    silently fail or get a backtrace with:
    
    `99000000000001 is out of range for ActiveModel::Type::Integer with limit 4`
    
    After this change, the column value is set correctly.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1344112

 db/migrate/20151021174044_add_tenant_default_group.rb | 3 +++
 1 file changed, 3 insertions(+)

Comment 7 CFME Bot 2016-06-13 18:28:17 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/9debfda96e74eb1fea2e358cac294f04b5f01ed8

commit 9debfda96e74eb1fea2e358cac294f04b5f01ed8
Author:     Nick Carboni <ncarboni>
AuthorDate: Fri Jun 10 15:06:02 2016 -0400
Commit:     Nick Carboni <ncarboni>
CommitDate: Fri Jun 10 16:11:35 2016 -0400

    Don't run a rake task from the host_storages migration
    
    This migration was created to fix some issues associated with adding
    and assigning a primary key when replication is enabled.
    
    `prepare_replication_without_sync` attempts to retrieve the replication
    worker settings; which as of #7432, requires the `settings_changes` table
    be present. This command will now fail because that table is added
    in a later migration.
    
    Removing this command will not cause an issue as rubyrep accounts for
    all unconfigured tables at first startup. We could also require running
    `rake evm:dbsync:prepare_replication_without_sync` after migration during
    upgrades.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1344112

 db/migrate/20151208150956_fix_host_storage_replication_on_upgrade.rb   | 2 --
 .../20151208150956_fix_host_storage_replication_on_upgrade_spec.rb     | 3 ---
 2 files changed, 5 deletions(-)

Comment 8 Marianne Feifer 2016-06-14 15:07:27 UTC
Do changes need to be made to https://access.redhat.com/articles/2327481?

Comment 9 Nick Carboni 2016-06-14 15:40:54 UTC
Nope, this was all fixed in the migrations

Comment 11 luke couzens 2016-06-16 14:00:56 UTC
Verified in 5.6.0.11

Comment 14 errata-xmlrpc 2016-06-29 16:07:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1348