Matt FaltynTravel

Verifying Row Preservation in Apache Iceberg-Go

I authored a compaction fix for Apache Iceberg-Go and later replayed it with Mentat. The fix kept all 12 rows visible in the original failure scenario.

A Partial Commit Left One Row Visible

In the old split-task path, partial progress left one active row visible and then returned an error. The original file could be replaced before all of its rows had been rewritten.

I reported the failure in issue #2287 and changed the compaction planner to rewrite complete source files in PR #2288.

Preserve Every Row After Each Commit

Each committed snapshot must preserve the same complete rows, including duplicates. Assigning a whole file to one task ensures that its replacement accounts for every row in that file.

I built a retrospective replay in Mentat that checked this contract against both Git revisions using the same approved Go probe.

The Replay Across Revisions

The Go probe checked eight combinations of scan task splitting, partial progress, and filtering. It compared complete rows in each committed snapshot.

Native Go Probe Results
RevisionRows PreservedCases Passing
Before: 410b7891 of 124 of 8
Fix: 3fb910912 of 128 of 8

Lean and Z3 passed for both revisions under the model’s assumptions of whole-file ownership, exact copying, and atomic publication. The native replay measured the implementation’s behavior in the tested cases.

As a negative control, the replay substituted a known-bad one-row result and required the checker to flag it.

The fixture covers physical row preservation and excludes logical deletes, concurrent writers, and crash durability.

Read the Mentat v0.1.2 replay documentation and its Lean model.