Database issues
Database issues may occur during operations on the TPOSS cluster since it extensively uses MySQL. This document provides common tips for troubleshooting known issues.
MySQL 1406 error - data too long for column
Most of the table columns used by TPOSS to store string-like data are of the varchar(256)Opens in a new tab data type. If you provide too long data, the column size may not be enough. In such a case, the MySQL 1406 error occurs. To solve the issue, increase the size of a column with the following command:
Repair partitions in the CDR table
TPOSS relies on a set of MySQL stored procedures to automatically manage partition rotation.
Partitions older than the period defined by cdr.controller.database.partitions_duration must be dropped, while new partitions should be created in advance so that data can continue to be written without interruption.
Under normal conditions, the database ensures that at least two partitions exist:
- Currently active partition
- Special partition named
future, based on which new partitions are created
The process of partition rotation can be broken for various reasons. If you notice that new partitions stop being created and only a single active partition named future remains, the database will write data into this partition without any further deletion. Over time, this may lead to the database running out of disk space.
To check the current state of the CDR table partitions, run the following SQL command:
Under normal conditions, the output should include multiple time-based partitions followed by the future partition, for example:
If the only partition present is future (the last one in the example above), the partition layout is broken and must be repaired.
To repair partitions, follow the steps below:
Switch to the TPOSS database where you have to fix the partitions:
sqlExecute the SQL commands below, replacing
INTERVAL 1 dayin lines 3 and 4 with the value defined by cdr.controller.database.partitions_duration:sqlFor example, if cdr.controller.database.partitions_duration is set to
12-hours, replaceINTERVAL 1 daywithINTERVAL 12 hour. For a complete list of supported interval formats, refer to the official MySQL documentation on Temporal IntervalsOpens in a new tab.Execute the SQL commands listed below one by one to create a new
cdrtable with partitions.These commands perform the next actions:
- Create an empty copy of the existing
cdrtable with wrong partitions - Build proper partitions on this table
- Rename the original
cdrtable tocdrs_wrong_partitions_backup_{UTC_DATE_TIME}and the copy tocdr
Create a delimiter for a new procedure:
sqlCreate a new procedure:
sqlSwitch back to the default delimiter:
sqlReorganize partitions:
sql- Create an empty copy of the existing
After completing these steps, the new cdr table should contain exactly two partitions:
- Currently active partition
- The
futurepartition
All additional partitions should be created automatically by the database within the next few minutes.
Important
You should verify within the next hour that all expected partitions have been created correctly. If partitions are still missing, manually execute:
Use the time-unit and time-value from cdr.controller.database.partitions_duration. If you are not sure about the parameters, you can take them from the output of this query:
If the procedure fails, submit a support ticket and include the full error output from this call and steps you executed.
You should delete the original table, named cdrs_wrong_partitions_backup_{UTC_DATE_TIME}, once its data-retention period has expired. You can do it using the next command: