You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "RSP22 (via GitHub)" <gi...@apache.org> on 2026/03/22 04:08:32 UTC

[PR] Fix: AddFiles() should respect commit.manifest-merge.enabled [iceberg-go]

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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Fix: AddFiles() should respect commit.manifest-merge.enabled [iceberg-go]

Posted by "RSP22 (via GitHub)" <gi...@apache.org>.
RSP22 commented on PR #806:
URL: https://github.com/apache/iceberg-go/pull/806#issuecomment-4105449954

   Added `table/addfiles_merge_regression_test.go` as a standalone file rather than 
   adding to `transaction_test.go` for the following reasons:
   
   1. **Three existing tests already set `commit.manifest-merge.enabled=true` but none 
      call `AddFiles()`** — the gap is specific to `AddFiles()` and a separate file makes 
      that immediately visible to anyone searching for test coverage.
   
   2. **Regression tests are easier to find when named after the bug** — 
      `addfiles_merge_regression_test.go` signals its purpose: prevent this specific 
      regression from recurring. Contributors can locate it without reading 
      `transaction_test.go` in full.
   
   Happy to move it into `transaction_test.go` if preferred — the test itself 
   is unchanged either way.
   


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] fix(table): AddFiles() should respect commit.manifest-merge.enabled [iceberg-go]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade merged PR #806:
URL: https://github.com/apache/iceberg-go/pull/806


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org