[core][flink] Support parallelism snapshot expire #7027
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This PR implements parallel snapshot expiration to improve the performance of large-scale cleanup operations.
Motivation:
Changes:
Core module refactoring - Split the original serial expiration logic into Planner/Executor architecture:
TaskTypeenumFlink Action parallel mode - ExpireSnapshotsAction supports
--parallelismparameter:Execution modes:
parallelism=null or ≤1→ UsesExpireSnapshotsImplparallelism>1 + --force_start_flink_job→ Uses Flink distributed executionTests
Unit Tests:
ExpireSnapshotsPlanTest- Tests task partitioning logic (partitionTasksBySnapshotRange)DeletionReportTest- Tests deletion report serializationExpireSnapshotsTest- Core expiration logic tests (refactored to use new Planner/Executor)Integration Tests:
ExpireSnapshotsActionITCase- Flink parallel mode integration testsExpireSnapshotsProcedureITCase- Procedure integration testsAPI and Format
New CLI parameters for
expire-snapshotsaction:--parallelismNo storage format changes.
Backward compatible: Default behavior (serial mode) remains unchanged.
Documentation
Yes, this introduces a new feature: parallel snapshot expiration.
Documentation should be added to describe:
--parallelismparameter forexpire-snapshotsaction--parallelism > 1and--force_start_flink_job