I have an issue with lost .par file content for all centreon_storage partitioning tables on remote server.
Couldn't get partition infos for table 'centreon_storage.data_bin'
Couldn't get partition infos for table 'centreon_storage.logs'
Couldn't get partition infos for table 'centreon_storage.log_archive_service'
Couldn't get partition infos for table 'centreon_storage.log_archive_host'
>root@AAAAAAAAAA centreon_storage]# ls -alh data_bin*
-rw-rw---- 1 mysql mysql 27K Jun 19 02:00 data_bin.frm
-rw-rw---- 1 mysql mysql 0 Jun 19 02:00 data_bin.par
-rw-rw---- 1 mysql mysql 136M Jun 19 2022 data_bin#P#p20220619.ibd
-rw-rw---- 1 mysql mysql 132M Jun 20 2022 data_bin#P#p20220620.ibd
-rw-rw---- 1 mysql mysql 132M Jun 21 2022 data_bin#P#p20220621.ibd
………………………..
-rw-rw---- 1 mysql mysql 112K Jun 16 04:06 data_bin#P#p20230626.ibd
-rw-rw---- 1 mysql mysql 112K Jun 17 04:00 data_bin#P#p20230627.ibd
-rw-rw---- 1 mysql mysql 112K Jun 18 04:00 data_bin#P#p20230628.ibd
-rw-rw---- 1 mysql mysql 112K Jun 18 04:00 data_bin#P#pmax.ibd
Looks like it happened during partition script was running while system was forcibly switched off.
I didn’t find any low hanging solution in general MySQL/MariaDB searches as any actions on partitioned tables has come to same error about missing par file.
MariaDB acentreon_storage]> alter table log_archive_service check partition p20230206;
+----------+-----------------------------------+
| Msg_type | Msg_text |
+----------+-----------------------------------+
| Error | Failed to read from the .par file |
| error | Corrupt |
+----------+-----------------------------------+
2 rows in set (0.011 sec)
And now, it’s not possible export config to RS.
MariaDB dcentreon]> SELECT * FROM task where id > 862 ;
+------+--------+-----------+-----------+--------+---------------------+
| id | type | status | parent_id | params | created_at |
+------+--------+-----------+-----------+--------+---------------------+
| 863 | import | completed | 6862 | a:0:{} | 2022-01-12 12:14:09 |
| 864 | import | completed | 6863 | a:0:{} | 2022-01-12 12:16:30 |
| 865 | import | completed | 6874 | a:0:{} | 2022-01-14 09:15:02 |
| 866 | import | completed | 6885 | a:0:{} | 2022-01-14 14:08:13 |
| 867 | import | completed | 6886 | a:0:{} | 2022-01-14 14:31:20 |
| 2033 | import | failed | 10520 | NULL | 2023-07-06 16:52:12 |
+------+--------+-----------+-----------+--------+---------------------+
6 rows in set (0.000 sec)
Can you help me to figure out a procedure to recover DB operation?
My idea is :
- Export Central server Centreon_storage partitioned tables schema,
- Stop MariaDB service on RS,
- Remove all tables (with partitioning) files from RS,
- Import table schemas to RS,
- Start MariaDB service on RS,
- And magically, RS DB service will suck in all need data to related tables from central.
- Or recreate RS from beginning?
P.S.
centreon_storage]# grep -C 3 partit /var/log/centreon/centreon-partitioning.log
Sun, 09 Jul 23 04:00:01 +0200] PARTITIONING STARTED
Sun, 09 Jul 23 04:00:01 +0200] Cannot get partition information
lMon, 10 Jul 23 04:00:01 +0200] PARTITIONING STARTED
lMon, 10 Jul 23 04:00:01 +0200] Cannot get partition information