Skip to main content
Question

[24.10] MBI Statistics Rebuild not truncate all tables (centile) used during the rebuild.

  • August 6, 2026
  • 0 replies
  • 1 view

Forum|alt.badge.img+4

Hi,

I was asked to rebuild 2 days of my BI data, days 20260713 and 20260714 but it failed with PK error:

 


[root@rdy-cnt-bi]# /usr/share/centreon-bi/etl/perfdataStatisticsBuilder.pl -r -s $date_start -e $date_end --no-purge [395/1873]
2026-07-24 12:30:27 - INFO - [SCHEDULER] >>>>>>> start
2026-07-24 12:30:27 - INFO - [SCHEDULER][PERFDATA] >>>>>>> start
2026-07-24 12:30:29 - INFO - [PURGE] Truncate partition 20260713 on table [mod_bi_metricdailyvalue]
2026-07-24 12:30:29 - INFO - [PURGE] Truncate partition 20260714 on table [mod_bi_metricdailyvalue]
2026-07-24 12:30:29 - INFO - [PURGE] Truncate partition 20260713 on table [mod_bi_metriccentileweeklyvalue]
2026-07-24 12:30:29 - INFO - [PURGE] Truncate partition 20260714 on table [mod_bi_metriccentileweeklyvalue]
2026-07-24 12:30:29 - INFO - [PURGE] Truncate partition 20260713 on table [mod_bi_metrichourlyvalue]
2026-07-24 12:30:29 - INFO - [PURGE] Truncate partition 20260714 on table [mod_bi_metrichourlyvalue]
2026-07-24 12:30:29 - INFO - [PURGE] Truncate partition 20260713 on table [mod_bi_metriccentiledailyvalue]
2026-07-24 12:30:29 - INFO - [PURGE] Truncate partition 20260714 on table [mod_bi_metriccentiledailyvalue]
2026-07-24 12:30:31 - INFO - Processing week for Centile: [2026-07-06] to [2026-07-12] - 24x7 - 99.0000 (6010 metrics)
2026-07-24 12:30:31 - ERROR - SQL error: Duplicate entry '12379844-1-1783306800-99.0000' for key 'PRIMARY' (caller: gorgone::modules::centreon::mbi::libs::bi::MetricCentileValue:/usr/share/perl5/vendor_perl/gorgone/modules/centreon/mbi
/libs/bi/MetricCentileValue.pm:176)
Query: INSERT INTO mod_bi_metriccentileweeklyvalue(servicemetric_id, time_id, liveservice_id, centile_value, centile_param, centile_id, total, warning_treshold, critical_treshold)SELECT '12379844', '1783306800', '1', '174136', '99.0000
', '1', m.max, m.warn, m.crit FROM metrics m WHERE m.metric_id = 145264
[root@rdy-cnt-bi]#
[root@rdy-cnt-bi]# /usr/share/centreon-bi/etl/perfdataStatisticsBuilder.pl -r -s $date_start -e $date_end --no-purge --no-centile
2026-07-24 15:07:22 - INFO - [SCHEDULER] >>>>>>> start
2026-07-24 15:07:22 - INFO - [SCHEDULER][PERFDATA] >>>>>>> start
2026-07-24 15:07:22 - INFO - [PURGE] Truncate partition 20260713 on table [mod_bi_metrichourlyvalue]
2026-07-24 15:07:22 - INFO - [PURGE] Truncate partition 20260714 on table [mod_bi_metrichourlyvalue]
2026-07-24 15:07:22 - INFO - [PURGE] Truncate partition 20260713 on table [mod_bi_metricdailyvalue]
2026-07-24 15:07:22 - INFO - [PURGE] Truncate partition 20260714 on table [mod_bi_metricdailyvalue]
2026-07-24 15:13:14 - INFO - [PERFDATA] Processing day: 2026-07-13 => 2026-07-14 [24x7]
2026-07-24 15:13:44 - INFO - [PERFDATA] Processing day: 2026-07-12 => 2026-07-13 [24x7]
2026-07-24 15:17:59 - INFO - [PERFDATA] Processing hours: 2026-07-12 => 2026-07-13
2026-07-24 15:17:59 - INFO - [PERFDATA] Processing hours: 2026-07-13 => 2026-07-14
2026-07-24 15:17:59 - INFO - [SCHEDULER][PERFDATA] <<<<<<< end
2026-07-24 15:17:59 - INFO - [SCHEDULER] <<<<<<< end
[root@rdy-cnt-bi]# /usr/share/centreon-bi/etl/perfdataStatisticsBuilder.pl -r -s $date_start -e $date_end --no-purge --centile-only
2026-07-24 15:22:57 - INFO - [SCHEDULER] >>>>>>> start
2026-07-24 15:22:57 - INFO - [SCHEDULER][PERFDATA] >>>>>>> start
2026-07-24 15:22:57 - INFO - [PURGE] Truncate partition 20260713 on table [mod_bi_metriccentiledailyvalue]
2026-07-24 15:22:57 - INFO - [PURGE] Truncate partition 20260714 on table [mod_bi_metriccentiledailyvalue]
2026-07-24 15:22:57 - INFO - [PURGE] Truncate partition 20260713 on table [mod_bi_metriccentileweeklyvalue]
2026-07-24 15:22:57 - INFO - [PURGE] Truncate partition 20260714 on table [mod_bi_metriccentileweeklyvalue]
2026-07-24 15:22:59 - INFO - Processing week for Centile: [2026-07-06] to [2026-07-12] - 24x7 - 99.0000 (6010 metrics)
2026-07-24 15:22:59 - ERROR - SQL error: Duplicate entry '15691-1-1783306800-99.0000' for key 'PRIMARY' (caller: gorgone::modules::centreon::mbi::libs::bi::MetricCentileValue:/usr/share/perl5/vendor_perl/gorgone/modules/centreon/mbi/li
bs/bi/MetricCentileValue.pm:176)
Query: INSERT INTO mod_bi_metriccentileweeklyvalue(servicemetric_id, time_id, liveservice_id, centile_value, centile_param, centile_id, total, warning_treshold, critical_treshold)SELECT '15691', '1783306800', '1', '50', '99.0000', '1',
m.max, m.warn, m.crit FROM metrics m WHERE m.metric_id = 167338
[root@rdy-cnt-bi]#

If I ignore centiles, operation is ok:

[root@rdy-cnt-bi]# /usr/share/centreon-bi/etl/perfdataStatisticsBuilder.pl  -r  -s $date_start -e $date_end --no-purge --no-centile
2026-07-24 15:07:22 - INFO - [SCHEDULER] >>>>>>> start
2026-07-24 15:07:22 - INFO - [SCHEDULER][PERFDATA] >>>>>>> start
2026-07-24 15:07:22 - INFO - [PURGE] Truncate partition 20260713 on table [mod_bi_metrichourlyvalue]
2026-07-24 15:07:22 - INFO - [PURGE] Truncate partition 20260714 on table [mod_bi_metrichourlyvalue]
2026-07-24 15:07:22 - INFO - [PURGE] Truncate partition 20260713 on table [mod_bi_metricdailyvalue]
2026-07-24 15:07:22 - INFO - [PURGE] Truncate partition 20260714 on table [mod_bi_metricdailyvalue]
2026-07-24 15:13:14 - INFO - [PERFDATA] Processing day: 2026-07-13 => 2026-07-14 [24x7]
2026-07-24 15:13:44 - INFO - [PERFDATA] Processing day: 2026-07-12 => 2026-07-13 [24x7]
2026-07-24 15:17:59 - INFO - [PERFDATA] Processing hours: 2026-07-12 => 2026-07-13
2026-07-24 15:17:59 - INFO - [PERFDATA] Processing hours: 2026-07-13 => 2026-07-14
2026-07-24 15:17:59 - INFO - [SCHEDULER][PERFDATA] <<<<<<< end
2026-07-24 15:17:59 - INFO - [SCHEDULER] <<<<<<< end
[root@rdy-cnt-bi]#

 

If with centile-only, operation fail:

[root@rdy-cnt-bi]# /usr/share/centreon-bi/etl/perfdataStatisticsBuilder.pl  -r  -s $date_start -e $date_end --no-purge --centile-only
2026-07-24 15:22:57 - INFO - [SCHEDULER] >>>>>>> start
2026-07-24 15:22:57 - INFO - [SCHEDULER][PERFDATA] >>>>>>> start
2026-07-24 15:22:57 - INFO - [PURGE] Truncate partition 20260713 on table [mod_bi_metriccentiledailyvalue]
2026-07-24 15:22:57 - INFO - [PURGE] Truncate partition 20260714 on table [mod_bi_metriccentiledailyvalue]
2026-07-24 15:22:57 - INFO - [PURGE] Truncate partition 20260713 on table [mod_bi_metriccentileweeklyvalue]
2026-07-24 15:22:57 - INFO - [PURGE] Truncate partition 20260714 on table [mod_bi_metriccentileweeklyvalue]
2026-07-24 15:22:59 - INFO - Processing week for Centile: [2026-07-06] to [2026-07-12] - 24x7 - 99.0000 (6010 metrics)
2026-07-24 15:22:59 - ERROR - SQL error: Duplicate entry '15691-1-1783306800-99.0000' for key 'PRIMARY' (caller: gorgone::modules::centreon::mbi::libs::bi::MetricCentileValue:/usr/share/perl5/vendor_perl/gorgone/modules/centreon/mbi/li
bs/bi/MetricCentileValue.pm:176)
Query: INSERT INTO mod_bi_metriccentileweeklyvalue(servicemetric_id, time_id, liveservice_id, centile_value, centile_param, centile_id, total, warning_treshold, critical_treshold)SELECT '15691', '1783306800', '1', '50', '99.0000', '1',
m.max, m.warn, m.crit FROM metrics m WHERE m.metric_id = 167338
[root@rdy-cnt-bi]#

Version and OS:

[root@rdy-cnt-bi ~]# cat /etc/redhat-release; rpm -qa | grep centreon
Red Hat Enterprise Linux release 9.8 (Plow)
centreon-nrpe3-plugin-4.1.3-1.el9.x86_64
centreon-nrpe3-daemon-4.1.3-1.el9.x86_64
centreon-gorgone-24.10.15-1.el9.noarch
centreon-common-selinux-24.10.8-1.el9.noarch
centreon-mbi-selinux-24.10.14-1.el9.noarch
centreon-bi-engine-24.10.12-1.el9.noarch
centreon-bi-report-24.10.12-1.el9.noarch
centreon-bi-reporting-server-24.10.12-1.el9.noarch
centreon-bi-etl-24.10.12-1.el9.noarch
[root@rdy-cnt-bi ~]#

BUG Reported: https://github.com/centreon/centreon-collect/issues/3585

Any ETA for this FIX or we need to take any previous action before rebuild?