summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2014-02-25 17:50:01 +0000
committerJeff Darcy <jdarcy@redhat.com>2014-02-26 21:23:37 +0000
commitf6bb7d47be931bb25c3b114313f29b222b9ae81a (patch)
tree267771e5bc46d92956ff0cf3a917583a77307810 /xlators/cluster
parentf1b8b17a7e4bfab2a741720c9b2df1bcd9de3ce4 (diff)
nsr-client: intercept and swallow GF_EVENT_CHILD_DOWN
Failure to do this was causing the event to be propagated up to DHT, which would then decide that the entire NSR subvolume was down. Then weird things would happen, such as (the example that tipped me off) directory listings showing stale data without the readdir* calls even getting down to NSR. Handling of CHILD_UP/CHILD_DOWN still needs to be improved, but this will do for now. Change-Id: Id85d5976231df9cb2c4af59b3aaa82cedb14f54f Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/nsr-client/src/nsrc.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/xlators/cluster/nsr-client/src/nsrc.c b/xlators/cluster/nsr-client/src/nsrc.c
index 6a80b1d86..eed824599 100644
--- a/xlators/cluster/nsr-client/src/nsrc.c
+++ b/xlators/cluster/nsr-client/src/nsrc.c
@@ -184,9 +184,37 @@ nsrc_fini (xlator_t *this)
GF_FREE(this->private);
}
+int32_t
+nsrc_notify (xlator_t *this, int32_t event, void *data, void *data2)
+{
+ int32_t ret = 0;
+
+ switch (event) {
+ case GF_EVENT_CHILD_DOWN:
+ /*
+ * TBD: handle this properly
+ *
+ * What we really should do is propagate this only if it caused
+ * us to lose quorum, and likewise for GF_EVENT_CHILD_UP only
+ * if it caused us to gain quorum. However, that requires
+ * tracking child states and for now it's easier to swallow
+ * these unconditionally. The consequence of failing to do
+ * this is that DHT sees the first GF_EVENT_CHILD_DOWN and gets
+ * confused, so it doesn't call us and doesn't get up-to-date
+ * directory listings etc.
+ */
+ break;
+ default:
+ ret = default_notify (this, event, data);
+ }
+
+ return ret;
+}
+
class_methods_t class_methods = {
.init = nsrc_init,
.fini = nsrc_fini,
+ .notify = nsrc_notify,
};
struct volume_options options[] = {