Python3 librados incompatibility

Bug #1816721 reported by Michal Arbet on 2019-02-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glance_store
Undecided
Michal Arbet

Bug Description

Hello, found a bug in glance. Glance is storing bad direct_url='rbd://b%27868c2b5d-12f1-4f3f-aa2a-5701a3bb1041%27/images/7b1f429e-ad2f-40b2-be9e-8552edae8938/snap' in database. This is causing several problems, as in https://bugs.launchpad.net/cinder/+bug/1816468

root@openstack-controller:/tmp# openstack image create --container-format bare --disk-format raw --file cirros-0.3.4-x86_64-disk.img cirros-test-1

+------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| checksum | ee1eca47dc88f4879d8a229cc70a07c6 |
| container_format | bare |
| created_at | 2019-02-20T09:08:45Z |
| disk_format | raw |
| file | /v2/images/7b1f429e-ad2f-40b2-be9e-8552edae8938/file |
| id | 7b1f429e-ad2f-40b2-be9e-8552edae8938 |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros-test-1 |
| owner | ba5ef70fd99642fdb75c9307c88b1164 |
| properties | direct_url='rbd://b%27868c2b5d-12f1-4f3f-aa2a-5701a3bb1041%27/images/7b1f429e-ad2f-40b2-be9e-8552edae8938/snap', os_hash_algo='sha512', os_hash_value='1b03ca1bc3fafe448b90583c12f367949f8b0e665685979d95b004e48574b953316799e23240f4f739d1b5eb4c4ca24d38fdc6f4f9d8247a2bc64db25d6bbdb2', os_hidden='False' |
| protected | False |
| schema | /v2/schemas/image |
| size | 13287936 |
| status | active |
| tags | |
| updated_at | 2019-02-20T09:08:48Z |
| virtual_size | None |
| visibility | shared |
+------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

mysql> select * from image_locations where image_id = '7b1f429e-ad2f-40b2-be9e-8552edae8938'\G;
*************************** 1. row ***************************
        id: 32
  image_id: 7b1f429e-ad2f-40b2-be9e-8552edae8938
     value: rbd://b%27868c2b5d-12f1-4f3f-aa2a-5701a3bb1041%27/images/7b1f429e-ad2f-40b2-be9e-8552edae8938/snap
created_at: 2019-02-20 09:08:48
updated_at: 2019-02-20 09:08:48
deleted_at: NULL
   deleted: 0
 meta_data: {}
    status: active
1 row in set (0.00 sec)

ERROR:
No query specified

get_fsid function from librados returns different ID representation, in py2 it is STR, in py3 it is bytes.

It can be fixed by oslo_utils.encodeutils.safe_decode

I will post the change.

affects: glance → glance-store
Michal Arbet (michalarbet) wrote :

Also causing cinder issues, cinder is parsing ID from direct url , when direct url is corrupted in db ... cinder-glance acceleration is not working =>

https://bugs.launchpad.net/cinder/+bug/1816468

Changed in glance-store:
assignee: nobody → Michal Arbet (michalarbet)
Changed in glance-store:
status: New → In Progress

Reviewed: https://review.openstack.org/635230
Committed: https://git.openstack.org/cgit/openstack/glance_store/commit/?id=9c73370358c02fc7f308d88f4563f22969a42c96
Submitter: Zuul
Branch: master

commit 9c73370358c02fc7f308d88f4563f22969a42c96
Author: Michal Arbet <email address hidden>
Date: Wed Feb 6 18:38:22 2019 +0100

    Fix python3 compatibility of rbd get_fsid

    In python3 conn.get_fsid() is represented as binary.
    Because of this, direct_url is corrupted in DB.
    This patch is fixing this. More informations in
    closing bug.

    Closes-Bug: #1816721

    Change-Id: I6a89042fae63bf5c9096a6bee6774aebf3f5864b

Changed in glance-store:
status: In Progress → Fix Released

This issue was fixed in the openstack/glance_store 0.28.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers