summaryrefslogtreecommitdiffstats
path: root/xlators/lib/src
diff options
context:
space:
mode:
authorKaushik BV <kaushikbv@gluster.com>2011-02-03 23:16:03 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-02-04 00:39:15 -0800
commitba40a3ece0a0b5b381e7d05c74d09cdd1818b817 (patch)
treeed5a160110083707413105c90055ae79494be716 /xlators/lib/src
parent7f59d855bb160a14a517e82b71e4f387b50cbf63 (diff)
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 <kaushikbv@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2341 ([glusterfs-3.1.2gsyncqa4]: crash in gsyncd) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2341
Diffstat (limited to 'xlators/lib/src')
-rw-r--r--xlators/lib/src/libxlator.c69
-rw-r--r--xlators/lib/src/libxlator.h4
2 files changed, 57 insertions, 16 deletions
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 <uuid>.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);
diff --git a/xlators/lib/src/libxlator.h b/xlators/lib/src/libxlator.h
index be8a0093695..0187e876bda 100644
--- a/xlators/lib/src/libxlator.h
+++ b/xlators/lib/src/libxlator.h
@@ -47,6 +47,10 @@ struct marker_str {
unsigned has_xtime:1;
int32_t enoent_count;
int32_t enotconn_count;
+ int32_t enodata_count;
+ int32_t noxtime_count;
+
+ int esomerr;
xlator_specf_unwind_t xl_specf_unwind;
void *xl_local;