Skip to content

Conversation

@yananxin
Copy link

@yananxin yananxin commented Nov 13, 2025

Context

Why is a full page image(FPI) unnecessary in Lakebase/Neon?

In vanilla PostgreSQL, full-page images (FPIs) are required to guard against torn page writes caused by non-atomic 8 KB page writes to local storage.
However, in the Lakehouse/Neon architecture, FPIs are generally not needed because the compute node never overwrites pages in place. Instead, all modifications are logged as WAL records and sent to the pageserver, which appends them into the storage layer’s log-structured layout. Since there is no local data-file page overwriting, the torn-page risk that FPIs protect against does not exist on the compute node’s local storage.

Why do we want to reduce the full page image?

Full-page images amplify every small update into an 8 KB WAL write, which drives up WAL volume and causes Reverse ETL ingestion to hit the max_wal_rate limit in Serverless Lakebase.

Why not eliminate full-page images entirely?
Full-page images help the pageserver reduce read-path I/O by providing complete page snapshots that can be used during page reconstruction. Removing FPIs entirely could negatively impact read performance.

Summary

This PR(along with the hadron PR: https://github.com/databricks-eng/hadron/pull/3155 )implements reducing FPI to improve write performance for data ingestion workloads, specifically reverse ETL and Spark streaming use cases. The feature is opt-in per table to avoid unintended impact on other customers.

Performance Impact

Testing shows 3.75x write throughput improvement without significantly impacting read performance. See performance analysis.

Major changes

Probabilistic reducing FPI generation to 5%

Added neon_should_suppress_fpi which will randomly determine if we should suppress FPI with a default value of 5%. The 5% is chosen to:

  • Significantly reducing WAL volume to avoid write-amplification bottlenecks.
  • Retaining a small number of FPIs so the pageserver still benefits from occasional full-page snapshots, helping maintain efficient read-path performance.

@yananxin yananxin changed the title Add the hooks for disabling FPI [LKB-5974] Add the hooks for disabling FPI Nov 13, 2025
@yananxin yananxin changed the title [LKB-5974] Add the hooks for disabling FPI [LKB-5974] Add the ability to reduce FPI Nov 13, 2025
@yananxin yananxin changed the title [LKB-5974] Add the ability to reduce FPI [LKB-5974][PG_17] Add the ability to reduce FPI Nov 13, 2025
@yananxin yananxin requested a review from HaoyuHuang November 13, 2025 17:26
@yananxin yananxin force-pushed the disable-fpi branch 2 times, most recently from b6f7871 to 3b85275 Compare December 3, 2025 00:27
@yananxin yananxin requested a review from ololobus December 3, 2025 01:45
Copy link

@mmeent-databricks mmeent-databricks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor improvements possible, but generally LGTM.

PS. Don't forget to squash your commits before merging!

@yananxin yananxin merged commit e9b9346 into REL_17_STABLE_neon Dec 8, 2025
1 check passed
@yananxin yananxin deleted the disable-fpi branch December 8, 2025 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants