History | View | Annotate | Download (4.3 kB)
Fix whitespace, Licence
Re-implement select_for_update
Previous implementation of 'select_for_update' method was based on anattribute of the 'ForUpdateManager'. However, the model manager is sharedbetween all threads, which lead to race conditions. This commitreimplements 'select_for_update', by making it return a custom QuerySet...
pep8 fixes
Perform allocations in separate transactions
Add ForUpdateManager to the Backend model, in order to guaranteeexclusive order when allocating a VM.
Use manual transactions when allocating Backend and public IP for a newVM, since these allocations need exclusive access (SELECT..FOR UPDATE)...
Implement model manager using row-level db locking
Implement ForUpdateManager that uses SELECT .. FOR UPDATE statement inorder to acquire row-level exclusive locks to DB. Essentially thismanager backports the select_for_update() method that is implemented in...