1fanwang opened a new pull request, #2057:
URL: https://github.com/apache/iceberg-go/pull/2057

   Manifest merging can fail a valid commit when a merge bin contains only 
historical `DELETED` entries. Those entries are intentionally filtered out, but 
the merge path opened a new manifest writer first, then closed it empty and 
returned `empty manifest file has been written`.
   
   After this change, merge bins that retain no entries produce no replacement 
manifest. Current-snapshot deletes are still copied, non-empty bins still merge 
normally, and empty `ManifestWriter` calls still fail for direct callers.
   
   Closes https://github.com/apache/iceberg-go/issues/2037
   
   ## Testing
   
   <details><summary>Raw logs</summary>
   
   Before the fix:
   
   ```text
   $ go test ./table -run 
'TestManifestMerge(SkipsHistoricalDeletedOnlyManifest|KeepsCurrentSnapshotDeletedEntries|GroupDropsEmptyMergedBin)'
   --- FAIL: TestManifestMergeSkipsHistoricalDeletedOnlyManifest (0.00s)
       snapshot_producers_test.go:601:
           Error:       Received unexpected error:
                        empty manifest file has been written
   --- FAIL: TestManifestMergeGroupDropsEmptyMergedBin (0.00s)
       snapshot_producers_test.go:664:
           Error:       Received unexpected error:
                        empty manifest file has been written
   FAIL
   FAIL    github.com/apache/iceberg-go/table    0.498s
   FAIL
   ```
   
   After the fix:
   
   ```text
   $ go test ./table -run 
'TestManifestMerge(SkipsHistoricalDeletedOnlyManifest|KeepsCurrentSnapshotDeletedEntries|GroupDropsEmptyMergedBin)'
   ok      github.com/apache/iceberg-go/table    0.543s
   
   $ go test ./table/...
   ok      github.com/apache/iceberg-go/table              8.299s
   ok      github.com/apache/iceberg-go/table/compaction   2.538s
   ok      github.com/apache/iceberg-go/table/dv           (cached)
   ok      github.com/apache/iceberg-go/table/internal     (cached)
   ok      github.com/apache/iceberg-go/table/substrait    (cached)
   
   $ go vet ./table/...
   
   $ golangci-lint run --timeout=10m ./table/...
   0 issues.
   ```
   
   </details>
   


-- 
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