volplugin icon indicating copy to clipboard operation
volplugin copied to clipboard

Indexing of use locks

Open erikh opened this issue 9 years ago • 0 comments

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.go in a way that also populates indexes
  • [ ] Multi-Acquire with TTL refresh, which would wrap ExecuteWithMultiUseLock similar to lock.AcquireWithTTLRefresh's behavior with acquire.

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 (Reason in the use struct)
  • [ ] All uses by state, by host.

erikh avatar Jul 28 '16 09:07 erikh