Skip to content

pg_mooncake v0.3.2

Choose a tag to compare

@Vonng Vonng released this 23 Nov 09:39

Snapshot durability update. On 0.3.2, CALL mooncake.create_snapshot(...) can return before Iceberg durably records the last source commit. Upgrade to pg_mooncake 0.3.3 and take a fresh snapshot of each mirror before using it for backups or migrations. Compare an already restored mirror with its authoritative source if its snapshot may have been affected.

PGSTY pg_mooncake 0.3.2 supports PostgreSQL 15–19 with pg_duckdb 1.2.1, DuckDB v2.0.1, scanner v0.0.4 and Moonlink v0.3.0-pgsty.1. Source builds use Rust 1.99.1 and pgrx 0.20.0. This release fixes mirror cleanup after interrupted creation and committed drops, overlapping scans, snapshot metadata and smart shutdown.

Build from source

Download pg_mooncake-0.3.2-source.tar.gz and SHA256SUMS from the assets below. Run sha256sum -c SHA256SUMS (on macOS, shasum -a 256 -c SHA256SUMS) before extracting. The named tarball contains every pinned Git submodule, including both DuckDB source trees. Cargo and CMake still need access to their third-party dependencies or a populated build cache. The equivalent Git checkout is

git clone --recurse-submodules --branch v0.3.2 https://github.com/pgsty/pg_mooncake.git

Fresh installations

Use pg_config --sharedir for the target PostgreSQL major. Set mooncake.extension_repository to its absolute extension/pg_mooncake subdirectory and set duckdb.allow_unsigned_extensions = on for the locally packaged scanner. duckdb.allow_community_extensions may stay off. Preload pg_duckdb,pg_mooncake, set wal_level = logical, restart PostgreSQL and run CREATE EXTENSION pg_mooncake CASCADE in a fresh session.

Existing installations and backups

  • From PGSTY 0.3.0, stop source writes and take and verify a snapshot of each mirror on the old binaries. Compare source and mirror in both directions, stop PostgreSQL cleanly, and preserve the complete storage backup and old _wal offline before starting the new worker.
  • From 0.3.1, install the matching scanner into the local repository, refresh the cached copy and reconnect before ALTER EXTENSION pg_mooncake UPDATE TO '0.3.2'.
  • For physical backups and streaming standbys, set mooncake.data_directory outside PGDATA before creating mirrors. Give each instance its own directory and back it up separately. A physical PostgreSQL backup alone does not capture external Moonlink storage. With a non-UTF-8 PostgreSQL data path, set both DuckDB's temporary directory and extension directory to writable UTF-8 paths.

The installation and upgrade guide gives the SQL and configuration examples.

Validation

The public recursive checkout built and packaged with an empty Cargo home. On macOS ARM64 with PostgreSQL 19.0, a fresh database installed the packaged scanner with community extensions disabled. Ten SQL regressions, three version guards, fifteen integration checks, a negative restart check and two checks after a real restart passed.

The attached tarball reproduced byte-for-byte from a second checkout. It contains 36,086 tracked files, including symlinks. Its unpacked sources built and staged both pg_duckdb and pg_mooncake without Git metadata and passed the same PG19 tests on a second fresh database cluster. The native scanner embeds build paths, so building in different directories produced different scanner digests.

The runtime matrix covered PostgreSQL 15.20, 16.16 and 17.12 on Linux ARM64 (development builds), PostgreSQL 18.7 on Linux ARM64 (release) and PostgreSQL 19.0 on macOS ARM64 (release). It included both direct upgrade paths and real restarts. Object-storage tests used MinIO. The assets here are source distributions. The package matrix tracks native packages separately.