From c5a19652c80162e670d29a7bd8c910d0acdfacb9 Mon Sep 17 00:00:00 2001 From: Atin Mukherjee Date: Wed, 1 Jul 2015 14:47:48 +0530 Subject: glusterd: initialize the daemon services on demand Backport of http://review.gluster.org/#/c/11488/ As of now all the daemon services are initialized at glusterD init path. Since socket file path of per node daemon demands the uuid of the node, MY_UUID macro is invoked as part of the initialization. The above flow breaks the usecases where a gluster image is built following a template could be Dockerfile, Vagrantfile or any kind of virtualization environment. This means bringing instances of this image would have same UUIDs for the node resulting in peer probe failure. Solution is to lazily initialize the services on demand. Change-Id: If7caa533026c83e98c7c7678bded67085d0bbc1e BUG: 1247012 Signed-off-by: Atin Mukherjee Reviewed-on: http://review.gluster.org/11488 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Gaurav Kumar Garg Reviewed-by: Kaushal M Reviewed-on: http://review.gluster.org/11766 --- tests/bugs/glusterd/bug-1223213-peerid-fix.t | 2 ++ .../bug-1238135-lazy-daemon-initialization-on-demand.t | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 tests/bugs/glusterd/bug-1238135-lazy-daemon-initialization-on-demand.t (limited to 'tests') diff --git a/tests/bugs/glusterd/bug-1223213-peerid-fix.t b/tests/bugs/glusterd/bug-1223213-peerid-fix.t index 0d9829f5a79..8e7589c9c3b 100755 --- a/tests/bugs/glusterd/bug-1223213-peerid-fix.t +++ b/tests/bugs/glusterd/bug-1223213-peerid-fix.t @@ -12,7 +12,9 @@ TEST launch_cluster 2; # is > 3.5. This is to ensure 3.5 code path is hit to test that volume status # works when a node is upgraded from 3.5 to 3.7 or higher as mgmt_v3 lock is # been introduced in 3.6 version and onwards + GD1_WD=$($CLI_1 system getwd) +$CLI_1 system uuid get TEST sed -rnie "'s/(operating-version=)\w+/\130500/gip'" ${GD1_WD}/glusterd.info TEST kill_glusterd 1 diff --git a/tests/bugs/glusterd/bug-1238135-lazy-daemon-initialization-on-demand.t b/tests/bugs/glusterd/bug-1238135-lazy-daemon-initialization-on-demand.t new file mode 100644 index 00000000000..54c3187cbdb --- /dev/null +++ b/tests/bugs/glusterd/bug-1238135-lazy-daemon-initialization-on-demand.t @@ -0,0 +1,16 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc + +cleanup; + +TEST glusterd; +TEST pidof glusterd; + +GDWD=$($CLI system getwd) + +# glusterd.info file will be created on either first peer probe or volume +# creation, hence we expect file to be not present in this case +TEST ! -e $GDWD/glusterd.info + +cleanup; -- cgit