Public bug reported:

We meet this problem in our production environment.

When users is deleting an image but the glance-api process is down or
restarted suddenly, the image's status will be 'deleted', but the
'deleted' column in the image table is False. This lead an error that
the image still can be shown, but its status is 'deleted', and then it
can't be deleted anymore either by DELETE API call or db purge.

I found that the bug related to the code:
https://github.com/openstack/glance/blob/master/glance/db/__init__.py#L205

what glance does;
1. mark the image's status as 'deleted'
2. then delete the image's property and mark the image as deleted=True, 
deleted_at=xxx.

If the glance-api process or the DELETE API call is down between step 1
and 2. The case I mentioned above will occur.

I have two idea to solve the problem:
1. add a check mechanism to service initialization. When glance-api process 
start, it should check the db data, purge the  remain ones.
2. combine step 1 and step 2 into one sql transaction to avoid data 
inconsistency.

** Affects: glance
     Importance: Undecided
         Status: New

** Description changed:

  We meet this problem in our production environment.
  
- When users is deleting a image but the glance-api process is down or
+ When users is deleting an image but the glance-api process is down or
  restarted suddenly, the image's status will be 'deleted', but the
  'deleted' column in the image table is False. This lead an error that
  the image still can be shown, but its status is 'deleted', and then it
  can't be deleted anymore either by DELETE API call or db purge.
  
  I found that the bug related to the code:
  https://github.com/openstack/glance/blob/master/glance/db/__init__.py#L205
  
  what glance does;
  1. mark the image's status as 'deleted'
  2. then delete the image's property and mark the image as deleted=True, 
deleted_at=xxx.
  
  If the glance-api process or the DELETE API call is down between step 1
  and 2. The case I mentioned above will occur.
  
  I have two idea to solve the problem:
  1. add a check mechanism to service initialization. When glance-api process 
start, it should check the db data, purge the  remain ones.
  2. combine step 1 and step 2 into one sql transaction to avoid data 
inconsistency.

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1755411

Title:
  image can't be deleted in some case

Status in Glance:
  New

Bug description:
  We meet this problem in our production environment.

  When users is deleting an image but the glance-api process is down or
  restarted suddenly, the image's status will be 'deleted', but the
  'deleted' column in the image table is False. This lead an error that
  the image still can be shown, but its status is 'deleted', and then it
  can't be deleted anymore either by DELETE API call or db purge.

  I found that the bug related to the code:
  https://github.com/openstack/glance/blob/master/glance/db/__init__.py#L205

  what glance does;
  1. mark the image's status as 'deleted'
  2. then delete the image's property and mark the image as deleted=True, 
deleted_at=xxx.

  If the glance-api process or the DELETE API call is down between step
  1 and 2. The case I mentioned above will occur.

  I have two idea to solve the problem:
  1. add a check mechanism to service initialization. When glance-api process 
start, it should check the db data, purge the  remain ones.
  2. combine step 1 and step 2 into one sql transaction to avoid data 
inconsistency.

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1755411/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to