diff options
author | Rajesh Joseph <rjoseph@redhat.com> | 2014-06-13 10:49:47 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2014-06-13 02:36:28 -0700 |
commit | 60e8fdfeebb6005d3e3c310c720c2ff5e709f706 (patch) | |
tree | 6c9d01f746fe1b8fb048e1d9b1217ba7214e82e2 /xlators/mgmt/glusterd/src | |
parent | 10cd2bc38e1f0a1297d59c0791a85ed9d01c93ff (diff) |
glusterd/snapshot: Fix for snapshot restore failure
Problem: If restore fails due to quorum failure then the subsequent restore fails.
Cause: Volume store is backed up during prevalidate failure and it is
reverted or cleaned based on failure or success of the commit phase.
In case of quorum failure we were not reverting the backup.
Fix: Take backup when all the validation is done including quorum check.
Change-Id: I55d57f6ee85fac04a0e6cbd0291a402601c725d6
BUG: 1109024
Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-on: http://review.gluster.org/8056
Reviewed-by: Sachin Pandit <spandit@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-snapshot.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index af4cf171aff..330e50c277d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -768,6 +768,15 @@ glusterd_snapshot_restore (dict_t *dict, char **op_errstr, dict_t *rsp_dict) goto out; } + /* Take backup of the volinfo folder */ + ret = glusterd_snapshot_backup_vol (parent_volinfo); + if (ret) { + gf_log (this->name, GF_LOG_ERROR, "Failed to backup " + "volume backend files for %s volume", + parent_volinfo->volname); + goto out; + } + if (is_origin_glusterd (dict) == _gf_true) { /* From origin glusterd check if * * any peers with snap bricks is down */ @@ -918,15 +927,6 @@ glusterd_snapshot_restore_prevalidate (dict_t *dict, char **op_errstr, ret = -1; goto out; } - - /* Take backup of the volinfo folder */ - ret = glusterd_snapshot_backup_vol (volinfo); - if (ret) { - gf_log (this->name, GF_LOG_ERROR, "Failed to backup " - "volume backend files for %s volume", - volinfo->volname); - goto out; - } } /* Get brickinfo for snap_volumes */ |