[Ovirt-devel] [PATCH server] Add LVM volume scanning back into taskomatic.
Ian Main
imain at redhat.com
Thu Feb 5 22:55:30 UTC 2009
On Thu, 05 Feb 2009 10:48:02 +0100
Chris Lalancette <clalance at redhat.com> wrote:
> A couple of comments inline.
>
> Ian Main wrote:
> > phys_libvirt_pool = LibvirtPool.factory(db_pool_phys)
> > phys_libvirt_pool.connect(@session, node)
> > + db_pool_phys.state = StoragePool::STATE_AVAILABLE
> > + db_pool_phys.save!
>
> This might not be your fault (I might have done this in the earlier code), but
> this opens you up to a race condition. At this point, you've now marked the
> physical pool as "available", which means that the front-end will make it
> available to users. That means that while you are in the process of adding
> volumes to the db below, the user could also be adding volumes from the
> front-end, and they could conflict. You should be able to solve this pretty
> easily by not marking the pool as available until you know you are done.
Well, it seems to me the right way to do this then is with commit/rollback.
As implemented currently you can end up with a 'pending_setup' pool that you
can't delete. I don't think it should add any record if it fails.
Ian
More information about the ovirt-devel
mailing list