jackylee-ch opened a new pull request, #10362: URL: https://github.com/apache/paimon/pull/10362
### Purpose With `metadata.iceberg.delete-after-commit` enabled (the default), `IcebergCommitCallback` deletes every Iceberg metadata file whose id is below `snapshotId - metadata.iceberg.previous-versions-max`. A negative `previous-versions-max` turns that boundary into `snapshotId + |value|`, so the `getAllMetadataPathBefore` sweep also deletes the *current* metadata file — on every commit — and the table can no longer be read by external Iceberg engines (Spark, Trino, Flink). This validates the option is `>= 0` in `IcebergOptions#previousVersionsMax` (`0` is valid: keep only the current metadata, which is the default) and routes the metadata-deletion path through that getter instead of reading the option raw. `IcebergRestMetadataCommitter` already uses the same getter, so both paths now share one validated accessor. ### Tests `IcebergOptionsTest#testPreviousVersionsMaxRejectsNegative` asserts `-1` / `-100` throw a clear `IllegalArgumentException`; `testPreviousVersionsMaxAcceptsZeroAndPositive` asserts `0` / `1` / `100` remain accepted (guarding the default). ### API and Format No change. ### Documentation No change. -- 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]
