summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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[] = {