diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2017-07-06 13:26:42 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2017-07-10 05:07:11 +0000 |
commit | f2f3d74c835b68ad9ec63ec112870829a823a1fb (patch) | |
tree | 7cb9b9415e8b9b2ebdfff747ea345dbb8559dc03 /api | |
parent | 9e8ee31e643b7fbf7d46092c395ea27aaeb82f6b (diff) | |
download | glusterfs-f2f3d74c835b68ad9ec63ec112870829a823a1fb.tar.gz glusterfs-f2f3d74c835b68ad9ec63ec112870829a823a1fb.tar.xz glusterfs-f2f3d74c835b68ad9ec63ec112870829a823a1fb.zip |
mgtm/core : use sha hash function for volfile check
We are storing the entire volfile and using this to check
volfile change. With brick multiplexing there will be lot
of graphs per process which will increase the memory foot
print of the process. So instead of storing the entire
graph we could use sha256 and we can compare the hash to
see whether volfile change happened or not.
Also with Brick multiplexing, the direct comparison of vol
file is not correct. There are two problems.
Problem 1:
We are currently storing one single graph (the last
updated volfile) whereas, what we need is the entire
graph with all atttached bricks.
If we fix this issue, we have second problem
Problem 2:
With multiplexing we have a graph that contains multiple
bricks. But what we are checking as part of the reconfigure
is, comparing the entire graph with one single graph,
which will always fail.
Solution:
We create list in glusterfs_ctx_t that stores sha256 hash
of individual brick graphs. When a graph changes happens
we compare the stored hash and the current hash. If the
hash matches, then no need for reconfigure. Otherwise we
first do the reconfigure and then update the hash.
For now, gfapi has not changed this way. Meaning when gfapi
volfile fetch or reconfigure happens, we still store the
entire graph and compare, each memory.
This is fine, because libgfapi will not load brick graphs.
But changing the libgfapi will make the code similar in
both glusterfsd-mgmt and api. Also it helps to reduce some
memory.
Change-Id: I9df917a771a52b95622ab8f63af34ec390163a77
BUG: 1467986
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: https://review.gluster.org/17709
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'api')
-rw-r--r-- | api/src/glfs-mgmt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/src/glfs-mgmt.c b/api/src/glfs-mgmt.c index bb4e77a146..32b9dbd4e3 100644 --- a/api/src/glfs-mgmt.c +++ b/api/src/glfs-mgmt.c @@ -650,8 +650,8 @@ glfs_mgmt_getspec_cbk (struct rpc_req *req, struct iovec *iov, int count, * return -1(or -ve) =======> Some Internal Error occurred during the operation */ - ret = glusterfs_volfile_reconfigure (fs->oldvollen, tmpfp, fs->ctx, - fs->oldvolfile); + ret = gf_volfile_reconfigure (fs->oldvollen, tmpfp, fs->ctx, + fs->oldvolfile); if (ret == 0) { gf_msg_debug ("glusterfsd-mgmt", 0, "No need to re-load " "volfile, reconfigure done"); |