summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2014-05-22 14:18:39 +0000
committerKrishnan Parthasarathi <kparthas@redhat.com>2014-05-27 04:34:47 -0700
commitb512d6b4554515d034f1b3e7cd15a5971cad248e (patch)
tree3802083ac52650a2fbfbf26a71c594d42e794971
parent47a490c6933304aa2d58c8c2fb242fdde1e0a4c3 (diff)
glusterd/snapshot: Invoke restore cleanup for missed restores
While performing missed restores invoke restore cleanup, to cleanup the snap file (from which the vol was restored) and also the old volinfo and if the old volume is a restored volume, then its lvm too. Change-Id: Ifa5700c69f49fa0e22e0060a039c2e5c0b02b585 BUG: 1100324 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7848 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c10
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.h5
2 files changed, 15 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 8d23f4a29b0..618e8d1dbe0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -4695,6 +4695,16 @@ glusterd_perform_missed_op (glusterd_snap_t *snap, int32_t op)
volinfo->version++;
goto out;
}
+
+ ret = glusterd_snapshot_restore_cleanup (dict, volinfo,
+ snap);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Failed to perform snapshot restore "
+ "cleanup for %s volume",
+ snap_volinfo->parent_volname);
+ goto out;
+ }
}
break;
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.h b/xlators/mgmt/glusterd/src/glusterd-utils.h
index faec168f081..eed2682b5db 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.h
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.h
@@ -831,4 +831,9 @@ glusterd_launch_synctask (synctask_fn_t fn, void *opaque);
int
glusterd_enable_default_options (glusterd_volinfo_t *volinfo, char *option);
+int
+glusterd_snapshot_restore_cleanup (dict_t *rsp_dict,
+ glusterd_volinfo_t *volinfo,
+ glusterd_snap_t *snap);
+
#endif