RSP22 opened a new pull request, #806:
URL: https://github.com/apache/iceberg-go/pull/806

   ## Summary
   
   Closes #805
   
   `AddFiles()` hardcodes `.fastAppend()` at line 780, bypassing 
`appendSnapshotProducer()`
   which reads `commit.manifest-merge.enabled`. Setting this property has no 
effect when
   using `AddFiles()` — manifests accumulate one-per-commit indefinitely 
regardless of the
   property value.
   
   ---
   
   ## Root Cause
   
   `appendSnapshotProducer()` already exists at line 126 and correctly reads 
the property.
   It is used by `AddDataFiles()` and `Append()` but was missed in `AddFiles()`:
   
   ```go
   // transaction.go line 780 — BEFORE (hardcoded, ignores property):
   updater := t.updateSnapshot(fs, snapshotProps, OpAppend).fastAppend()
   
   // AFTER (same as AddDataFiles() and Append()):
   updater := t.appendSnapshotProducer(fs, snapshotProps)
   ```
   
   | Method | Uses `appendSnapshotProducer()` |
   |---|---|
   | `AddDataFiles()` | ✅ yes |
   | `Append()` | ✅ yes |
   | `AddFiles()` | ❌ hardcoded `.fastAppend()` — **this bug** |
   
   ---
   
   ## Java Reference
   
   `BaseTable.newAppend()` always returns `MergeAppend`. 
`MANIFEST_MERGE_ENABLED_DEFAULT = true`
   in the Java implementation. The Go implementation should behave consistently 
with the
   reference implementation.
   
   ---
   
   ## Test Gap
   
   Three existing tests set `commit.manifest-merge.enabled=true` but none call 
`AddFiles()`:
   
   | Test | File | Uses `AddFiles()`? |
   |---|---|---|
   | `TestCommitV3RowLineageDeltaIncludesExistingRows` | 
`snapshot_producers_test.go` | ❌ calls `newMergeAppendFilesProducer()` directly 
|
   | `TestMergeManifests` | `table_test.go` | ❌ uses `AppendTable()` → 
`Append()` |
   | `TestSetProperties` | `transaction_test.go` | ❌ only sets the property, 
never appends |
   
   The new regression test `table/addfiles_merge_regression_test.go` exercises 
`AddFiles()`
   directly with `commit.manifest-merge.enabled=true` and verifies the merge 
fires.
   It can be moved into `transaction_test.go` if preferred by reviewers.
   
   ---
   
   ## Changes
   
   - **`table/transaction.go`** — 1-line fix: use `appendSnapshotProducer()` 
instead of hardcoded `.fastAppend()`
   - **`table/addfiles_merge_regression_test.go`** — regression test proving 
the bug (fails before fix, passes after)
   
   ---
   
   ## Verification
   
   **Regression test:**
   - 3 sequential `AddFiles()` commits with `minCountToMerge=2`
   - Before fix: 3 manifests (merge never fires)
   - After fix: 1 merged manifest (merge fires on commit 3)
   
   **Production verification** on a table with 1 commit/min:
   - Before fix: HEAD snapshot accumulated **1121 manifests** after 18 hours 
(one per commit, never merged)
   - After fix: HEAD snapshot has **16 manifests** after the next commit (merge 
fired)
   - Athena `COUNT(*)` returned **28,742,800,000** records — all data 
accessible, no regression
   
   ---
   
   ## Note on AI Assistance
   
   This PR was developed with AI assistance (Claude). The author has verified 
the
   implementation, Java reference behavior, test coverage gap, and production 
impact end-to-end.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to