gluster_native: 'manila delete <share>' fails with gluster 3.7.x as backend

Bug #1473324 reported by karthick
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Medium
Ramana Raja

Bug Description

With gluster native driver, 'Manila delete share' on a gluster volume fails to delete the share and puts the share in 'error_deleting' state. This issue will be seen with gluster 3.7.

Following steps are done by the API In order to delete the share,

1) reset ssl options
2) temporarily mount gluster volume
3) Delete the contents
4) umount gluster volume
5) set ssl options back

Starting GlusterFS 3.7.x, trashcan feature is introduced to temporarily store deleted files. This directory cannot be deleted and api tries to delete and fails.

# ls -liah /tmp/tmpYuqpvv/
total 4.0K
  1 drwxr-xr-x. 4 root root 78 Jul 10 12:32 .
133 drwxrwxrwt. 36 root root 4.0K Jul 10 12:48 ..
  5 drwxr-xr-x. 3 root root 48 Jul 7 11:19 .trashcan

# find /tmp/tmpYuqpvv -mindepth 1 -delete
find: cannot delete ‘/tmp/tmpYuqpvv/.trashcan’: Directory not empty

code snippet:

        # Delete only the contents, not the directory.
        cmd = ['find', pipes.quote(tmpdir), '-mindepth', '1', '-delete']
        try:
            self._execute(*cmd, run_as_root=True)
        except exception.ProcessExecutionError as exc:
            msg = (_("Error trying to wipe gluster volume. "
                     "gluster_export: %(export)s, Error: %(error)s") %
                   {'export': gluster_export, 'error': exc.stderr})
            LOG.error(msg)
            raise exception.GlusterfsException(msg)
        finally:
            # Unmount.
            self._do_umount(tmpdir)
            shutil.rmtree(tmpdir, ignore_errors=True)

Revision history for this message
karthick (kramdoss) wrote :
summary: - gluster_native: 'manila delete' fails with gluster 3.7.x as backend
+ gluster_native: 'manila delete <share>' fails with gluster 3.7.x as
+ backend
Changed in manila:
milestone: none → liberty-2
importance: Undecided → Medium
status: New → Triaged
Csaba Henk (chenk)
tags: added: kilo-backport-potential
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/202905

Changed in manila:
assignee: nobody → Ramana Raja (rraja)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/202905
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=29456c22999ee63aec529c0808264ba7c84fcb70
Submitter: Jenkins
Branch: master

commit 29456c22999ee63aec529c0808264ba7c84fcb70
Author: Ramana Raja <email address hidden>
Date: Wed Jul 15 21:19:41 2015 +0530

    glusterfs_native: fix delete share

    With GlusterFS 3.7.x versions, the delete share operation fails when
    deleting the contents of a GlusterFS volume, a share. This is because
    two directories are auto-created within a GlusterFS volume when it's
    started and GlusterFS refuses to unlink their paths. Fix this issue, by
    not trying to remove the two directory paths, but remove their contents
    and the rest of the contents of the volume.

    Change-Id: I1675bbf593bf578301d6899ee3f9860320080956
    Closes-Bug: #1473324

Changed in manila:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/205224

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

Reviewed: https://review.openstack.org/205224
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=589cfc989d1ae2b58c36d90125dd578833679acd
Submitter: Jenkins
Branch: stable/kilo

commit 589cfc989d1ae2b58c36d90125dd578833679acd
Author: Ramana Raja <email address hidden>
Date: Wed Jul 15 21:19:41 2015 +0530

    glusterfs_native: fix delete share

    With GlusterFS 3.7.x versions, the delete share operation fails when
    deleting the contents of a GlusterFS volume, a share. This is because
    two directories are auto-created within a GlusterFS volume when it's
    started and GlusterFS refuses to unlink their paths. Fix this issue, by
    not trying to remove the two directory paths, but remove their contents
    and the rest of the contents of the volume.

    Change-Id: I1675bbf593bf578301d6899ee3f9860320080956
    Closes-Bug: #1473324
    (cherry picked from commit 29456c22999ee63aec529c0808264ba7c84fcb70)

tags: added: in-stable-kilo
Thierry Carrez (ttx)
Changed in manila:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in manila:
milestone: liberty-2 → 1.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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