Skip to content

Commit

Permalink
Change the comments of SOFT_DELETED race condition
Browse files Browse the repository at this point in the history
_reclaim_queued_deletes will only find instances in SOFT_DELETED
state and delete them if they are only old enough. The quotas will be
committed when the instance was soft-deleted so that resource can
be used right after the soft-delete operation.

There are some concern about the quota inconsistency for the operation,
The only case that the quota might be inconsistent is
the compute node died between set instance state to SOFT_DELETED
and quota commit to DB; when compute node start again
it will have no idea the reservation is committed or not or even
expired, since it's a rare case, so marked as todo.

There are some alternatives if the problem need to be fixed, e.g.
able to find reservation when nova compute restart, so we can double
check whether the quota is committed or not.

Partial-Bug: #1296414

Change-Id: Idf9c179b2dd439462a646568ffd5098cd5d7851f
  • Loading branch information
jichenjc committed Jul 2, 2014
1 parent 1addb63 commit 1b35a3b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions nova/compute/manager.py
Expand Up @@ -5490,11 +5490,12 @@ def _reclaim_queued_deletes(self, context):
LOG.debug("CONF.reclaim_instance_interval <= 0, skipping...")
return

# FIXME(comstud): Dummy quota object for now. See bug 1296414.
# We have potential for inconsistency if we decide here to not
# update quotas. _delete_instance() should determine whether or
# not to update quotas based on if instance is in a SOFT_DELETED
# state or not.
# TODO(comstud, jichenjc): Dummy quota object for now See bug 1296414.
# The only case that the quota might be inconsistent is
# the compute node died between set instance state to SOFT_DELETED
# and quota commit to DB. When compute node starts again
# it will have no idea the reservation is committed or not or even
# expired, since it's a rare case, so marked as todo.
quotas = quotas_obj.Quotas.from_reservations(context, None)

filters = {'vm_state': vm_states.SOFT_DELETED,
Expand Down

0 comments on commit 1b35a3b

Please sign in to comment.