backport librbd librados py3 string encoding fixes

Bug #1833079 reported by Edward Hope-Morley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
Fix Released
High
Unassigned
Rocky
Invalid
High
Unassigned
Stein
Fix Released
High
Unassigned
Train
Fix Released
High
James Page
ceph (Ubuntu)
Fix Released
High
James Page
Cosmic
Invalid
High
James Page
Disco
Invalid
High
James Page
Eoan
Fix Released
High
James Page

Bug Description

[Impact]
Requesting back port of py3 encoding fixes to Mimic so that consumers of that code don't get strings returned with invalid encodings when run under py3.

[Test Case]

sudo apt install -y python3-rados
cat << EOF | python3
import rados
name = 'ceph'
conf = '/etc/ceph/ceph.conf'
user = 'a-user'
client = rados.Rados(rados_id=user,
                     clustername=name,
                     conffile=conf)
client.connect()
fsid = client.get_fsid()
if type(fsid) == str:
    print("value={} has correct type={}".format(fsid, type(fsid)))
else:
    print("value={} has incorrect type={} (expect str)".format(fsid, type(fsid)))
EOF

[Regression Potential]
This change ensures that cstr types are automatically decoded/encoded within the generated python bindings for the underlying system libraries.

If python code is blindly decoding the return values from the rados/rbd bindings, its possible this change will break such code paths; however the scoped changes in OpenStack detect the binary type and decode if needed.

This only really impacts any apps running under py3; py2 does lots of implicit conversation so is insulated from this bug.

-----------------------------------------------------------------------------

These fixes relate to issues we have found in Openstack [1][2] when running under Python 3. They are fixed upstream by commit [3] which is available in nautilus and beyond so we would like to backport to mimic and luminous.

[1] https://bugs.launchpad.net/nova/+bug/1816468
[2] https://bugs.launchpad.net/glance-store/+bug/1816721
[3] https://github.com/ceph/ceph/commit/c36d0f1a7de4668eb81075e4a94846cf81fc30cd

Tags: py3
Revision history for this message
James Page (james-page) wrote :

Nautilus is stuck in eoan-proposed at the moment waiting for Ubuntu archive team review; once that's unblocked dev tasks can be marked fix committed.

Changed in ceph (Ubuntu Eoan):
status: New → Fix Committed
importance: Undecided → High
Changed in ceph (Ubuntu Disco):
status: New → Triaged
Changed in ceph (Ubuntu Cosmic):
status: New → Triaged
Changed in ceph (Ubuntu Disco):
importance: Undecided → High
Changed in ceph (Ubuntu Cosmic):
importance: Undecided → High
Revision history for this message
James Page (james-page) wrote :

cosmic and disco both ship with mimic; luminous is also impacted but not in the context of OpenStack as releases prior to Rocky all run under Python 2, not Python 3.

tags: added: py3
Revision history for this message
James Page (james-page) wrote :

Actually this appears to not be in the nautilus release we have in eoan - picking the fix now.

Changed in ceph (Ubuntu Eoan):
status: Fix Committed → In Progress
Changed in ceph (Ubuntu Disco):
status: Triaged → In Progress
Changed in ceph (Ubuntu Cosmic):
status: Triaged → In Progress
assignee: nobody → James Page (james-page)
Changed in ceph (Ubuntu Disco):
assignee: nobody → James Page (james-page)
Changed in ceph (Ubuntu Eoan):
assignee: nobody → James Page (james-page)
description: updated
description: updated
James Page (james-page)
description: updated
description: updated
Revision history for this message
Edward Hope-Morley (hopem) wrote :

The linked patch has actually been reverted upstream (my fault for not spotting that) and the following patch appears to be the one we actually want - https://github.com/ceph/ceph/commit/005f19eff0b4a92647e5847e306718be76704432

This new patch has a much narrower scope (just fixes get_fsid) but since that is the only problem we area currently observing I think its sufficient for requirements.

Revision history for this message
James Page (james-page) wrote :

The picked patch was reverted - this is the correct fix:

  https://github.com/ceph/ceph/commit/005f19eff0b4a92647e5847e306718be76704432

Revision history for this message
James Page (james-page) wrote :

This fix is included in the 13.2.6 release I'm currently working on so marking cosmic and disco tasks as invalid; this does not need a specific SRU

Changed in ceph (Ubuntu Disco):
status: In Progress → Invalid
Changed in ceph (Ubuntu Cosmic):
status: In Progress → Invalid
Revision history for this message
James Page (james-page) wrote :

bug 1831732 for 13.2.6

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ceph - 14.2.1-0ubuntu3

---------------
ceph (14.2.1-0ubuntu3) eoan; urgency=medium

  * d/p/pybind-auto-encode-decode-cstr.patch: Drop, reverted upstream.
  * d/p/fix-py3-encoding-fsid.patch: Cherry pick correct fix to resolve
    FSID encoding issues under Python 3 (LP: #1833079).

 -- James Page <email address hidden> Tue, 25 Jun 2019 08:02:09 +0100

Changed in ceph (Ubuntu Eoan):
status: In Progress → Fix Released
James Page (james-page)
Changed in cloud-archive:
status: Invalid → Fix Committed
Changed in cloud-archive:
status: Fix Released → Fix Committed
Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

Marking the cloud-archive tasks fix-released as the patch seems to be landed in the package branches for those releases.

Changed in cloud-archive:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.