← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1529572] [NEW] Replace locations with multi-requests returns wrong result

 

Public bug reported:

Env: glance-master,

Reproduce:
1. Suppose there is an image with its location in Glance already.

2. send a  location-update request with two bodies, like:

[
    {
      "op":"replace",
   "path":"/locations",
      "value":[
      ]
   },

   {
      "op":"replace",
   "path":"/locations",
      "value":[
        {
            "url": "swift+http://admin:admin:root@10.229.45.145:35357/v3/glance/wrong-test.img";,
             #note: this is a wrong location url.
            "metadata": {}
        }
      ]
   }
]

The first body is to set the location to empty. The second body is to
set the location to a new one, but the url is wrong.

3. the Glance raise an error: Invalid locations. Because that I send a
wrong url to Glance.

4. Show the image.

Expect result:
the image's status is 'queued' and the location is empty.

Actual result:
the image's status is 'active',  but the location is empty.

The reason is that Glance save the image' information to db when the
hole request is over. But i give the wrong url, so that the the location
has been removed and image didn't be saved to db.

So IMO, we should take db saving each time  we change the location.

** Affects: glance
     Importance: Undecided
     Assignee: wangxiyuan (wangxiyuan)
         Status: New

** Changed in: glance
     Assignee: (unassigned) => wangxiyuan (wangxiyuan)

** Description changed:

  Env: glance-master,
  
  Reproduce:
- 1. Suppose there is an image with its location in Glance already. 
+ 1. Suppose there is an image with its location in Glance already.
+ 
  2. send a  location-update request with two bodies, like:
  
  [
-     {
-       "op":"replace",
- 	  "path":"/locations",
-       "value":[
-       ]
-    },
-     
-    {
-       "op":"replace",
- 	  "path":"/locations",
-       "value":[
-         {
-             "url": "swift+http://admin:admin:root@10.229.45.145:35357/v3/glance/wrong-test.img";,  
-              #note: this is a wrong location url.
-             "metadata": {}
-         }
-       ]
-    }
+     {
+       "op":"replace",
+    "path":"/locations",
+       "value":[
+       ]
+    },
+ 
+    {
+       "op":"replace",
+    "path":"/locations",
+       "value":[
+         {
+             "url": "swift+http://admin:admin:root@10.229.45.145:35357/v3/glance/wrong-test.img";,
+              #note: this is a wrong location url.
+             "metadata": {}
+         }
+       ]
+    }
  ]
- 3. the Glance raise an error: Invalid locations. Because that I send a wrong url to Glance.
+ 
+ The first body is to set the location to empty. The second body is to
+ set the location to a new one, but the url is wrong.
+ 
+ 3. the Glance raise an error: Invalid locations. Because that I send a
+ wrong url to Glance.
+ 
  4. Show the image.
  
  Expect result:
  the image's status is 'queued' and the location is empty.
  
  Actual result:
  the image's status is 'active',  but the location is empty.
  
  The reason is that Glance save the image' information to db when the
  hole request is over. But i give the wrong url, so that the the location
  has been removed and image didn't be saved to db.
  
  So IMO, we should take db saving each time  we change the location.

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

Title:
  Replace locations with multi-requests returns wrong result

Status in Glance:
  New

Bug description:
  Env: glance-master,

  Reproduce:
  1. Suppose there is an image with its location in Glance already.

  2. send a  location-update request with two bodies, like:

  [
      {
        "op":"replace",
     "path":"/locations",
        "value":[
        ]
     },

     {
        "op":"replace",
     "path":"/locations",
        "value":[
          {
              "url": "swift+http://admin:admin:root@10.229.45.145:35357/v3/glance/wrong-test.img";,
               #note: this is a wrong location url.
              "metadata": {}
          }
        ]
     }
  ]

  The first body is to set the location to empty. The second body is to
  set the location to a new one, but the url is wrong.

  3. the Glance raise an error: Invalid locations. Because that I send a
  wrong url to Glance.

  4. Show the image.

  Expect result:
  the image's status is 'queued' and the location is empty.

  Actual result:
  the image's status is 'active',  but the location is empty.

  The reason is that Glance save the image' information to db when the
  hole request is over. But i give the wrong url, so that the the
  location has been removed and image didn't be saved to db.

  So IMO, we should take db saving each time  we change the location.

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