summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kp@gluster.com>2011-05-27 00:29:10 +0000
committerAnand Avati <avati@gluster.com>2011-05-30 01:49:34 -0700
commite1f79413774939bd23563b1d85b0c64a989301bc (patch)
treed0ee034fbab0d2971ae25893be310adf4072335a /xlators
parentfdf3bd3e548c380820219b135e16e9731e31c7c6 (diff)
pump: Detect 'empty' brick and finish migration.
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> 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
Diffstat (limited to 'xlators')
-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;