lintingbin opened a new pull request, #4182:
URL: https://github.com/apache/amoro/pull/4182

   $(cat <<'EOF'
   ### Search before asking
   
   - [x] I have searched in the 
[issues](https://github.com/apache/amoro/issues?q=is%3Aissue) and found no 
similar issues.
   
   ### What type of PR is this?
   
   - [ ] Improvement
   - [x] Bug Fix
   - [ ] Feature
   - [ ] Refactoring
   
   ### What does this PR do?
   
   #### Problem
   
   After the Iceberg 1.6.1 → 1.7.2 upgrade (#4163), 
`TestInternalMixedCatalogService.CompatibilityCatalogTests#testNewCatalogLoadHistorical`
 became flaky, failing with:
   
   ```
   java.lang.IllegalStateException: update table meta failed
   ```
   
   This originates from `InternalMixedIcebergHandler.newTableOperations()`, 
which attempts to backfill REST-based mixed-format properties into the Iceberg 
metadata of legacy tables (created before v0.7.0) by calling 
`ops.commit(current, legacyCurrent)`.
   
   Iceberg 1.7.2 introduced a breaking change in 
`HadoopTableOperations.commit()`: it now uses **reference equality** (`==`) to 
compare the `base` parameter against the internally cached `currentMetadata`. 
If `versionAndMetadata()` (called at the start of `commit()`) returns a 
refreshed metadata object with a different reference than what `ops.current()` 
previously returned, the check fails and throws `CommitFailedException("Cannot 
commit changes based on stale table metadata")` with no cause.
   
   Because `MixedHadoopTableOperations.commit()` only converts 
`CommitFailedException` **with** a cause to `CommitStateUnknownException` (and 
re-throws the no-cause variant), this exception propagates through the Thrift 
layer as a `TException`, causing `BasicMixedCatalog.createTableMeta()` to throw 
`IllegalStateException("update table meta failed")`.
   
   #### Fix
   
   The `ops.commit()` call in `newTableOperations()` is a **best-effort 
migration step** — it backfills REST-based properties into the legacy table's 
on-disk Iceberg metadata. It is not required for the table to load or operate 
correctly; if it fails, the migration will simply be retried on the next table 
load.
   
   Wrap `ops.commit(current, legacyCurrent)` in a `try-catch` and log a warning 
instead of propagating the exception. This prevents an ephemeral commit failure 
from aborting table loading and causing test/server failures.
   
   ### Checklist
   - [x] I have added corresponding tests for my changes.
   - [x] This PR only changes one thing, and it is clear from the title.
   - [ ] I have documented my changes in the relevant documentation.
   
   Fixes the flaky `TestInternalMixedCatalogService` regression introduced by 
#4163.
   EOF
   )


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

Reply via email to