From 822cf315a5d0f0d2bc90e9f2d8faa6e5e5701ed4 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Tue, 17 Jun 2014 00:28:01 +0530 Subject: snapview-server: register a callback with glusterd to get notifications * As of now snapview-server is polling (sending rpc requests to glusterd) to get the latest list of snapshots at some regular time intervals (non configurable). Instead of that register a callback with glusterd so that glusterd sends notifications to snapd whenever a snapshot is created/deleted and snapview-server can configure itself. Change-Id: I17a274fd2ab487d030678f0077feb2b0f35e5896 BUG: 1119628 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.org/8150 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/snapview-client/src/snapview-client.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'xlators/features/snapview-client') diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c index ad022101715..c9077351007 100644 --- a/xlators/features/snapview-client/src/snapview-client.c +++ b/xlators/features/snapview-client/src/snapview-client.c @@ -148,12 +148,14 @@ svc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, So if lookup fails with ENOENT and the inode context is not there, then send the lookup to the 2nd child of svc. */ - ret = svc_inode_ctx_get (this, inode, &inode_type); if (op_ret) { - if (op_errno == ENOENT && (ret < 0) && - !uuid_is_null (local->loc.gfid) && - !__is_root_gfid (local->loc.gfid)) { - if (subvolume == FIRST_CHILD (this)) { + if (op_errno == ENOENT && + !uuid_is_null (local->loc.gfid)) { + ret = svc_inode_ctx_get (this, inode, &inode_type); + if (ret < 0 && subvolume == FIRST_CHILD (this)) { + gf_log (this->name, GF_LOG_DEBUG, + "Lookup on normal graph failed. " + "Sending lookup to snapview-server"); subvolume = SECOND_CHILD (this); STACK_WIND (frame, svc_lookup_cbk, subvolume, subvolume->fops->lookup, @@ -162,8 +164,10 @@ svc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } } - gf_log (this->name, GF_LOG_WARNING, - "Lookup on normal graph failed"); + gf_log (this->name, + (op_errno == ENOENT)?GF_LOG_DEBUG:GF_LOG_ERROR, + "Lookup on normal graph failed with error %s", + strerror (op_errno)); goto out; } -- cgit