From fd8b19af1713f2800af743d851706b96ca15d9ec Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 14 Nov 2012 19:25:14 +0530 Subject: debug/trace: save the recent fops received in the event-history * Make use of event-history in debug/trace xlator to dump the recent fops, when statedump is given. trace xlator saves the fop it received along with the time in the event-history and upon statedump signal, dumps its history. The size of the event-history can be given as a xlator option. * Make changes in trace to take logging into log-file or logging to history as an option. By default both are off. Change-Id: I12baee5805c6efb55735cead4e2093fb94d7a6a0 BUG: 797171 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.org/4088 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- tests/bugs/bug-797171.t | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 tests/bugs/bug-797171.t (limited to 'tests') diff --git a/tests/bugs/bug-797171.t b/tests/bugs/bug-797171.t new file mode 100755 index 00000000000..d5603676bf8 --- /dev/null +++ b/tests/bugs/bug-797171.t @@ -0,0 +1,43 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc + +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume info; + +TEST $CLI volume create $V0 $H0:$B0/brick1; +TEST $CLI volume set $V0 debug.trace marker; +TEST $CLI volume set $V0 debug.log-history on + +TEST $CLI volume start $V0; + +sleep 1; +TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 \ +$M0; + +sleep 5; + +touch $M0/{1..22}; +rm -f $M0/*; + +pid_file=$(ls /var/lib/glusterd/vols/$V0/run); +brick_pid=$(cat /var/lib/glusterd/vols/$V0/run/$pid_file); + +mkdir /tmp/statedump_tmp/; +echo "path=/tmp/statedump_tmp" > /tmp/glusterdump.options; +echo "all=yes" >> /tmp/glusterdump.options; + +TEST $CLI volume statedump $V0 history; + +file_name=$(ls /tmp/statedump_tmp); +TEST grep "xlator.debug.trace.history" /tmp/statedump_tmp/$file_name; + +TEST umount $M0 + +rm -rf /tmp/statedump_tmp; +rm -f /tmp/glusterdump.options; + +cleanup; -- cgit