Describe the bug
On Edge, the timeseries TTL cleanup fails to drop expired telemetry partitions, so disk isn't reclaimed. It looks like the fix for #177 (#180) doesn't cover the cloud event child partitions.
#180 excluded ts_kv_cloud_event from drop_partitions_by_system_ttl, but only the parent table:
AND tablename != 'ts_kv_cloud_event'
The child partitions ts_kv_cloud_event_<epoch> still match LIKE 'ts_kv_%', so SPLIT_PART(partition, '_', 3)::integer hits 'cloud' and throws again:
ERROR: invalid input syntax for type integer: "cloud"
Where: PL/pgSQL function drop_partitions_by_system_ttl(...) line 67
The cleanup transaction aborts, so no ts_kv_YYYY_MM partition is dropped and telemetry TTL stops reclaiming disk. The row-level DELETE fallback still runs, so it's silent until the disk fills.
Your Server Environment
- own setup
- Deployment type: docker-compose
- ThingsBoard Edge Version: 4.3.1EDGE
- PostgreSQL 16
- Community Edition
To Reproduce
On an Edge with a telemetry TTL set and at least one ts_kv_cloud_event_<epoch> partition present:
CALL drop_partitions_by_system_ttl('MONTHS', 86400, 0);
-- ERROR: invalid input syntax for type integer: "cloud"
Suggested fix
In the three loops in schema-ts-psql.sql, change != 'ts_kv_cloud_event' to NOT LIKE 'ts_kv_cloud_event%'.
Additional context
Present in v4.3.1 through v4.3.1.3 and master.
Describe the bug
On Edge, the timeseries TTL cleanup fails to drop expired telemetry partitions, so disk isn't reclaimed. It looks like the fix for #177 (#180) doesn't cover the cloud event child partitions.
#180 excluded
ts_kv_cloud_eventfromdrop_partitions_by_system_ttl, but only the parent table:The child partitions
ts_kv_cloud_event_<epoch>still matchLIKE 'ts_kv_%', soSPLIT_PART(partition, '_', 3)::integerhits'cloud'and throws again:The cleanup transaction aborts, so no
ts_kv_YYYY_MMpartition is dropped and telemetry TTL stops reclaiming disk. The row-level DELETE fallback still runs, so it's silent until the disk fills.Your Server Environment
To Reproduce
On an Edge with a telemetry TTL set and at least one
ts_kv_cloud_event_<epoch>partition present:Suggested fix
In the three loops in
schema-ts-psql.sql, change!= 'ts_kv_cloud_event'toNOT LIKE 'ts_kv_cloud_event%'.Additional context
Present in
v4.3.1throughv4.3.1.3andmaster.