Given the non-blocking nature of RPC cast, what happens in volume
manager and volume driver can happen in parallel with the DB update.
If volume driver relies on original DB record to do things, then
DB record shouldn't be updated until volume driver finishes its job.
So this patch change volume RPC API accept_transfer() from cast
to call to make sure the workflow is in serialized manner. Also
elevated the context when volume manager tries to update the DB
record when driver has done accept_transfer().
Closes-bug: #1357432
Conflicts: cinder/volume/rpcapi.py
Change-Id: Ieae52e167aa02967338e0be5d78d570d682faa7a
(cherry picked from commit 7e95b05b937e632ae8aee82cfa8f6f31835e6316)
Reviewed: https:/ /review. openstack. org/127147 /git.openstack. org/cgit/ openstack/ cinder/ commit/ ?id=ffc886b55b3 22c7ad55270bb40 ee87c02426f3c0
Committed: https:/
Submitter: Jenkins
Branch: stable/icehouse
commit ffc886b55b322c7 ad55270bb40ee87 c02426f3c0
Author: Zhiteng Huang <email address hidden>
Date: Sun Sep 7 10:22:52 2014 -0700
Fix possible race condition for accept transfer
Accept transfer API workflow is currently like this:
call volume_ api.accept_ transfer( )
|
--- RPC cast to volume manager
|
--- volume manager calls volume driver accept_transfer()
update volume's DB record
Given the non-blocking nature of RPC cast, what happens in volume
manager and volume driver can happen in parallel with the DB update.
If volume driver relies on original DB record to do things, then
DB record shouldn't be updated until volume driver finishes its job.
So this patch change volume RPC API accept_transfer() from cast
to call to make sure the workflow is in serialized manner. Also
elevated the context when volume manager tries to update the DB
record when driver has done accept_transfer().
Closes-bug: #1357432
Conflicts:
cinder/ volume/ rpcapi. py
Change-Id: Ieae52e167aa029 67338e0be5d78d5 70d682faa7a ae8aee82cfa8f6f 31835e6316)
(cherry picked from commit 7e95b05b937e632