From ba40a3ece0a0b5b381e7d05c74d09cdd1818b817 Mon Sep 17 00:00:00 2001 From: Kaushik BV Date: Thu, 3 Feb 2011 23:16:03 +0000 Subject: libxlator: New policy for aggregation of xtime: -Try to salvage errors like ENOENT/ENOTCONN/ENODATA, -Propogate back any other error from any brick -EINVAL if some assertion of the aggregation logic is broken Signed-off-by: Kaushik BV Signed-off-by: Anand V. Avati BUG: 2341 ([glusterfs-3.1.2gsyncqa4]: crash in gsyncd) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2341 --- xlators/lib/src/libxlator.c | 69 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 16 deletions(-) (limited to 'xlators/lib/src/libxlator.c') diff --git a/xlators/lib/src/libxlator.c b/xlators/lib/src/libxlator.c index f43fd381b85..e7bbe04baa1 100644 --- a/xlators/lib/src/libxlator.c +++ b/xlators/lib/src/libxlator.c @@ -64,8 +64,25 @@ cluster_markerxtime_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto out; } + if (local->esomerr) { + LOCK (&frame->lock); + { + callcnt = --local->call_count; + } + goto done; + } + vol_uuid = local->vol_uuid; + if (op_ret && op_errno == ENODATA) { + LOCK (&frame->lock); + { + callcnt = --local->call_count; + local->enodata_count++; + } + goto done; + } + if (op_ret && op_errno == ENOENT) { LOCK (&frame->lock); { @@ -84,6 +101,17 @@ cluster_markerxtime_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto done; } + if (op_ret) { + LOCK (&frame->lock); + { + callcnt = --local->call_count; + local->esomerr = op_errno; + } + goto done; + } + + + LOCK (&frame->lock); { @@ -91,14 +119,14 @@ cluster_markerxtime_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (!gf_asprintf (& marker_xattr, "%s.%s.%s", MARKER_XATTR_PREFIX, vol_uuid, XTIME)) { op_errno = ENOMEM; - goto out; + goto done; } if (dict_get_ptr (dict, marker_xattr, (void **)&net_timebuf)) { gf_log (this->name, GF_LOG_WARNING, "Unable to get .xtime attr"); - + local->noxtime_count++; goto done; } @@ -147,21 +175,30 @@ done: op_errno = ENOMEM; goto out; } + goto out; } - else { + + if (local->noxtime_count) + goto out; + + if (local->enodata_count) { op_ret = -1; - if (local->enotconn_count) { - op_errno = ENOTCONN; - goto out; - } - if (local->enoent_count) { - op_errno = ENOENT; - goto out; - } - else { - op_errno = EINVAL; - goto out; - } + op_errno = ENODATA; + goto out; + } + if (local->enotconn_count) { + op_ret = -1; + op_errno = ENOTCONN; + goto out; + } + if (local->enoent_count) { + op_ret = -1; + op_errno = ENOENT; + goto out; + } + else { + op_errno = local->esomerr; + goto out; } out: if (local->xl_specf_unwind) { @@ -241,7 +278,7 @@ cluster_markeruuid_cbk (call_frame_t *frame, void *cookie, xlator_t *this, (marker->volmark->minor != volmark->minor)) { op_ret = -1; op_errno = EINVAL; - goto out; + goto done; } else if (volmark->retval) { data_unref ((data_t *) marker->volmark); -- cgit