Replies: 1 comment 4 replies
-
I think you came with a similar idea which is going to land in the protocol: delta-io/delta#2598, you might jump in that discussion since this is something that we decide on the protocol level and not implementation |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm interested in writing what I'll call sparse commit ids.
The idea is to get control over concurrency so I can have multiple concurrent writers without commit contention on an append-only table.
My plan is to use a Postgres sequence (or similar from Redis, etc.) to get monotonically increasing commit ids numbers. Each writer asks for a commit id that it now owns then goes and writes out that commit. I'd space them out by 10 (so writers would get commit ids
10, 20, 30
, etc. approximately). So they'll be some missing commits, either because of the spacing, because a writer claimed a commit and then failed to write it, or because writer for commit 20 gets there before writer for commit 10. Somewhat to my surprise, readers (or at least delta-rs) do not seem to care if there are missing commits.This is a all a bit abstract, so here's an example with a home made writer:
This example seeks to prove that with this approach you always end up with the same table no matter in what order you run the operations. Realistically things wouldn't be happening this out of order, something maybe realistic would be:
The protocol explicitly states that checkpoints can be run at any time. The one caveat with this setup is that all commits older than the checkpoint commit must have been committed or they'll be lost forever. I'm okay with that, I can just wait 10s or so before writing a checkpoint.
Compaction is a bit trickier: you can't have two compactions running concurrently on different commits, otherwise they might delete the same files. Since compaction can be a long running operation and isn't happening that frequently I'm okay running it out of band and ensuring only 1 compaction per table runs at a time.
Beta Was this translation helpful? Give feedback.
All reactions