lasdf1234 opened a new pull request, #14785: URL: https://github.com/apache/gravitino/pull/14785
### What changes were proposed in this pull request? Complete before (S0) / after (S1) metrics for the four TMS built-in Iceberg maintenance jobs, and fix shared flow gaps used by the maintenance dashboard — including the in-job **manifest rewrite trigger gate**. - Report **S1 after-metrics** after a successful procedure (previously only S0 then `finish`). - Apply **snapshot drift skip** only to **compaction** and **manifest rewrite**; expiry and orphan cleanup proceed past HEAD drift. - **Compaction** S0/S1 share the same schema: `custom-data-file-mse`, `custom-delete-file-number`, `custom-avg-file-size`, `custom-total-file-size`, `custom-file-number`. - **Manifest rewrite**: S0 = `custom-manifest-number` / `custom-avg-manifest-size`; S1 = `custom-rewritten-manifest-number`. - **Manifest in-job trigger**: `MaintenanceTriggerGate` evaluates `trigger-expr` (no longer always maintain). Default expression matches optimizer thresholds; added to `IcebergRewriteManifestsContent.rules()`. - **Snapshot expiry**: S0 = inventory; S1 = cleared/reclaimed via set difference. In-job gate still always maintain. - **Orphan cleanup**: **no** before-metrics call; S1 reports `custom-removed-orphan-number` and `custom-orphan-bytes-reclaimed` (dry-run list → FileIO sizes → optional real delete). - `metricsJson` no longer includes `maintenanceType` / `snapshotId`. - Bump built-in maintenance template to `v2`; remove-orphan-files template to `v4`. - Sink S0/S1 helpers onto the four Iceberg job classes (CLI stays procedure-only). ### Why are the changes needed? The maintenance dashboard needs consistent before/after metrics per operation type, correct skip semantics for drift and trigger-expr, and orphan reclaimed-bytes reporting. See #14784. Fixes #14784 ### Does this PR introduce _any_ user-facing change? No public REST API change. TMS action metrics payloads and in-job skip behavior for built-in Iceberg maintenance jobs change as described above. Built-in job template versions bump (`v2` / `v4`). ### How was this patch tested? - [x] `./gradlew :api:test --tests org.apache.gravitino.policy.TestIcebergRewriteManifestsContent :maintenance:jobs:test --tests org.apache.gravitino.maintenance.jobs.iceberg.TestIcebergMaintenanceJob --tests org.apache.gravitino.maintenance.jobs.iceberg.TestMaintenanceTriggerGate --tests org.apache.gravitino.maintenance.jobs.iceberg.TestIcebergRemoveOrphanFilesJobWithSpark -PskipITs` - [ ] Smoke a TMS compaction / manifest / expire / orphan action and confirm S0/S1 rows match the schemas above - [ ] Confirm manifest actions **skip** when S0 is below thresholds - [ ] Confirm orphan actions create no empty before-metrics row and report non-zero bytes when orphans have size - [ ] Confirm expiry/orphan are not skipped solely due to HEAD drift Made with [Cursor](https://cursor.com) -- 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]
