-
-
Notifications
You must be signed in to change notification settings - Fork 293
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
Question: Fencing tokens for storage #205
Comments
That is a great question and is probably why I haven't implemented it yet. I'm willing to revise the Storage interface to accept a fencing token as a parameter. We can actually do it in a non-breaking way by making the new parameter variadic (for now -- I'd want to help the few implementations I know of to update, then remove the variadicity). |
It seems to me that since a storage implementation where the call to Since this is the case it seems to me the easiest approach for how this would work for Does that make sense? |
@eest Yeah, I think so:
(or something like that) And the fencing tokens are handled completely internally. Did I read you right? |
@mholt: Yes, that is correct. See for example the Consul based storage implementation linked from the wiki which already stores a lock and mutex inside its struct: ... or the redis based one which skips a separate mutex but uses a The implementation specifics differ a bit, but they both store the lock object they create in a map keyed by the name supplied to Lock() or Unlock(). It should not be a huge leap to store additional information like a fencing token in those setups (maybe there could even already be something fencing token capable inside whatever is stored in the map as it is). |
What is your question?
When implementing a storage backend the comment describing
Lock()
mentions the use of fencing tokens:certmagic/storage.go
Lines 108 to 112 in 9826a4c
The way I understand this is that once you have the lock further interaction with the backend while holding the lock, like writing a file, should then include such a token so that the write can fail if the token is out of date.
What I am not understanding is this: given that
Lock()
takes a name, potentially meaning there could be multiple different locks held for different operations at the same time, how would I map aStore()
request with the appropriate lock so that it can access the correct fencing token?What have you already tried?
I have investigated the
Store()
call and from what I can tell the only information available to it is the key name and data that should be written.The text was updated successfully, but these errors were encountered: