This file describes what a defect looks like in ColdFront, which paths the automated review tools skip, and what a reviewer checks in every pull request. The author's AI review, CodeRabbit, and the approving reviewer all work from this file.
ColdFront runs inside the PostgreSQL server process and moves data between PostgreSQL and Apache Iceberg, so a defect can lose data or crash the server. A change fails review when the change can cause any of the following:
- a row that the archiver, a tiered
INSERT, or the partitioner loses, duplicates, or alters as the row moves between partitions or between the hot and cold tiers. - a cold read that returns rows or values that differ from what PostgreSQL returns for the same data.
- two cold writes that commit to one Iceberg table out of turn, or two nodes that register the same Iceberg table.
- a crash or memory error in
extension/coldfront/src/coldfront.c, which terminates the backend and makes PostgreSQL end every other session while the server recovers from the crash. - a storage credential or catalog token that appears in a log, an error message, a query text, or a committed file.
- a compaction or a cold
DROPthat deletes a data file that a live snapshot or an open transaction still reads.
CodeRabbit reviews every tracked file. Codacy skips files that do not ship or
that another check covers, as the .codacy.yaml file lists, and a change to
that file updates this section to match.
The following table describes the paths that Codacy skips:
| Path | Reason |
|---|---|
.claude/** and CLAUDE.md |
These files instruct coding agents and do not ship. |
config.example.yaml |
This file is an example configuration. |
THIRD_PARTY_NOTICES.md |
This file is generated license text. |
docker/*.patch |
These patches change duckdb-iceberg, and CodeRabbit and the approving reviewer read them. |
docs/formal/** |
The TLC model checker checks the TLA+ model in this directory. |
extension/coldfront/test/** |
These files are pg_regress tests and their expected output. |
**/*_test.go |
These files are Go tests, which do not ship. |
A reviewer checks the following points in addition to the checklist in the pull request template. The linters cover formatting, so the review omits findings about formatting alone.
The bakery protocol serializes every cold write through the
coldfront.claims table. A change to cold writes follows these rules:
- A change to the bakery functions in the extension SQL, the commit callback
in
coldfront.c, thecoldfront.iceberg_async_parquetordering, or the Spock settings that replicate claims updatesdocs/formal/Bakery.tlaand re-runs every TLC configuration. A pure refactor instead explains in the pull request why the claim, commit, and release sequence is unchanged. docs/formal/README.md describes the model and every configuration. - A cold write runs outside any subtransaction, such as a
SAVEPOINTor a PL/pgSQLEXCEPTIONblock, because pg_duckdb refuses every cold write inside one. - A cold write commits to the catalog without a retry, because the bakery prevents commit conflicts.
The query rewrite emits SQL that DuckDB or a second session runs, and that SQL must read the same in every session. Generated SQL follows these rules:
- Every relation, function, and operator reference is schema-qualified, so
the code does not rely on
search_path. - Every value that leaves the session as text goes through
coldfront._canonical_text. - A change to the shape of a rendered qual or
INSERTregenerates every pg_regress expected file that echoes the statement, including the_1.outvariants.
Each component keeps a narrow set of dependencies. A change respects these boundaries:
- SQL and the C extension make HTTP calls only through the catalog client in duckdb-iceberg, and only the Go programs call the Lakekeeper management API.
- The archiver orchestrates plain parameterized SQL through pgx and uses no DuckDB, Iceberg, or Arrow Go libraries.
- The compactor in
cmd/compactor/stays a separate Go module, so its dependencies stay out of the archiver.
Tests prove the behaviour that a change claims, and a dependency workaround proves that it is still needed. A change meets these conditions:
- A bug fix includes a test that fails on the unfixed code.
- A test changed alongside a fix still fails on the unfixed code in every interleaving and input that the test can meet.
- A workaround for a dependency names the dependency and the pinned version that shows the defect, and includes a test that runs the dependency without the workaround and fails once the defect is gone.
- A change to the base image recipe (
docker/Dockerfile.duckdb15-baseand the files that it copies) passes CI only afterbase-image.ymlpublishes the base image under the tag thatci/base-ref.shprints.
The documentation describes the current behaviour. A change keeps the documentation consistent in these ways:
README.mdanddocs/index.mdchange together where they share the introduction.- A new, renamed, or removed guide in
docs/updates themkdocs.ymlnavigation and theREADME.mdtable of contents in the same commit. mkdocs build --strictpasses with no warnings.
Every reviewer reports findings by these rules, so that the reviews of a pull request converge:
- Label each finding as Critical, Major, or Minor. A Critical finding can cause a failure listed in Recognizing a Failure. A Major finding causes an error or a wrong result on a narrower path. A Minor finding is any other defect.
- State whether the finding concerns code that the pull request changes or code that existed before the pull request.
- Omit findings that concern style alone.
- On a later review of the same pull request, review only the new commits, and do not repeat an earlier finding.