summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kp@gluster.com>2011-05-31 00:43:47 +0000
committerAnand Avati <avati@gluster.com>2011-05-31 09:11:10 -0700
commit504b848916a7e12cf72b21e11a49dfc80f19a37d (patch)
treeac689317274d7ade0d681d54751386c7966d38e9
parentd91f3981b0d80161e985fd1038c3524ac82d8d8a (diff)
pump: Detect 'empty' brick and finish migration.
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> BUG: 2909 (replace brick of empty brick never says migration completed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2909 Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2909 (replace brick of empty brick never says migration completed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2909
-rw-r--r--xlators/cluster/afr/src/pump.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/pump.c b/xlators/cluster/afr/src/pump.c
index 5b1a4f62316..f42dab82ece 100644
--- a/xlators/cluster/afr/src/pump.c
+++ b/xlators/cluster/afr/src/pump.c
@@ -419,6 +419,7 @@ gf_pump_traverse_directory (loc_t *loc)
char *file_path = NULL;
int ret = 0;
+ gf_boolean_t is_directory_empty = _gf_true;
INIT_LIST_HEAD (&entries.list);
this = THIS;
@@ -468,6 +469,7 @@ gf_pump_traverse_directory (loc_t *loc)
if (!IS_ENTRY_CWD (entry->d_name) &&
!IS_ENTRY_PARENT (entry->d_name)) {
+ is_directory_empty = _gf_false;
ret = syncop_lookup (this, &entry_loc, NULL,
&iatt, &xattr_rsp, &parent);
@@ -526,6 +528,12 @@ gf_pump_traverse_directory (loc_t *loc)
}
+ if (is_directory_empty && IS_ROOT_PATH (loc->path)) {
+ pump_change_state (this, PUMP_STATE_RUNNING);
+ gf_log (this->name, GF_LOG_INFO, "Empty source brick. "
+ "Nothing to be done.");
+ }
+
out:
return 0;