Bug 771925

Summary: [glusterfs-3.3.0qa19]: glusterd should not assume that within a second statedump will be taken
Product: [Community] GlusterFS Reporter: Raghavendra Bhat <rabhat>
Component: glusterdAssignee: Raghavendra Bhat <rabhat>
Status: CLOSED EOL QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: mainlineCC: gluster-bugs, rwheeler
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-22 11:46:38 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Raghavendra Bhat 2012-01-05 07:04:46 EST
Description of problem:

glusterd which takes care of issuing SIGUSR1 to the brick processes for taking the statedump will write the options mentioned by the user (given through cli) about what all information has to be dumped to the statedump file. 

This is the piece of code from glusterd_brick_statedump function of glusterd which does the above functionality.

snprintf (dumpoptions_path, sizeof (dumpoptions_path),
                  "/tmp/glusterdump.%d.options", pid);
	glusterd_set_dump_options (dumpoptions_path, options, option_cnt);

        gf_log ("", GF_LOG_INFO, "Performing statedump on brick with pid %d",

        kill (pid, SIGUSR1);

        sleep (1);
        unlink (dumpoptions_path);

        ret = 0;
        if (pidfile)
                fclose (pidfile);
        return ret;

It can be seen from the code that, glusterd issues the SIGUSR1 signal to the brick process for taking statedump. But after that it sleeps for 1 second and then removes the file which contains the options provided by user.

The glusterfs process which receives the SIGUSR1 signal will look into the /tmp/glusterdump.%s.options file and dumps the information that have been mentioned in that file.

Instead of glusterd assuming the statedump would have been taken in 1 second and unlinking it would be good if the glusterfs process itself deletes the file after dumping the the information.

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

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:
Comment 1 Raghavendra Bhat 2012-12-04 05:13:45 EST
http://review.gluster.org/2585 : it would need more of review cycles, but keeping in POST to indicate that some effort has been done on the issue.
Comment 2 Anand Avati 2013-07-30 05:49:45 EDT
REVIEW: http://review.gluster.org/2585 (statedump: glusterd should not unlink the options file for statedump) posted (#2) for review on master by Raghavendra Bhat (raghavendra@redhat.com)
Comment 3 Kaleb KEITHLEY 2015-10-22 11:46:38 EDT
because of the large number of bugs filed against mainline version\ is ambiguous and about to be removed as a choice.

If you believe this is still a bug, please change the status back to NEW and choose the appropriate, applicable version for it.