diff options
author | Amar Tumballi <amar@gluster.com> | 2011-09-30 12:22:34 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-09-30 00:55:20 -0700 |
commit | 36ef90d6de0e97812bebb303a7fa5215ae4c6ebe (patch) | |
tree | 6940ab40835274d8b71fca0cd6603fa6beb9b43f /xlators/mgmt/glusterd/src | |
parent | ba20df9f1a218177e7c7dcc15a11143183d28243 (diff) |
rebalance process: propagate proper errors to user
* cluster/distribute: while rebalance, differentiate between valid
errors, validation check failures (may not be migrate failure),
and success.
* mgmt/glusterd: differentiate the errors based on errno. If a valid
error has happened, mark the rebalance status as failure, and
stop the rebalnace crawl.
Change-Id: I2d7bd7b73d2b79bfaf892ad4364bc89830a0d5bb
BUG: 3656
Reviewed-on: http://review.gluster.com/540
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-rebalance.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c index 208d0b3f3f3..82991596315 100644 --- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c +++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c @@ -119,9 +119,29 @@ gf_glusterd_rebalance_move_data (glusterd_volinfo_t *volinfo, const char *dir) ret = sys_lsetxattr (full_path, "distribute.migrate-data", force_string, strlen (force_string), 0); - if (ret < 0) + + /* if errno is not ENOSPC or ENOTCONN, we can still continue + with rebalance process */ + if ((ret == -1) && ((errno != ENOSPC) || + (errno != ENOTCONN))) continue; + if ((ret == -1) && (errno == ENOTCONN)) { + /* Most probably mount point went missing (mostly due + to a brick down), say rebalance failure to user, + let him restart it if everything is fine */ + volinfo->defrag_status = GF_DEFRAG_STATUS_FAILED; + break; + } + + if ((ret == -1) && (errno == ENOSPC)) { + /* rebalance process itself failed, may be + remote brick went down, or write failed due to + disk full etc etc.. */ + volinfo->defrag_status = GF_DEFRAG_STATUS_FAILED; + break; + } + LOCK (&defrag->lock); { defrag->total_files += 1; |