Good afternoon. Thank you for this wonderful product. It is exciting.
Setup: Running Neon locally via docker not the docker-compose quick-start. I’m supplying config values to Neon and Neon compute node containers that I built locally.
supplied my own GCS bucket configuration to pageserver.toml
supplied a [tenant_config] to .neon/tenants/<tenant_id>/config with gc_horizon, gc_period, pitr_interval values.
have Pageserver, 3 Safekeeper, Storage Broker and Compute node running well, pushing / pulling to GCP bucket.
What doesn’t work:
data files keep piling up under .neon/tenants/<tenant_id>/. Nothing removes them. Tried setting pitr_interval, gc_period, and gc_horizon low, as noted here
I added a [disk_usage_based_eviction] to my pageserver.toml file as well, but nothing gets resolved.
PageServer keeps filling up and crashing after large inserts.
how to configure GC to work?
know the difference between GC and the disk_usage_based_eviction feature?
I see gc_loop crop-up in the PageServer logs, but it’s as if it never runs. Not sure how to dial in the configuration values (and which ones) to speed this up. I Saw a reference to do_gc Pageserver API endpoint (in link above) to force-call GC. Not sure how to trigger this endpoint.
Think I’m getting close, but would like some confirmation. I was finding this code in pageserver/src/tenant/timeline that seems to be where the values get decided upon here, to see if latest_gc_cutoff >= new_gc_cutoff. In the second code link, new_gc_cutoff gets set aslet new_gc_cutoff = Lsn::min(horizon_cutoff, pitr_cutoff);.
If pitr_interval isn’t set (first code link), its default is “7 days”, which then returns a pitr_cutoff value equal to the latest_gc_cutoff, i.e., if latest_gc_cutoff >= new_gc_cutoff always equals each other, so Nothing to GC... always runs. I set pitr_interval in my [tenant_config] to "0s", which (first code link) defaults the pitr_cutoff return to the gc_cutoff (gc_horizon value subtracted from last_record_lsn).
I then saw GC Starting and the cutoff LSN updating and progressing. However, it completes by saying GC completed removing 0 layers, cutoff 0/2BEA920.
My concern is the PageServer disk filling with WAL that never gets GC’ed. My testing is creating several tables and inserting 100,000 → 1,000,000 records. Wondering if there is an obvious thing I’m missing here. Lastly, am I thinking correctly about gc_horizon value, in that the smaller it is, the more will be GC’ed every gc_period amount of time?
After following line #4181 of the gc_timeline function in pageserver/src/tenant/timeline.rs, with RUST_LOG=debug on, I was able to start seeing that GC wasn’t removing any layers because it was keeping ... because it's newer than horizon cutoff or keeping ... because it's the latest layer.
I set pitr_interval = "0sec", image_creation_threshold = 0, gc_horizon = 64, gc_period="50sec", triggering many fast GC periods, and then it started to actually remove the layers.
Curious, because many older layers are still staying around. I feel like the Delta layers are messing it up, where cutoff_horizon LSN gets updated each GC interval, but Delta layers lump everything together, making layers un-removable. Any suggestions?