lance-format / lance-format/lance

Proactively cleanup garbage files during write abort

Open
#4,508 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
7.1k
Forks
852
Avg merge
3d 18h
Merged PRs (30d)
272

Description

Related to https://github.com/apache/fluss/pull/1441#discussion_r2280929949

When aborting a write, we could proactively cleanup garbage files.

It is debatable if the format or the engine should do this, for example Iceberg does both:

Task writer abort: https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/io/BaseTaskWriter.java#L93

Spark cleanup: https://github.com/apache/iceberg/blob/main/spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/source/SparkCleanupUtil.java#L56

but currently because Lance uses object_store, and it does not really have a binding for Java, either Lance needs to expose the cleanup hook for engine to invoke, or engine has to configure another file system library to do cleanup, both not ideal.

My take is that we probably also need both:

For process that directly call Lance library to perform write, e.g. merge-insert, it makes sense that the merge-insert job does its own cleanup in case of any failure.

But if engine has any custom logic and want to control the cleanup process, they should have a way to do so. For that, I think the work in OpenDAL https://github.com/apache/opendal/issues/6456 is very useful, so we can make OpenDAL basically the file system SDK for engines to interact with Lance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked pull request discussion and OpenDAL issue 6456, then compare the cited Iceberg task-writer and Spark cleanup paths. Define how aborted-write cleanup should serve direct Lance callers such as merge-insert while allowing engines to control cleanup; done means the ownership and integration approach are agreed and implemented.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, data-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.