neondatabase / neon

Neon: Serverless Postgres. We separated storage and compute to offer autoscaling, code-like database branching, and scale to zero.
https://neon.tech
Apache License 2.0
15.01k stars 438 forks source link

pageserver: remove `gc_horizon`, which retains data based on size, even though users only configure retention by time #6374

Open jcsp opened 9 months ago

jcsp commented 9 months ago

This ticket tracks the existence of gc_horizon, which is a strange setting: it controls how much wal we retain in byte terms, but this isn't a user-visible feature -- users only configure WAL retention in terms of time (pitr_interval).

We should probably just remove gc_horizon, after checking that its removal doesn't have any unintended side effects.


Original ticket:

There are two settings in the pageserver, which control the data retention. One is called pitr_interval, and it's given as a unit of time. Default is 7 days, but you can change it in the console. The customer had set that to 0. The second setting is called gc_horizon. It controls the same thing, but it's specified as amount of WAL bytes. It is not exposed to the users, they cannot change it, and it defaults to 64 MB. The way the PITR window works is that the pageserver keeps old data back to pitr_interval or gc_horizon whichever is longer.

Users care about this because they don't want to be billed for data they've dropped: if they write 10GB, then drop the table, then wait a week (default pitr_interval), the data should get dropped.

jcsp commented 9 months ago

Bug triage notes:

User stories:

jcsp commented 7 months ago

A successor to gc_feedback to help GC progress is tracked in https://github.com/neondatabase/neon/issues/6895

Ignoring gc_horizon for synthetic size was done in https://github.com/neondatabase/neon/pull/6407

jcsp commented 6 months ago

Status: blocked on https://github.com/neondatabase/neon/pull/7368 so that we have read replica feedback to safely GC (currently gc_feedback acts as a partial mitigation for lack of feedback)