Skip to content

moonlink 0.3.0-pgsty.2: Durable Iceberg Snapshot Acknowledgements

PGSTY Moonlink v0.3.0-pgsty.2 fixes early acknowledgements in create_snapshot by waiting for published table commits to reach Apache Iceberg before completing, validated across chaos, unit, and PostgreSQL 19 CDC suites.

Moonlink v0.3.0-pgsty.2 fixes a snapshot durability bug in create_snapshot where a forced snapshot could return before the latest source commit was persisted to Apache Iceberg. This release pairs with pg_mooncake 0.3.3, pg_mooncake 0.3.4, and duckdb_mooncake v0.0.5.

What Was Fixed

In v0.3.0-pgsty.1 (and the underlying v0.3.0 baseline), the replication watermark (replication_lsn) could advance past a source transaction while a mirror’s TableHandler was still processing or flushing an earlier state. When create_snapshot checked only the replication watermark, it could acknowledge completion even though Iceberg still held an older snapshot of that table.

In v0.3.0-pgsty.2 (commits bc99ce4d and bae6634b):

  • Table commit watch on TableHandler: TableHandler now tracks the table’s published commit watermark (commit_lsn_rx) alongside the replication stream watermark (replication_lsn_rx).
  • Ordered publication and Iceberg persistence wait: create_snapshot now waits until published table commits up through the requested position have actually been persisted to Iceberg before acknowledging the caller.
  • Release layout regression coverage: Added CDC regression coverage verifying legacy source fingerprints and occupied Iceberg table locations against the PGSTY release on-disk layout.

Action Required After Upgrading

Take Fresh Snapshots After Upgrading

After installing the updated worker (pg_mooncake 0.3.3 or 0.3.4 with Moonlink v0.3.0-pgsty.2), take a fresh snapshot (CALL mooncake.create_snapshot(...)) of each mirror before relying on it as a backup or migration boundary. If an earlier restore already exhibits missing rows, compare the mirror against its authoritative PostgreSQL source and rebuild the affected mirror as needed.

Embedded Rust API Note

Standalone Rust applications constructing a TableHandler directly must now supply the table commit watch (commit_lsn_rx) alongside the replication watch (replication_lsn_rx), as documented in the tagged README:

  • Publish the table commit position before enqueueing the table’s commit event.
  • Advance the replication position after enqueueing the commit event.

All storage stack versions (Iceberg 0.11.0, OpenDAL 0.58.2, Arrow/Parquet 58.4.2, SQLx 0.9.1, libsqlite3-sys 0.40.0) and the zero-vulnerability RustSec audit posture from v0.3.0-pgsty.1 remain unchanged.

Validation

Suite Result
Original failing chaos seed Passed 3/3 consecutive runs after the fix
Local workspace unit suites (cargo nextest) 771/771 tests passed
PostgreSQL 19 CDC integration suite 131/131 tests passed, including real server restarts
Linux CI pipeline Run #45153482056 covering chaos, object storage, and PostgreSQL integration

Table reader