volplugin
volplugin copied to clipboard
Indexing of use locks
Use locks are very useful for controlling mount flow but the UX sucks.
We have watch tools and listing tools, but we really don't have a way of expressing this statement (which I feel to be a pretty important one):
"What hosts are using what volumes?"
Another one that I would like is:
"What volumes are in what states?"
This could be accomplished with a set of indexes which were taken as locks alongside the primary lock. lock.ExecuteWithMultiUseLock can accomplish this atomically.
What I think needs to happen is that this method needs to be extended to do two things:
- [ ] Canned method for acquiring use locks in
config/use.goin a way that also populates indexes - [ ] Multi-Acquire with TTL refresh, which would wrap
ExecuteWithMultiUseLocksimilar tolock.AcquireWithTTLRefresh's behavior withacquire.
The feature also needs a few volcli functions (I think switches would be better than commands here, but up to the implementer):
- [ ] List uses by host
- [ ] Watch uses by host
- [ ] All uses by state (
Reasonin the use struct) - [ ] All uses by state, by host.