Postgres: no retention or partition management for events/attempts, causing unbounded growth
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start by reading the Postgres partition definitions and migrations, including 000005_denormalize_attempts.up.sql, then review internal/logstore/pglogstore/README.md and docs/content/self-hosting/guides/event-delivery-log.mdoc. The issue asks for partition lifecycle management, a retention setting, a migration path for DEFAULT partitions, and documentation; agree on the design and supported migration behavior before implementation.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Outpost's Postgres events and attempts tables are declared as range-partitioned on time, but only DEFAULT partitions are created.
We could not find any code that creates, rotates, or drops time-based Postgres partitions, nor any built-in Postgres retention mechanism. This leaves operators implementing retention externally with row-by-row DELETE, with the associated dead-tuple, vacuum, and index-maintenance overhead.
This appears to be an incomplete part of the intended Postgres design rather than a new feature request.
Evidence in the source
The Postgres schema already uses time-based partitioning:
PRIMARY KEY (time, id)
) PARTITION BY RANGE (time);
CREATE TABLE events_default PARTITION OF events DEFAULT;
The same pattern is used for attempts.
More importantly, internal/logstore/pglogstore/README.md:367-373 explicitly lists:
Easy data retention (drop old partitions)
as a benefit of the time-based partitioning design.
However, we could not find runtime or migration code that creates, attaches, detaches, or drops those partitions.
The retention documentation also appears unfinished: docs/content/self-hosting/guides/event-delivery-log.mdoc:8 currently contains:
Need to talk about data retention and retention policies.
Request
It would be great to complete the Postgres retention design by adding:
- Automatic time-range partition management — create future partitions and drop expired ones.
- A Postgres retention setting implemented on top of those partitions.
- A supported migration path for existing installations where data is already in the DEFAULT partitions.
- Documentation describing the intended Postgres retention model.
Questions
- Is Postgres partition lifecycle management already planned or tracked?
- Is there a recommended migration path for existing DEFAULT partitions?
- Until native retention exists, what retention approach do you recommend for Postgres?
Small unrelated finding
The primary-key index on attempts_default still appears to be named deliveries_default_pkey.
000005_denormalize_attempts.up.sql:59-60 renames the table and partition but apparently not the constraint-backing index. Harmless, but slightly confusing when inspecting pg_stat_user_indexes.
- Ngôn ngữ chính
- Go
- Star
- 1.1k
- Fork
- 70
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 54
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của hookdeck/outpost
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
hookdeck/outpost#1117 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của hookdeck/outpost
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
status:needs-review type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Gentleman-Programming/engram#2079 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug triage/pending
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
limitlessprojects/Go-Hybrid#1377 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug report
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 3 ngày