Repository navigation
feat: distributed cleanup_old_versions - #5315
Draft
LuciferYang wants to merge 3 commits into
Draft
LuciferYang wants to merge 3 commits into
LuciferYang wants to merge 3 commits into
Conversation
The new pylance API is missing from the release CI pins, so a fake plan with the real signature covers dispatch, retries, the rate split, failures and progress logging there. Explain failures get their own error, and on_result is now tested in the dispatch helper.
This was referenced Oct 22, 2026
Draft
LuciferYang
marked this pull request as draft
October 22, 2026 09:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds
lance_ray.cleanup_old_versionsandlance_ray.explain_cleanup_old_versions. The driver plans the cleanup withLanceDataset.plan_cleanup_old_versionsfrom lance-format/lance#10235, runs each sweep task on an idle Ray worker, retries a failed task up tomax_task_retriestimes, and finishes the plan. Lance decides which files are removed; lance-ray only schedules the ranges. The driver logs a line as each range finishes, with the directory, the range and the running number of files and bytes removed.Closes #98.
delete_rate_limitcovers the whole cleanup and is split evenly between the workers, with at least one request per second each.delete_concurrencyapplies per worker.max_tasksdefaults to four tasks per worker.namespace_implandtable_id.RuntimeErroris raised. By then the plan has already removed the old versions, and later cleanups only remove the files the failed tasks left as unverified files.plan_cleanup_old_versions, including the 12.0.0 pinned here, the cleanup runs on the driver and logs a warning._map_async_with_pooland_BatchWorkermove fromindex.pyto_dispatch.py, so index building and cleanup share them. The function now takes any list of items and anon_result(index, result)callback, called once per item with its final result. Index building behaves as before, except that its retry warnings now come from thelance_ray._dispatchlogger instead oflance_ray.index.Testing
The pinned pylance lacks the new API, so the tests that need it skip in CI. To cover the driver there, a fake plan with the real
plan_cleanup_old_versionssignature checks that every task is dispatched and its result passed tofinishin task order, that a failed task is retried, that a task that still fails raises without finishing the plan, that the rate limit is split, thatmax_tasksreaches the plan, and that progress is logged. With a pylance wheel built from lance-format/lance#10235, the other tests compare against single-processexplain_cleanup_old_versionsandcleanup_old_versions, run through a directory namespace, and check what a failed task leaves. On the same wheel, a 30-version local table with overwrites, deletions, a BTREE index, a tag, and old and new orphans ended with the same files, stats, data and tagged version under single-process cleanup and under lance-ray with four workers (one task per directory on the local filesystem).