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: ----------------
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.*)"
PR for the fix https://github.com/ManageIQ/manageiq/pull/12757
PR merged.
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(-)
Verified in 5.8.0.4