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   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-22 15:46:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Raghavendra Bhat 2012-01-05 12:04:46 UTC
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",
		pid);

        kill (pid, SIGUSR1);

        sleep (1);
        unlink (dumpoptions_path);

        ret = 0;
out:
        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:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Raghavendra Bhat 2012-12-04 10:13:45 UTC
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 09:49:45 UTC
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)

Comment 3 Kaleb KEITHLEY 2015-10-22 15:46:38 UTC
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.