[AMORO-4264][AMS] Use a dedicated thread pool for snapshot expiration planning - #4311
Conversation
Suggestion: Consolidate thread pools by latency sensitivityThanks for this PR! Isolating snapshot expiration planning from the global worker pool is the right direction, and the implementation cleanly follows the existing While reviewing, I'd like to propose a slightly different pool partitioning strategy for discussion. The core idea: split pools by latency sensitivity rather than by operation type, so that latency-sensitive workloads get dedicated pools while best-effort maintenance workloads share one. Current state (after this PR)
Proposed partitioning
Besides, forward-compatible with Iceberg's new Suggested config surface
|
|
Thanks for the suggestion. I agree that partitioning the pools by latency sensitivity is a better long-term abstraction and avoids adding a dedicated pool and configuration for each maintenance operation. My proposed interpretation is to generalize the new pool and configuration to iceberg-maintenance-pool and table-manifest-io.maintenance-thread-count, use snapshot expiration as the first consumer, and route the other maintenance paths that currently expose an executor hook to the shared pool. Amoro currently uses Iceberg 1.7.2, where not every listed maintenance operation exposes such a hook, so those operations would remain unchanged until the Iceberg upgrade. Please let me know whether you prefer this scope, or a narrower change in this PR that only generalizes the pool and uses it for snapshot expiration. |
Why are the changes needed?
Snapshot expiration planning uses Iceberg's global worker pool by default. Under load, expiration planning can occupy that shared pool while self-optimizing commits wait for worker futures, leaving tables in the committing state for a long time.
Close #4264.
Brief change log
expire-snapshots.plan-thread-count(default:10) from the Iceberg process factory.ExpireSnapshots.planWith(...).How was this patch tested?
Validated on Linux with both JDK 11 and JDK 17:
./mvnw test \ -pl amoro-ams \ -am \ -Pskip-dashboard-build \ -Dtest=TestIcebergThreadPools,TestIcebergTableMaintainer,TestIcebergProcessFactory,TestSnapshotExpireIceberg \ -Dsurefire.failIfNoSpecifiedTests=falseBoth runs completed with
BUILD SUCCESS. The focused unit tests passed without failures or errors, andTestSnapshotExpireIcebergreported 0 failures and 0 errors.Documentation
process-factories.yaml, and the pool scope and fallback behavior are documented in JavaDocs.