Ganesha driver generate many invalid configuration files

Bug #1717135 reported by jiaopengju
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Undecided
jiaopengju

Bug Description

I'm using ganesha driver with manila. In my test environment, it generated many invalid configuration files like::
1.conf.djkfjkd
2.conf.djfkdjl
3.conf.kllsjdk
.....

These files are the temp file which were generated in creating ganesha export configuration files.

def _write_file(self, path, data):
        """Write data to path atomically."""
        dirpath, fname = (getattr(os.path, q + "name")(path) for q in
                          ("dir", "base"))
        tmpf = self.execute('mktemp', '-p', dirpath, "-t",
                            fname + ".XXXXXX")[0][:-1]
        self.execute(
            'sh', '-c',
            'echo %s > %s' % (pipes.quote(data), pipes.quote(tmpf)),
            message='writing ' + tmpf)
        self.execute('mv', tmpf, path)

In ganesha driver, we use two 'ssh' operations to generate a valid export configuration file. But some times the second 'ssh' operation may execute failed. In this case, ganesha driver will generate invalid files (the tmpf file). IMO, we should add try catch block on second ssh operation to avoid it happen.

jiaopengju (pj-jiao)
Changed in manila:
assignee: nobody → jiaopengju (pj-jiao)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

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

Revision history for this message
Ramana Raja (rraja) wrote :

jiaopengju, any idea how the ganesha driver end up generating invalid config files in the first place?

Also, what Ganesha FSAL/backend are you testing ?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/503886
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=728632866a4133e40d19360ba1e16c2672d8dcac
Submitter: Jenkins
Branch: master

commit 728632866a4133e40d19360ba1e16c2672d8dcac
Author: Pengju Jiao <email address hidden>
Date: Thu Sep 14 09:18:02 2017 +0800

    ganesha: cleanup of tmp config files

    Currently in ganesha driver, while writing ganesha
    config files some times the tmp config files are not
    cleaned up. It is because moving the config file from
    tmp location to the correct ganesha config location
    sometimes goes wrong.

    This patch adds operation of cleaning up the tmp config
    files.

    Change-Id: Id93a5062c48e99afc26594f05cbf29cffce1499e
    Closes-Bug: #1717135

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 6.0.0.0b1

This issue was fixed in the openstack/manila 6.0.0.0b1 development milestone.

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.