[flink] Support remove_orphan_blobs action and procedure. - #10014
Stephen0421 wants to merge 1 commit into
Conversation
8702823 to
f695bb7
Compare
JingsongLi
left a comment
There was a problem hiding this comment.
Requirement fit: SUPPORTED (triage: GO)\nImplementation: FINDINGS\n\nThe Flink action and procedure have clear end-to-end operational value, but I found one scalability blocker in the distributed path.\n\n[P1] Avoid copying the complete used-pack set into every cleanup task\n\nFlinkManagedBlobOrphanFilesClean.java freezes all live pack identities into a client HashSet, then deleteUnused copies that set and captures it in the candidate filter. Because that filter runs at the requested parallelism, each subtask receives the complete N-entry set, making worker heap usage O(P×N) for N live packs and P cleanup tasks. Live packs scale with retained snapshots and files, so increasing parallelism can make the distributed cleaner OOM on exactly the large tables it is intended to handle.\n\nPlease turn the frozen identities into a lineage-detached bounded source and use a keyed bounded anti-join with candidates, as FlinkOrphanFilesClean already does, so each task retains only its key partition while preserving the no-recomputed-mark safety property. The current 256-orphan scale case has a small live set and does not exercise this amplification.
Expose managed blob pack GC on Flink and freeze the used-pack set before deletion so a lost mark shuffle cannot drop a live pack.
f695bb7 to
2129cf6
Compare
Thanks for the catch. The deletion filter captured the full frozen HashSet, so each cleanup subtask held all N identities (O(P×N)). Deletion now re-sources the frozen names with An empty used set skips |
Purpose
Add Flink
remove_orphan_blobs(action + procedure) for unreferenced primary-key.managed.blobpacks, stacked on the landed core cleaner and Spark procedure.localreusesLocalManagedBlobOrphanFilesCleandistributedfreezes the validated used-pack set withexecuteAndCollectbefore listing candidates, then filters with a capturedHashSet. Deletion does not reconnect the sidecar/mark DAG, so a lost used-pack shuffle cannot drop a live packSKIP_MANAGED_BLOB_GC)database.*runs tables one after another so one table’s freeze cannot execute another table’s uncommitted deletion graphALL_EXCHANGES_BLOCKINGdocs/docs/flink/procedures/repair.md, procedure index, andblob-storage.mdTests
RemoveOrphanBlobsActionITCase/RemoveOrphanBlobsActionITCaseBasetestDeleteUnreferencedManagedBlobPacktestMissingManagedBlobSidecarSkipsPackGctestDistributedDeleteWithEmptyUsedPackSettestDistributedUnresolvableRelativeCandidateSkipsGctestDistributedMarkReadsSharedMetadataOncePerPasstestDistributedCleanupDoesNotHangWithPipelinedShuffletestDistributedDeletionAccountingSurvivesCleanupTaskRestartAfterDeletetestDistributedCanonicalAliasCandidatesAreCountedOncetestActionFactoryDryRunParsingtestActionFactoryRejectsInvalidDryRuntestActionFactoryRejectsNonPositiveParallelismtestProcedureRejectsNonPositiveParallelismtestFrozenUsedMarkIsNotRecomputedDuringDeletiontestUsedPackSetChangeSkipsGctestRemoveDatabaseOrphanBlobstestProcedureDryRunRemoveOrphanFilesActionITCaseBasetestDistributedCleanupForcesBlockingShuffleRemoveOrphanBlobsActionITCase