-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: default logstore implementation #1742
feat: default logstore implementation #1742
Conversation
ACTION NEEDED delta-rs follows the Conventional Commits specification for release automation. The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification. |
I'm not yet happy with how it turned out - opening as draft PR to allow others to weigh in on the approach. In particular, the abstraction / separation between Due to the fact that most operations (see I'm thinking that maybe the functionality of Happy to hear your thoughts! |
Agreed, one of the things we were discussing and are moving (admittedly somewhat slowly) towards is to get rid of all the specific object store related implementations we have in this crate. to this end we recently removed the custom local storage. There are a few operations which i believe require additional APIs - like VACUUM or FSCK - an these may yet need access to the underlying object store. Also for the Datafusion integration we need to register a store that exposes object store apis directly. All in all though being able to properly interop with spark / databricks would be great! These are just some initial thoughts an will give this a more thorough review soon! Thanks for this great work! |
db65ba9
to
2bd1ef8
Compare
6a0d7b1
to
b0d0111
Compare
15cc211
to
7f34f66
Compare
@roeap : I would appreciate your opinion on how to move this forward. One option I mentioned above is to merge all
It's difficult for me to gauge how this impacts other lines of work currently ongoing, like crate splitting, ongoing kernel work, so I'd rather resolve this quickly before too many additional conflicts pile up. I'm not 100% sure on the datafusion integration parts you mention - I had a quick look at |
@dispanser - sorry for the delay.
I believe this is the way to go. IIRC we have very little additional functionality added - i.e. just generating a unique URL for the specific object-store we use, as well as a simple check if a location is a delta table ( The main question I think is how we handle the Datafusion integration. The reason we need to create a unique store for datafusion is, that we always assume that the object stores root points at the root location for the delta table. This behaviour actually blocks us to have full delta protocol support, which allows relative paths as well as urls. Within the kernel migrations we are also looking to migrate to URls in all external APIs instead of objects stores I guess eventually we want to internally use somehting like datafusions registry to manage multiple stores if needed.
Given the above, the answer is yes, we just need to register it for our custom unique url for now to handle the |
ccf67b3
to
112f7ea
Compare
112f7ea
to
394ae2b
Compare
Introduce a `LogStore` abstraction to channel all log store reads and writes through a single place. This is supposed to allow implementations with more sophisticated locking mechanisms that do not rely on atomic rename semantics for the underlying object store. This does not change any functionality - it reorganizes read operations and commits on the delta commit log to be funneled through the respective methods of `LogStore`. The goal is to align the implementation of multi-cluster writes for Delta Lake on S3 with the one provided by the original `delta` library, enabling multi-cluster writes with some writers using Spark / Delta library and other writers using `delta-rs` For an overview of how it's done in delta, please see: 1. Delta [blog post](https://delta.io/blog/2022-05-18-multi-cluster-writes-to-delta-lake-storage-in-s3/) (high-level concept) 2. Associated Databricks [design doc](https://docs.google.com/document/d/1Gs4ZsTH19lMxth4BSdwlWjUNR-XhKHicDvBjd2RqNd8/edit#heading=h.mjjuxw9mcz9h) (detailed read) 3. [S3DynamoDbLogStore.java](https://github.com/delta-io/delta/blob/master/storage-s3-dynamodb/src/main/java/io/delta/storage/S3DynamoDBLogStore.java)(content warning: Java code behind this link) This approach requires readers of a delta table to "recover" unfinished commits from writers - as a result, reading and writing is combined in a single interface, which in this PR is modeled after [LogStore.java](https://github.com/delta-io/delta/blob/master/storage/src/main/java/io/delta/storage/LogStore.java). Currently in `delta-rs`, read path for commits is implemented directly in `DeltaTable`, and there's no mechanism to implement storage-specific behavior like interacting with DynamoDb.
394ae2b
to
37706cc
Compare
69f9f3d
to
711c031
Compare
@roeap , I managed to remove all of FWIW I opted for not doing |
@dispanser - awesome work, excited to get this merged, will get reviewing right away.
I believe that was the right thing to do. The actual solution to this is also just to move to URLs rather then object store paths in our external handling, including datafusion. once that is done, we have no more need for a dedicated store and can also get righ of the extra stuff on logstore. As it so happens I have a PR in preparation that at least should get us a little bit in that direction 😄. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great, left some minor nit comments, but overall I think this is ready to go.
One more merge with main and if you want address some comments, then we can merge.
Thanks for sticking with it, and really think this is a great improvement to the library.
Co-authored-by: Robert Pack <[email protected]>
@dispanser - the latest build failures are related to a new release of dynamo-db lock, so we have to get the fix onto main first. |
Use `ObjectStore::delete_stream()` instead, which can utilize batch-delete operations from underlying cloud store APIs and is generally smarter (e.g., by emitting concurrent requests)
I'll have a look into these, thanks for pointing them out. |
The new version of this crate properly sets a lease duration such that the locks can actually expire
# Description Introduce a `LogStore` abstraction to channel all log store reads and writes through a single place. This is supposed to allow implementations with more sophisticated locking mechanisms that do not rely on atomic rename semantics for the underlying object store. This does not change any functionality - it reorganizes read operations and commits on the delta commit log to be funneled through the respective methods of `LogStore`. ## Rationale The goal is to align the implementation of multi-cluster writes for Delta Lake on S3 with the one provided by the original `delta` library, enabling multi-cluster writes with some writers using Spark / Delta library and other writers using `delta-rs` For an overview of how it's done in delta, please see: 1. Delta [blog post](https://delta.io/blog/2022-05-18-multi-cluster-writes-to-delta-lake-storage-in-s3/) (high-level concept) 2. Associated Databricks [design doc](https://docs.google.com/document/d/1Gs4ZsTH19lMxth4BSdwlWjUNR-XhKHicDvBjd2RqNd8/edit#heading=h.mjjuxw9mcz9h) (detailed read) 3. [S3DynamoDbLogStore.java](https://github.com/delta-io/delta/blob/master/storage-s3-dynamodb/src/main/java/io/delta/storage/S3DynamoDBLogStore.java)(content warning: Java code behind this link) This approach requires readers of a delta table to "recover" unfinished commits from writers - as a result, reading and writing is combined in a single interface, which in this PR is modeled after [LogStore.java](https://github.com/delta-io/delta/blob/master/storage/src/main/java/io/delta/storage/LogStore.java). Currently in `delta-rs`, read path for commits is implemented directly in `DeltaTable`, and there's no mechanism to implement storage-specific behavior like interacting with DynamoDb. --------- Co-authored-by: Robert Pack <[email protected]>
Introduce a `LogStore` abstraction to channel all log store reads and writes through a single place. This is supposed to allow implementations with more sophisticated locking mechanisms that do not rely on atomic rename semantics for the underlying object store. This does not change any functionality - it reorganizes read operations and commits on the delta commit log to be funneled through the respective methods of `LogStore`. The goal is to align the implementation of multi-cluster writes for Delta Lake on S3 with the one provided by the original `delta` library, enabling multi-cluster writes with some writers using Spark / Delta library and other writers using `delta-rs` For an overview of how it's done in delta, please see: 1. Delta [blog post](https://delta.io/blog/2022-05-18-multi-cluster-writes-to-delta-lake-storage-in-s3/) (high-level concept) 2. Associated Databricks [design doc](https://docs.google.com/document/d/1Gs4ZsTH19lMxth4BSdwlWjUNR-XhKHicDvBjd2RqNd8/edit#heading=h.mjjuxw9mcz9h) (detailed read) 3. [S3DynamoDbLogStore.java](https://github.com/delta-io/delta/blob/master/storage-s3-dynamodb/src/main/java/io/delta/storage/S3DynamoDBLogStore.java)(content warning: Java code behind this link) This approach requires readers of a delta table to "recover" unfinished commits from writers - as a result, reading and writing is combined in a single interface, which in this PR is modeled after [LogStore.java](https://github.com/delta-io/delta/blob/master/storage/src/main/java/io/delta/storage/LogStore.java). Currently in `delta-rs`, read path for commits is implemented directly in `DeltaTable`, and there's no mechanism to implement storage-specific behavior like interacting with DynamoDb. --------- Co-authored-by: Robert Pack <[email protected]>
Description
Introduce a
LogStore
abstraction to channel all log store reads and writes through a single place. This is supposed to allow implementations with more sophisticated locking mechanisms that do not rely on atomic rename semantics for the underlying object store.This does not change any functionality - it reorganizes read operations and commits on the delta commit log to be funneled through the respective methods of
LogStore
.Rationale
The goal is to align the implementation of multi-cluster writes for Delta Lake on S3 with the one provided by the original
delta
library, enabling multi-cluster writes with some writers using Spark / Delta library and other writers usingdelta-rs
For an overview of how it's done in delta, please see:This approach requires readers of a delta table to "recover" unfinished commits from writers - as a result, reading and writing is combined in a single interface, which in this PR is modeled after LogStore.java. Currently in
delta-rs
, read path for commits is implemented directly inDeltaTable
, and there's no mechanism to implement storage-specific behavior like interacting with DynamoDb.