(注意:我也将其作为 github 问题发布 https://github.com/timescale/timescaledb/issues/3653 )
我有一个配置了 24 小时保留策略的超表 request_logs
。保留策略被标记为成功运行,但表中没有旧数据被删除。该表继续日益增长。
我检查了 postgresql 日志文件,没有发现任何错误。
可以使用有关在何处查找信息来解决此问题的附加指南。
request_logs
表结构
\d+ request_logs;
Table "public.request_logs"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
-----------+--------------------------+-----------+----------+---------+---------+--------------+-------------
time | timestamp with time zone | | not null | | plain | |
referer | bigint | | | | plain | |
useragent | bigint | | | | plain | |
Indexes:
"request_logs_time_idx" btree ("time" DESC)
Triggers:
ts_insert_blocker BEFORE INSERT ON request_logs FOR EACH ROW EXECUTE FUNCTION _timescaledb_internal.insert_blocker()
Child tables: _timescaledb_internal._hyper_1_37_chunk,
_timescaledb_internal._hyper_1_38_chunk,
_timescaledb_internal._hyper_1_40_chunk
Access method: heap
这是通过运行 select * from _timescaledb_catalog.hypertable; 检索的超表描述;
id | schema_name | table_name | associated_schema_name | associated_table_prefix | num_dimensions | chunk_sizing_func_schema | chunk_sizing_func_name | chunk_target_size | compression_state | compressed_hypertable_id | replication_factor
----+-------------+--------------+------------------------+-------------------------+----------------+--------------------------+--------------------------+-------------------+-------------------+--------------------------+--------------------
1 | public | request_logs | _timescaledb_internal | _hyper_1 | 1 | _timescaledb_internal | calculate_chunk_interval | 0 | 0 | |
(1 row)
这是通过运行SELECT * FROM timescaledb_information.job_stats;
检索的retention_policy。
hypertable_schema | hypertable_name | job_id | last_run_started_at | last_successful_finish | last_run_status | job_status | last_run_duration | next_start | total_runs | total_successes | total_failures
-------------------+-----------------+--------+-------------------------------+-------------------------------+-----------------+------------+-------------------+-------------------------------+------------+-----------------+----------------
public | request_logs | 1002 | 2021-10-05 23:59:01.601404+00 | 2021-10-05 23:59:01.638441+00 | Success | Scheduled | 00:00:00.037037 | 2021-10-06 23:59:01.638441+00 | 8 | 8 | 0
| | 1 | 2021-10-05 08:38:20.473945+00 | 2021-10-05 08:38:21.153468+00 | Success | Scheduled | 00:00:00.679523 | 2021-10-06 08:38:21.153468+00 | 45 | 45 | 0
(2 rows)
相关系统信息:
- 操作系统:Ubuntu 20.04.3 LTS
- PostgreSQL 版本(
postgres --version
的输出):12 - TimescaleDB 版本(
psql
中\dx
的输出):2.4.1 - 安装方法:apt install流程说明https://docs.timescale.com/timescaledb/latest/how-to-guides/install-timescaledb/self-hosted/ubuntu/installation-apt-ubuntu/#installation-apt-ubuntu
最佳答案
看起来这可能与 TimescaleDB 2.4.2 版本中修复的错误有关。 GitHub 报告已更新,如果您发现升级后问题仍然存在,请使用您的示例更新 GitHub 上的问题。感谢您的举报! 透明度:我为 Timescale 工作
关于postgresql - Timescaledb:保留策略不会从超表中删除数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69458707/