centreon / centreon-gorgone

Daemon tasks handler
Other
6 stars 11 forks source link

Recontruct data : some partitions are not created in databases #276

Open BenoitPoulet opened 1 year ago

BenoitPoulet commented 1 year ago

BUG REPORT INFORMATION

Prerequisites

Get your module version

centreon-release-22.10-1.el7.centos.noarch
centreon-bi-report-22.10.0-25.el7.centos.noarch
centreon-bi-reporting-server-22.10.0-25.el7.centos.noarch
centreon-bi-etl-22.10.0-25.el7.centos.noarch
centreon-business-release-22.10-1.el7.centos.noarch
centreon-bi-engine-22.10.0-25.el7.centos.noarch
centreon-gorgone-22.10.0-13.el7.centos.noarch

Operating System

CentOS

Description

By using this doc : https://docs.centreon.com/docs/reporting/concepts/#how-to-rebuild-missing-reporting-data Some scripts failed because some partitions are missing when they are launched.

Steps to Reproduce

Do a import of the delta (with missing data from all table) : /usr/share/centreon-bi/etl/importData.pl -r -s 2022-12-16 -e 2022-12-19 --ignore-databin /usr/share/centreon-bi/etl/importData.pl -r --no-purge --databin-only -s 2022-12-16 -e 2022-12-19 /usr/share/centreon-bi/etl/dimensionsBuilder.pl -d /usr/share/centreon-bi/etl/eventStatisticsBuilder.pl -r --events-only /usr/share/centreon-bi/etl/eventStatisticsBuilder.pl -r --no-purge --availability-only -s 2022-12-15 -e 2022-12-19

Describe the received result

/usr/share/centreon-bi/etl/eventStatisticsBuilder.pl -r --no-purge --availability-only -s 2022-12-15 -e 2022-12-19
2022-12-19 10:22:21 - INFO - [SCHEDULER] >>>>>>> start
2022-12-19 10:22:23 - INFO - [SCHEDULER][EVENT] >>>>>>> start
2022-12-19 10:22:23 - INFO - [PURGE] Delete table [mod_bi_hgmonthavailability] from 2022-12-01 to 2022-12-19
2022-12-19 10:22:23 - INFO - [PURGE] Delete table [mod_bi_hgservicemonthavailability] from 2022-12-01 to 2022-12-19
2022-12-19 10:22:23 - INFO - [PURGE] Truncate partition 20221216 on table [mod_bi_serviceavailability]
2022-12-19 10:22:23 - INFO - [PURGE] Truncate partition 20221217 on table [mod_bi_serviceavailability]
2022-12-19 10:22:23 - ERROR - SQL error: Unknown partition 'p20221217' in table 'mod_bi_serviceavailability' (caller: gorgone::modules::centreon::mbi::etlworkers::event::main:/usr/share/per
l5/vendor_perl/gorgone/modules/centreon/mbi/etlworkers/event/main.pm:72)
Query: ALTER TABLE mod_bi_serviceavailability TRUNCATE PARTITION p20221217
2022-12-19 10:22:23 - INFO - [PURGE] Truncate partition 20221216 on table [mod_bi_hostavailability]
2022-12-19 10:22:23 - INFO - [PURGE] Truncate partition 20221217 on table [mod_bi_hostavailability]
2022-12-19 10:22:23 - ERROR - SQL error: Unknown partition 'p20221217' in table 'mod_bi_hostavailability' (caller: gorgone::modules::centreon::mbi::etlworkers::event::main:/usr/share/perl5/vendor_perl/gorgone/modules/centreon/mbi/etlworkers/event/main.pm:72)
Query: ALTER TABLE mod_bi_hostavailability TRUNCATE PARTITION p20221217

Same with the step :

bash-4.2# /usr/share/centreon-bi/etl/perfdataStatisticsBuilder.pl -r --no-purge -s 2022-12-15 -e 2022-12-19
2022-12-19 10:50:33 - INFO - [SCHEDULER] >>>>>>> start
2022-12-19 10:50:35 - INFO - [SCHEDULER][PERFDATA] >>>>>>> start
2022-12-19 10:50:35 - INFO - [PURGE] Truncate partition 20221216 on table [mod_bi_metrichourlyvalue]
2022-12-19 10:50:35 - INFO - [PURGE] Truncate partition 20221217 on table [mod_bi_metrichourlyvalue]
2022-12-19 10:50:35 - ERROR - SQL error: Unknown partition 'p20221217' in table 'mod_bi_metrichourlyvalue' (caller: gorgone::modules::centreon::mbi::etlworkers::perfdata::main:/usr/share/perl5/vendor_perl/gorgone/modules/centreon/mbi/etlworkers/perfdata/main.pm:73)
Query: ALTER TABLE mod_bi_metrichourlyvalue TRUNCATE PARTITION p20221217
2022-12-19 10:50:35 - INFO - [PURGE] Truncate partition 20221216 on table [mod_bi_metricdailyvalue]
2022-12-19 10:50:35 - INFO - [PURGE] Truncate partition 20221217 on table [mod_bi_metricdailyvalue]
2022-12-19 10:50:35 - ERROR - SQL error: Unknown partition 'p20221217' in table 'mod_bi_metricdailyvalue' (caller: gorgone::modules::centreon::mbi::etlworkers::perfdata::main:/usr/share/perl5/vendor_perl/gorgone/modules/centreon/mbi/etlworkers/perfdata/main.pm:73)
Query: ALTER TABLE mod_bi_metricdailyvalue TRUNCATE PARTITION p20221217

Describe the expected result

Scripts run without errors :D

Additional relevant information (e.g. frequency, ...)

I fixed the problem by creating by hands, the missing partitions.