adding a disk with "juju set" will chown every single file on every single osd

Bug #1795383 reported by Junien F
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceph OSD Charm
Fix Released
High
Przemyslaw Hausman

Bug Description

Hi,

I you have a running ceph cluster, and you add disks via "juju set ceph-osd osd-devices", then for each added disk, the charm will chown -R /var/lib/ceph (https://github.com/openstack/charm-ceph-osd/blob/master/lib/ceph/utils.py#L1894)

However, /var/lib/ceph/osd has links to all osds, so the charm will chown every file on every osd. For every disk you're adding. So if you're adding 5 disks, the charm will chown -R 5 times, which takes quite some time and is not useful.

I'm not sure why we're chowning in the first place, but I feel like we should only chown what needs chowning. Filesystems which are already in ceph shouldn't need to be touched.

Thanks !

James Page (james-page)
Changed in charm-ceph-osd:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Chris MacNaughton (chris.macnaughton) wrote :

osdize_dir is only called with filesystem path OSDs; looking briefly at the code path at https://github.com/openstack/charm-ceph-osd/blob/master/lib/ceph/utils.py#L1420 , it looks like the charm _never_ calls chownr on a disk based OSD

Revision history for this message
Junien F (axino) wrote :

I guess I should have said I added *directories*, not disks, ie :

juju set ceph-osd-cache osd-devices="/srv/ceph/ceph0 /srv/ceph/ceph1 /srv/ceph/ceph2 /srv/ceph/ceph3 /srv/ceph/ceph4 /srv/ceph/ceph5 /srv/ceph/ceph6 /srv/ceph/ceph7 /srv/ceph/ceph8 /srv/ceph/ceph9"

Changed in charm-ceph-osd:
assignee: nobody → Przemyslaw Hausman (phausman)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-ceph-osd (master)

Fix proposed to branch: master
Review: https://review.openstack.org/623258

Changed in charm-ceph-osd:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-ceph-osd (master)

Reviewed: https://review.openstack.org/623258
Committed: https://git.openstack.org/cgit/openstack/charm-ceph-osd/commit/?id=87e43ce27a909ffc9d6516cd2f51a479a9b8a7e0
Submitter: Zuul
Branch: master

commit 87e43ce27a909ffc9d6516cd2f51a479a9b8a7e0
Author: Przemysław Hausman <email address hidden>
Date: Thu Dec 6 17:48:09 2018 +0100

    Remove chown'ing on adding dirs to osd-devices

    When adding directories to osd-devices (e.g. juju config ceph-osd
    osd-devices="/srv/ceph1 /srv/ceph2"), the charm was recursively changing
    owner and group for all files below /var/lib/ceph, for each added
    directory. This was taking time and was not useful.

    The fix is to remove unnecessary recursive chown on /var/lib/ceph, since
    ceph already manages the ownership of the files itself.

    Change-Id: I39a00591bc86ec49c4ced53eadce75ddb21e2431
    Closes-Bug: #1795383

Changed in charm-ceph-osd:
status: In Progress → Fix Committed
James Page (james-page)
Changed in charm-ceph-osd:
milestone: none → 19.04
David Ames (thedac)
Changed in charm-ceph-osd:
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.