Add is_non_acquirable field to the dynamodb lock #429
Merged
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.
Description
If there's any outside of delta-rs writes to the table that are done with s3 backend and dynamodb lock, we want the mechanism to immediately stop delta-rs writes if required.
The example could be the dropping of a table. For example you acquire a lock and then try drop (or drop/create etc., something that modifies the delta log completely) a table. The dangerous part here is that the concurrent delta workers will still perform the write whenever the lock is available, because we effectively lock the
rename
operation.To prevent that, this PR introduces a
is_non_acquirable
that will cause delta-rs writer to fail immediately (or to be precise return the specific error) when the remote lock has this field set. For this to work, the outside of delta-rs writer, which performs the dangerous operation, has to set this field by itself once the lock is acquired.