-
Notifications
You must be signed in to change notification settings - Fork 200
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
Add custom data to AzureBlobLeaseDistributedLock #161
Comments
@rLindorfer thanks for your interest in the library. A few thoughts/questions:
Note that we actually do attach a timestamp as blob metadata if we're the one who creates the blob. This is creation time rather than lock time, but if the blob did not exist previously then they are going to be very similar.
Do you mean the Azure concept of identity or something specific to your application? I wonder if the former is automatically available from Azure?
I feel like we'd want a
Two points here:
Thoughts? |
@rLindorfer any thoughts on the above? |
Thank you for your answer, sorry about my delayed answer, but I got no github notification concerning your reply.
As you already mentioned, it's the creation time and not the lock time. If the blob is reused, the creation time and the lock time will differ.
I meant something specific to the application, e.g. email of the end-user to show for a example following message: "User X already opened this window..."
I'm not sure if there is any size limit for the metadata, but yes it would be sufficient for many cases. |
Thanks @rLindorfer .
In the blob reuse case, are you imagining that the metadata values would be added after acquisition and then removed after lock release? |
Yes, this would be sufficient. |
any feedback on it? It looks there is no approach to achieve it with azure blob in one transaction, right? Means you cannot get the lease and set the owner which owns the lease atomically. If you break down into 2 transaction, aquire lease and then set owner identity (ip/name/email), there might be inconsistent issue that followers might read staled information. @madelson |
@mjaow I think you are correct. Setting the metadata would just be "best effort" to support debugging and shouldn't be relied on as a synchronization mechanism. Arguably callers could just do this themselves. Is that what you're getting at? |
thanks for confirmation. Another question is: are there any throttling issue if we reply on blob storage to acquire/renew lease in a large cluster (number of clients exceeds 1000)? |
@mjaow youll just have to test it unfortunately I don’t have personal experience with such a configuration |
ok, thanks. From my test result (5k client), no problem. |
Problem
Currently, it is not possible to add additional meta-information to a distributed lock:
Proposed solution
I would be useful if it was possible to add additional data to the created blob, e.g. a JSON uploaded as blob content.
Stream content
to store custom dataCreateIfNotExistsAsync
method, use the givencontent
The text was updated successfully, but these errors were encountered: