Skip to content
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

Concurrent reads/writes cause BlobNotFound #413

Open
charmoniumQ opened this issue May 2, 2023 · 0 comments
Open

Concurrent reads/writes cause BlobNotFound #413

charmoniumQ opened this issue May 2, 2023 · 0 comments

Comments

@charmoniumQ
Copy link

A write is implemented as a delete and then upload. If reads are concurrent with the write, then there is a chance the readers will get there after the delete but before the upload.

This could be called "not a bug; adlfs doesn't support concurrent reads/writes", but part of the point of object storage is to use on distributed systems with lots of concurrency. The docs guarantee strong consistency, so reads racing writes is supposed to return the most recent write. Adlfs breaks those semantics by deleting before uploading.

I can reliably trigger this problem with the following code:

import dask.distributed, adlfs, azure.identity.aio
parallel_client = dask.distributed.Client()
def test():
    abfs = adlfs.AzureBlobFileSystem(account_name="wfregtest", credential=azure.identity.aio.DefaultAzureCredential())
    for _ in range(30):
        with abfs.open("data4/test", "rb") as fobj:
            buffer = fobj.read()
        with abfs.open("data4/test", "wb") as fobj:
            fobj.write(buffer)

parallel_client.run(test)

This is related to #236 and #264. #264 in particular just ignores the delete if it fails. I was wondering if the delete can be removed entirely?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant