summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kp@gluster.com>2011-05-31 00:52:01 +0000
committerAnand Avati <avati@gluster.com>2011-05-31 09:12:37 -0700
commite7a8ba1eaf5ee55bc0a63d97992e9adc1a87889e (patch)
treea1f04b94ca6f57b350646ae5d44a2f5ee34db7e1
parent82d794cac5f4875e52aa5337e2002466ec00256d (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 c63011c81e3..4bffbd9de4a 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;