Bug 1339303

Summary: Events portion of database bloats on migration of 5.4 to 5.5 (ems_events to event_streams)
Product: Red Hat CloudForms Management Engine Reporter: Alex Krzos <akrzos>
Component: ApplianceAssignee: Lucy Fu <lufu>
Status: CLOSED ERRATA QA Contact: Alex Krzos <akrzos>
Severity: medium Docs Contact:
Priority: high    
Version: 5.5.0CC: abellott, cpelland, hhudgeon, jhardy, jprause, lbopf, lufu, mfeifer, obarenbo, simaishi
Target Milestone: GA   
Target Release: 5.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: migration:database:event
Fixed In Version: 5.6.0.10 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1342586 1342612 (view as bug list) Environment:
Last Closed: 2016-06-29 16:05:26 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:
Bug Depends On:    
Bug Blocks: 1342586, 1342612    

Description Alex Krzos 2016-05-24 15:52:20 UTC
Description of problem:
Ran db:migrate on a large database and the ems_events table bloated ~9GiB in size after the migration


Before:
# SELECT pg_size_pretty(pg_database_size('vmdb_production'));
 pg_size_pretty
----------------
 25 GB

After db:migrate:
# SELECT pg_size_pretty(pg_database_size('vmdb_production'));
 pg_size_pretty
----------------
 37 GB

The bloat appears mostly to be introduced from events:
Before:
ems_events - 8854 MB

After db:migrate:
event_streams - 17GB


Version-Release number of selected component (if applicable):
5.5.4.1

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

This is a side affect noticed in https://bugzilla.redhat.com/show_bug.cgi?id=1337159

Comment 6 CFME Bot 2016-06-02 20:21:16 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/47c93b3fecb87c3a137acd17650eea5624935726

commit 47c93b3fecb87c3a137acd17650eea5624935726
Author:     Lucy Fu <lufu>
AuthorDate: Thu Jun 2 11:25:28 2016 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Thu Jun 2 11:52:48 2016 -0400

    Changes to improve the migration performance on EventStream.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1339303

 db/migrate/20160307205816_fix_event_class_for_evm_alert_event.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 7 CFME Bot 2016-06-02 20:21:20 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/92aa7df7aba236d4a72ff1aa4fef987dd677b3a3

commit 92aa7df7aba236d4a72ff1aa4fef987dd677b3a3
Author:     Lucy Fu <lufu>
AuthorDate: Thu Jun 2 11:25:02 2016 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Thu Jun 2 11:52:48 2016 -0400

    Changes to improve the migration time for EmsEvent -> EventStream.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1339303

 .../20150806211453_rename_ems_event_table_to_event_stream.rb     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comment 10 Lucy Bopf 2016-06-03 02:15:33 UTC
Moving to NEW to be assigned as the schedule allows.

Comment 12 CFME Bot 2016-06-03 17:17:31 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=0cc70a9b3cfa71885c2333b4a3382939060e3bd8

commit 0cc70a9b3cfa71885c2333b4a3382939060e3bd8
Author:     Lucy Fu <lufu>
AuthorDate: Thu Jun 2 11:25:02 2016 -0400
Commit:     Lucy Fu <lufu>
CommitDate: Fri Jun 3 12:03:58 2016 -0400

    Changes to improve the migration time for EmsEvent -> EventStream.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1339303

 .../20150806211453_rename_ems_event_table_to_event_stream.rb     | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comment 16 errata-xmlrpc 2016-06-29 16:05:26 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