|
|
e3c68b |
From e41b4a45f9f5c07ffa38582d0bb4517f6a66eaa3 Mon Sep 17 00:00:00 2001
|
|
|
e3c68b |
From: Soumya Koduri <skoduri@redhat.com>
|
|
|
e3c68b |
Date: Fri, 7 Jun 2019 19:33:07 +0530
|
|
|
e3c68b |
Subject: [PATCH 199/221] upcall: Avoid sending notifications for invalid
|
|
|
e3c68b |
inodes
|
|
|
e3c68b |
|
|
|
e3c68b |
For nameless LOOKUPs, server creates a new inode which shall
|
|
|
e3c68b |
remain invalid until the fop is successfully processed post
|
|
|
e3c68b |
which it is linked to the inode table.
|
|
|
e3c68b |
|
|
|
e3c68b |
But incase if there is an already linked inode for that entry,
|
|
|
e3c68b |
it discards that newly created inode which results in upcall
|
|
|
e3c68b |
notification. This may result in client being bombarded with
|
|
|
e3c68b |
unnecessary upcalls affecting performance if the data set is huge.
|
|
|
e3c68b |
|
|
|
e3c68b |
This issue can be avoided by looking up and storing the upcall
|
|
|
e3c68b |
context in the original linked inode (if exists), thus saving up on
|
|
|
e3c68b |
those extra callbacks.
|
|
|
e3c68b |
|
|
|
e3c68b |
This is backport of below upstream fix -
|
|
|
e3c68b |
mainline: https://review.gluster.org/22840
|
|
|
e3c68b |
release-6: https://review.gluster.org/22873
|
|
|
e3c68b |
|
|
|
e3c68b |
Change-Id: I044a1737819bb40d1a049d2f53c0566e746d2a17
|
|
|
e3c68b |
fixes: bz#1717784
|
|
|
e3c68b |
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
|
|
|
e3c68b |
Reviewed-on: https://code.engineering.redhat.com/gerrit/173507
|
|
|
e3c68b |
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
|
|
e3c68b |
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
|
|
|
e3c68b |
---
|
|
|
e3c68b |
xlators/features/upcall/src/upcall-internal.c | 19 ++++++++++++++++++-
|
|
|
e3c68b |
1 file changed, 18 insertions(+), 1 deletion(-)
|
|
|
e3c68b |
|
|
|
e3c68b |
diff --git a/xlators/features/upcall/src/upcall-internal.c b/xlators/features/upcall/src/upcall-internal.c
|
|
|
e3c68b |
index 46cf6f8..7998dd2 100644
|
|
|
e3c68b |
--- a/xlators/features/upcall/src/upcall-internal.c
|
|
|
e3c68b |
+++ b/xlators/features/upcall/src/upcall-internal.c
|
|
|
e3c68b |
@@ -520,6 +520,7 @@ upcall_cache_invalidate(call_frame_t *frame, xlator_t *this, client_t *client,
|
|
|
e3c68b |
upcall_client_t *tmp = NULL;
|
|
|
e3c68b |
upcall_inode_ctx_t *up_inode_ctx = NULL;
|
|
|
e3c68b |
gf_boolean_t found = _gf_false;
|
|
|
e3c68b |
+ inode_t *linked_inode = NULL;
|
|
|
e3c68b |
|
|
|
e3c68b |
if (!is_upcall_enabled(this))
|
|
|
e3c68b |
return;
|
|
|
e3c68b |
@@ -532,7 +533,20 @@ upcall_cache_invalidate(call_frame_t *frame, xlator_t *this, client_t *client,
|
|
|
e3c68b |
return;
|
|
|
e3c68b |
}
|
|
|
e3c68b |
|
|
|
e3c68b |
- if (inode)
|
|
|
e3c68b |
+ /* For nameless LOOKUPs, inode created shall always be
|
|
|
e3c68b |
+ * invalid. Hence check if there is any already linked inode.
|
|
|
e3c68b |
+ * If yes, update the inode_ctx of that valid inode
|
|
|
e3c68b |
+ */
|
|
|
e3c68b |
+ if (inode && (inode->ia_type == IA_INVAL) && stbuf) {
|
|
|
e3c68b |
+ linked_inode = inode_find(inode->table, stbuf->ia_gfid);
|
|
|
e3c68b |
+ if (linked_inode) {
|
|
|
e3c68b |
+ gf_log("upcall", GF_LOG_DEBUG,
|
|
|
e3c68b |
+ "upcall_inode_ctx_get of linked inode (%p)", inode);
|
|
|
e3c68b |
+ up_inode_ctx = upcall_inode_ctx_get(linked_inode, this);
|
|
|
e3c68b |
+ }
|
|
|
e3c68b |
+ }
|
|
|
e3c68b |
+
|
|
|
e3c68b |
+ if (inode && !up_inode_ctx)
|
|
|
e3c68b |
up_inode_ctx = upcall_inode_ctx_get(inode, this);
|
|
|
e3c68b |
|
|
|
e3c68b |
if (!up_inode_ctx) {
|
|
|
e3c68b |
@@ -600,6 +614,9 @@ upcall_cache_invalidate(call_frame_t *frame, xlator_t *this, client_t *client,
|
|
|
e3c68b |
}
|
|
|
e3c68b |
pthread_mutex_unlock(&up_inode_ctx->client_list_lock);
|
|
|
e3c68b |
out:
|
|
|
e3c68b |
+ /* release the ref from inode_find */
|
|
|
e3c68b |
+ if (linked_inode)
|
|
|
e3c68b |
+ inode_unref(linked_inode);
|
|
|
e3c68b |
return;
|
|
|
e3c68b |
}
|
|
|
e3c68b |
|
|
|
e3c68b |
--
|
|
|
e3c68b |
1.8.3.1
|
|
|
e3c68b |
|