Comment 17 for bug 1202896

Revision history for this message
Alexei Kornienko (alexei-kornienko) wrote : Re: quota_usage data constantly out of sync

I think that all the mess we get with quotas is because cinder quotas implementation is not very consistent.
What i see is that we reserve quotas in 1 method and commit/rollback them in another method. quota reservation can be passed through rpc so it means that it's reserved in 1 processes and commited in another. IMHO such approach is very fragile and error prone.
I propose to implement quota reservation as a context manager:

with quotas.reserve(...) as reservation:
    ...

This will allow us to make sure that quotas always stay consitent and will remove the need to expire quotas. I can prepare a POC patch if you are interested. What do you think?