Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Postgres: no retention or partition management for events/attempts, causing unbounded growth

オープン
#1,027 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
go, postgresql, sql
領域
databases

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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:

  1. Automatic time-range partition management — create future partitions and drop expired ones.
  2. A Postgres retention setting implemented on top of those partitions.
  3. A supported migration path for existing installations where data is already in the DEFAULT partitions.
  4. Documentation describing the intended Postgres retention model.

Questions

  1. Is Postgres partition lifecycle management already planned or tracked?
  2. Is there a recommended migration path for existing DEFAULT partitions?
  3. 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.

主要言語
Go
スター
1.1k
フォーク
70
平均マージ
1日 3時間
マージ済み PR(30日)
50

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hookdeck/outpost のほかの issue

hookdeck/outpost の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。