From 10f69943c412ea676814e794ae891ccf8adb8183 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Sun, 21 Aug 2011 15:54:14 +0530 Subject: glusterd: persistent state restore needs to be backward compatible. Change-Id: I6c774f638bd8ebd3f3c7c868be6416c9b37897d0 BUG: 3453 Reviewed-on: http://review.gluster.com/282 Reviewed-by: Vijay Bellur Tested-by: Gluster Build System --- xlators/mgmt/glusterd/src/glusterd-store.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 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 3b2a262e3b5..623865bac6f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -1853,11 +1853,12 @@ out: int32_t glusterd_store_retrieve_volumes (xlator_t *this) { - int32_t ret = 0; - char path[PATH_MAX] = {0,}; - glusterd_conf_t *priv = NULL; - DIR *dir = NULL; - struct dirent *entry = NULL; + int32_t ret = 0; + char path[PATH_MAX] = {0,}; + glusterd_conf_t *priv = NULL; + DIR *dir = NULL; + struct dirent *entry = NULL; + glusterd_volinfo_t *volinfo = NULL; GF_ASSERT (this); priv = this->private; @@ -1887,9 +1888,12 @@ glusterd_store_retrieve_volumes (xlator_t *this) ret = glusterd_store_retrieve_rbstate (entry->d_name); if (ret) { - gf_log ("", GF_LOG_ERROR, "Unable to restore " - "rbstate for volume: %s", entry->d_name); - goto out; + /* Backward compatibility */ + gf_log ("", GF_LOG_INFO, "Creating a new rbstate " + "for volume: %s.", entry->d_name); + ret = glusterd_volinfo_find (entry->d_name, &volinfo); + ret = glusterd_store_create_rbstate_shandle_on_absence (volinfo); + ret = glusterd_store_perform_rbstate_store (volinfo); } glusterd_for_each_entry (entry, dir); } -- cgit