From d12a77cb3263f79f66f48a3b9205746b7d3b50f1 Mon Sep 17 00:00:00 2001 From: Sachin Pandit Date: Tue, 22 Apr 2014 08:09:18 +0530 Subject: glusterd/snapshot : Copy geo-rep status and config files before taking a snapshot. geo-rep status and conf files needs to be copied before taking a snapshot. The idea here is, when the snapshot is restored, these config and status files needs to be placed back in geo-replication folder so that geo-replication can start with the same state it was when taking a snapshot. Details : Before a snapshot is taken, Copy the status and config files present in /var/lib/glusterd/geo-replication/. The files copied are gsyncd.conf and status files of each session belonging to a volume whose snapshot is about to be taken. Change-Id: I0234ecd846883350c59777c2505290729de0ce05 BUG: 1061685 Signed-off-by: Sachin Pandit Reviewed-on: http://review.gluster.org/7495 Reviewed-by: Kotresh HR Reviewed-by: Vijaikumar Mallikarjuna Reviewed-by: Rajesh Joseph Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-store.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index 41668b1db75..3993504e8b0 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -2755,7 +2755,9 @@ glusterd_store_retrieve_volumes (xlator_t *this, glusterd_snap_t *snap) glusterd_for_each_entry (entry, dir); while (entry) { - if ( entry->d_type != DT_DIR ) + if ( entry->d_type != DT_DIR || + (strcmp (entry->d_name, "geo-replication") == 0 + && snap)) goto next; volinfo = glusterd_store_retrieve_volume (entry->d_name, snap); @@ -3299,7 +3301,6 @@ glusterd_store_retrieve_snaps (xlator_t *this) goto out; } } - glusterd_for_each_entry (entry, dir); } -- cgit