Bug 1445569 - Provide a correct way to save the statedump generated by gfapi application
Summary: Provide a correct way to save the statedump generated by gfapi application
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: packaging
Version: mainline
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Kaleb KEITHLEY
QA Contact:
URL: http://lists.gluster.org/pipermail/gl...
Whiteboard:
Depends On:
Blocks: 1445570
TreeView+ depends on / blocked
 
Reported: 2017-04-26 01:32 UTC by SATHEESARAN
Modified: 2017-05-30 18:51 UTC (History)
4 users (show)

Fixed In Version: glusterfs-3.11.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-05-30 18:51:22 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description SATHEESARAN 2017-04-26 01:32:21 UTC
Description of problem:
-----------------------
QEMU uses native glusterfs driver ( which uses libgfapi ) to provides VM ability to  access to the disks that resides on gluster volume 

When generating statedump of gfapi application (QEMU), QEMU doesn't have permission to write to statedump path ( /var/run/gluster ) and doesn't generates statedump. Only the applications that runs with 'root' privilege could write to the directory  - /var/run/gluster

There should be a proper way for applications that doesn't have root privilege to write to /var/run/gluster

Version-Release number of selected component (if applicable):
-------------------------------------------------------------
mainline
3.10
3.8

How reproducible:
------------------
Always

Steps to Reproduce:
--------------------
1. Create a VM that runs with disk accessed using QEMU's native driver for glusterfs (gfapi)

2. Trigger statedump from gluster node
# gluster volume statedump <vol> client <hypervisor-IP/FQDN>:<QEMU-PID>

Actual results:
---------------
No statedump dumped by QEMU process under /var/run/gluster
QEMU user doesn't have privilege to write to /var/run/gluster

Expected results:
-----------------
statedump available under /var/run/gluster

Comment 1 SATHEESARAN 2017-04-26 01:34:53 UTC
Thanks Neils for figuring out the actual problem that QEMU doesn't have permission to write to /var/run/gluster directory.

Possible solutions as suggested by Neils

1. One approach would be to create a "gluster" group and give the group
permissions to write to /var/run/gluster/... 

2. Other 'fixes' include setting ACLs on the directory so that specified users can write there.because many daemons have a "home directory" that does not exist, it
probably is not a good idea to use $HOME to store statedumps.

Comment 2 Worker Ant 2017-04-26 12:17:48 UTC
REVIEW: https://review.gluster.org/17122 (packaging: /var/run/gluster owner gluster:gluster(0775) for statedumps) posted (#1) for review on master by Kaleb KEITHLEY (kkeithle)

Comment 3 Worker Ant 2017-04-26 12:39:31 UTC
REVIEW: https://review.gluster.org/17122 (packaging: /var/run/gluster owner gluster:gluster(0775) for statedumps) posted (#2) for review on master by Kaleb KEITHLEY (kkeithle)

Comment 4 Worker Ant 2017-04-26 12:51:48 UTC
REVIEW: https://review.gluster.org/17122 (packaging: /var/run/gluster owner gluster:gluster(0775) for statedumps) posted (#3) for review on master by Kaleb KEITHLEY (kkeithle)

Comment 5 Niels de Vos 2017-04-26 13:38:43 UTC
Requested ideas on the oVirt devel list too:
  http://lists.ovirt.org/pipermail/devel/2017-April/030262.html

Comment 6 Worker Ant 2017-04-26 13:50:58 UTC
REVIEW: https://review.gluster.org/17122 (packaging: /var/run/gluster owner gluster:gluster(0775) for statedumps) posted (#4) for review on master by Kaleb KEITHLEY (kkeithle)

Comment 7 Worker Ant 2017-04-26 14:06:36 UTC
REVIEW: https://review.gluster.org/17122 (packaging: /var/run/gluster owner gluster:gluster(0775) for statedumps) posted (#5) for review on master by Kaleb KEITHLEY (kkeithle)

Comment 8 Worker Ant 2017-04-26 14:47:42 UTC
REVIEW: https://review.gluster.org/17122 (packaging: /var/run/gluster owner gluster:gluster(0775) for statedumps) posted (#6) for review on master by Kaleb KEITHLEY (kkeithle)

Comment 9 Worker Ant 2017-04-27 15:57:18 UTC
COMMIT: https://review.gluster.org/17122 committed in master by Kaleb KEITHLEY (kkeithle) 
------
commit 0e50c4b3ea734456c14e2d7a578463999bd332c3
Author: Kaleb S. KEITHLEY <kkeithle>
Date:   Wed Apr 26 08:11:56 2017 -0400

    packaging: /var/run/gluster owner gluster:gluster(0775) for statedumps
    
    gfapi has the ability to take statedumps. However, if the application
    using gfapi isn't running with root privs the statedump file can't be
    written to the default location, i.e. /var/run/gluster.
    
    Change-Id: I97d8919ef8b8cd4775e1a206f939a2bf0046786d
    BUG: 1445569
    Signed-off-by: Kaleb S. KEITHLEY <kkeithle>
    Reviewed-on: https://review.gluster.org/17122
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Niels de Vos <ndevos>

Comment 10 Shyamsundar 2017-05-30 18:51:22 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.11.0, please open a new bug report.

glusterfs-3.11.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://lists.gluster.org/pipermail/announce/2017-May/000073.html
[2] https://www.gluster.org/pipermail/gluster-users/


Note You need to log in before you can comment on or make changes to this bug.