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

No good way to use leases with blobs #16

Closed
yaxia opened this issue Mar 31, 2016 · 8 comments
Closed

No good way to use leases with blobs #16

yaxia opened this issue Mar 31, 2016 · 8 comments

Comments

@yaxia
Copy link
Member

yaxia commented Mar 31, 2016

Migrate from the Azure SDK: Azure/azure-sdk-for-ruby#189

From @schadr:
I am trying to use leases on blob to ensure that only one host can modify the content.

For that purpose I create a lease on a blob by using the
aquire_lease operation
but there is no way to provide the lease_id for calls such as create_blob_pages, so the only way to use leases is to ensure a blob does not get modified while reading from it.

Or am I missing something?

@yaxia
Copy link
Member Author

yaxia commented Mar 31, 2016

@schadr, we will take care of this in a later release. Thanks.

@pcibraro
Copy link

Any expected data for releasing this feature ? Thanks

@xiaomi7732
Copy link
Member

Hi there,
Is there any progress on this issue? I would like to call create_block_blob with a lease id to update the leased block blob.

@yaxia
Copy link
Member Author

yaxia commented Jul 19, 2017

It sounds another vote for this feature. I will prioritize this and have it in next release (expecting August, but not a commitment).

@sbonebrake
Copy link

+1 would also like this feature

@xiaomi7732
Copy link
Member

@sbonebrake,
A workaround I am using here is to create a side file to lock upon. For example, if I intend to lock a.txt, I create a file 'a.txt.lock' and put a lease a.txt.lock. Then, we check the existence and the lease status of the lock file.
Just my 2 cents. Not saying that we should not fix this issue but might be a way to unblock a bit to make more progress for the project.

@sbonebrake
Copy link

Thanks, but this won't work for my project because I plan to have many different machines reading from the same container to process data from Event Hub capture. Fortunately I found another workaround:

Azure::Storage::Service::StorageService.register_request_callback { |headers| headers["x-ms-lease-id"] = lease_id }
blob_client.delete_blob(container_name, blob.name)
Azure::Storage::Service::StorageService.register_request_callback { |headers| headers }

@yaxia
Copy link
Member Author

yaxia commented Nov 20, 2017

We've added the support for per-request lease ID in 0.15.0. Please check it out and any feedback is appreciated.

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

4 participants