Bug 1394423 - Daily rollups fail for C&U gap collection
Summary: Daily rollups fail for C&U gap collection
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: C&U Capacity and Utilization
Version: 5.7.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.8.0
Assignee: James Wong
QA Contact: Nandini Chandra
URL:
Whiteboard: c&u
Depends On:
Blocks: 1399672
TreeView+ depends on / blocked
 
Reported: 2016-11-11 23:16 UTC by Nandini Chandra
Modified: 2017-06-12 17:49 UTC (History)
4 users (show)

Fixed In Version: 5.8.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1399672 (view as bug list)
Environment:
Last Closed: 2017-06-12 17:49:17 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
evm.log (3.16 MB, text/plain)
2016-11-17 22:57 UTC, James Wong
no flags Details

Description Nandini Chandra 2016-11-11 23:16:54 UTC
Description of problem:
-----------------------
I ran a gap collection on vSphere 6.0 for a week.The data was collected for VMs and hosts, but the daily rollups didn't happen and I don't see daily records in the DB.


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


How reproducible:
-----------------
Always


Steps to Reproduce:
-------------------
1.Run C&U gap collection for a week or so for a vSphere provider.


Actual results:
---------------
Daily rollups fail for C&U gap collection.


Expected results:
-----------------
Daily rollups should succeed for C&U gap collection.


Additional info:
----------------

Comment 4 James Wong 2016-11-17 22:57:56 UTC
Created attachment 1221660 [details]
evm.log

I think I may have reproduced the problem.  It's failing at inserting to metric_rollups table and the error prevents daily rollups work from being queued.

=======================

[----] E, [2016-11-17T17:49:56.510882 #368:5f3138] ERROR -- : MIQ(MiqQueue#deliver) Message id: [622], Error: [PG::UniqueViolation: ERROR:  duplicate key value violates
unique constraint "metric_rollups_11_pkey"
DETAIL:  Key (id)=(102) already exists.
CONTEXT:  SQL statement "INSERT INTO metric_rollups_11 VALUES (NEW.*)"
PL/pgSQL function metric_rollups_inheritance_before() line 24 at SQL statement
: INSERT INTO "metric_rollups" ("id", "timestamp", "capture_interval", "resource_type", "resource_id", "cpu_usage_rate_average", "cpu_usagemhz_rate_average", "mem_usage_
absolute_average", "disk_usage_rate_average", "net_usage_rate_average", "sys_uptime_absolute_latest", "created_on", "derived_cpu_available", "derived_memory_available",
"derived_memory_used", "derived_vm_count_on", "derived_host_count_on", "derived_vm_count_off", "derived_host_count_off", "capture_interval_name", "assoc_ids", "cpu_ready
_delta_summation", "resource_name", "tag_names", "parent_ems_cluster_id", "parent_ems_id", "mem_vmmemctl_absolute_average", "derived_vm_numvcpus", "derived_host_sockets"
, "derived_host_count_total", "derived_vm_count_total") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23,
 $24, $25, $26, $27, $28, $29, $30, $31) RETURNING "id"]
[----] E, [2016-11-17T17:49:56.511066 #368:5f3138] ERROR -- : [ActiveRecord::RecordNotUnique]: PG::UniqueViolation: ERROR:  duplicate key value violates unique constrain
t "metric_rollups_11_pkey"
DETAIL:  Key (id)=(102) already exists.
CONTEXT:  SQL statement "INSERT INTO metric_rollups_11 VALUES (NEW.*)"

Comment 5 James Wong 2016-11-18 23:50:19 UTC
PR for the fix https://github.com/ManageIQ/manageiq/pull/12757

Comment 6 James Wong 2016-11-28 16:57:32 UTC
PR merged.

Comment 7 CFME Bot 2016-11-28 18:51:11 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/fc4ec3497bbb0387555330467cf1ae4c9ea1d02a

commit fc4ec3497bbb0387555330467cf1ae4c9ea1d02a
Author:     Adam Grare <agrare>
AuthorDate: Mon Nov 28 11:53:46 2016 -0500
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Mon Nov 28 13:45:21 2016 -0500

    Merge pull request #12757 from jameswnl/gap-metric
    
    Fix: add missing metric intervals failed with duplicated id
    (cherry picked from commit b115529c3147609ae8a63b763d23b591f89aa0aa)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1394423

 app/models/metric/processing.rb       | 47 +++++++++++++++++++++--------------
 spec/models/metric/processing_spec.rb | 28 +++++++++++++++++++++
 2 files changed, 57 insertions(+), 18 deletions(-)

Comment 9 Nandini Chandra 2017-03-21 16:32:49 UTC
Verified in 5.8.0.4


Note You need to log in before you can comment on or make changes to this bug.