summaryrefslogtreecommitdiffstats
path: root/rpc/glfs-operations.h
Commit message (Collapse)AuthorAgeFilesLines
* cache: implement LRU cache to hold glfs objectsPrasanna Kumar Kalever2017-06-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ------- 1. Currently, each cli command take ~5 secs for execution. The Maximum latency is due to initializing a glfs object (glfs_init() and friends). 2. OOM kills due to glfs_fini() leaks (~10MB per object) Solution: -------- Caching bipasses glfs_init() calls from the very next command, as in the first command it goes via the glfs_init route, since there will be cache miss. Hence with caching cli command on a local machine should take ~1 sec. ATM, the cache query looks at the volume name only, as the host name will be localhost in our case and transport will be tcp 24007 always. The default cache capacity is 5 i.e there can be a max of five glfs entries in the cache, anything more will lead to release of least recently used object. This way, if there are <= 5 volume in use for block, there will be no glfs_fini() calls, hence no leaks, no OOM's. The next patch will help in making cache capacity configurable. Change-Id: Ia891451cb92cf09959c1aff85976d78302ec7014 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> [ndevos: correct compiling+linking against libgfapi.so]
* glfs: fix 'status' buffer size in 'NodeInfo'Prasanna Kumar Kalever2017-05-221-2/+2
| | | | | | | | | | | | ==22873==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6120000224cf at pc 0x7f073b9829b7 bp 0x7f07367fc400 sp 0x7f07367fbba8 WRITE of size 17 at 0x6120000224cf thread T1 #0 0x7f073b9829b6 in strcpy (/lib64/libasan.so.3+0x919b6) #1 0x424416 in blockStuffMetaInfo /root/gluster-block/rpc/glfs-operations.c:305 #2 0x424bc6 in blockGetMetaInfo /root/gluster-block/rpc/glfs-operations.c:363 Change-Id: Id9da4279d358462dcf1c043b37aeb55dfc38ceb2 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* modify: add support for one way authenticationPrasanna Kumar Kalever2017-05-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduce or rather implement modify command for enabling authentication for block devices. The schematics of authentication setting, looks like $ gluster-block modify block-test/sample-block auth enable --json-pretty { "SUCCESSFUL ON":[ "192.168.0.105" ], "IQN":"iqn.2016-12.org.gluster-block:8917def2-e90d-4406-8c9c-6d06b6851bbe", "USERNAME":"8917def2-e90d-4406-8c9c-6d06b6851bbe", "PASSWORD":"a3e75362-a446-45af-98d0-a1ed7e10d7f0", "RESULT":"SUCCESS" } As an effect it brings changes in 'info' command response, note PASSWORD $ gluster-block info block-test/sample-block --json-pretty { "NAME":"sample-block", "VOLUME":"block-test", "GBID":"8917def2-e90d-4406-8c9c-6d06b6851bbe", "SIZE":1073741824, "HA":1, "PASSWORD":"a3e75362-a446-45af-98d0-a1ed7e10d7f0", "BLOCK CONFIG NODE(S)":[ "192.168.0.105" ] } The schematics of auth disabling, looks like $ gluster-block modify block-test/sample-block auth disable --json-pretty { "SUCCESSFUL ON":[ "192.168.0.105" ], "IQN":"iqn.2016-12.org.gluster-block:add99c38-3c14-42d7-bf23-7d02f388e1e7", "RESULT":"SUCCESS" } Change-Id: I06d095b50401c131ac89cc142497f21d2205164a Fixes: #5 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: support json responsePrasanna Kumar Kalever2017-04-281-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is how cli response looks like, on supplying '--json*' flag to cmd-args: $ gluster-block create block-test/sample-block1 ha 1 localhost.localdomain 1GiB --json (or) $ gluster-block create block-test/sample-block2 ha 1 localhost.localdomain 1GiB --json-spaced { "IQN": "iqn.2016-12.org.gluster-block:681af106-85f1-4a02-a122-57c80903458c", \ "PORTAL(S)": [ "localhost.localdomain:3260" ], "RESULT": "SUCCESS" } $ gluster-block create block-test/sample-block3 ha 1 localhost.localdomain 1GiB --json-plain {"IQN":"iqn.2016-12.org.gluster-block:0fdf6647-57f2-477f-8dd4-54a3de06e410",\ "PORTAL(S)":["localhost.localdomain:3260"],"RESULT":"SUCCESS"} $ gluster-block create block-test/sample-block4 ha 1 localhost.localdomain 1GiB --json-pretty { "IQN":"iqn.2016-12.org.gluster-block:e92ca4a0-5325-4c4b-a407-9e75790e4c7f", "PORTAL(S)":[ "localhost.localdomain:3260" ], "RESULT":"SUCCESS" } Change-Id: Ie51039e3dee0b3357d2347b4087e0fbe299aa29e Fixes: #3 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* cli: deprecate volserver optionPrasanna Kumar Kalever2017-02-171-1/+1
| | | | | | | volserver can be considered as "localhost", as we anyway tieing-up glusterd, gluster-blockd and cli processes. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* daemon: fix minor bugsPrasanna Kumar Kalever2017-02-161-1/+1
| | | | | Reported-by: Pranith Kumar K <pkarampu@redhat.com> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: create block files in '/block-store' dirPrasanna Kumar Kalever2017-02-081-0/+3
| | | | | | | | | | | | | | | | | till now we have '/block-meta' dir for meta files and actual block files used to reside in '/' dir. From now, lets place block files in '/block-store' So, this is how it looks like: $ tree /mnt/ /mnt/ ├── block-meta │   ├── meta.lock │   └── TARGET └── block-store └── 103e4cf1-bf41-404a-9fe1-b7c70fc33b3e Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gfapi: unify calls to glfs_init and friendsPrasanna Kumar Kalever2017-02-071-2/+2
| | | | | | | There were two glfs_init(and friends) invocations per op (create & delete). This patch just unifies those calls (since they anyway belong to same volume) Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: migrate build to libtoolz and create rpmPrasanna Kumar Kalever2017-02-071-0/+61
Till now we had simple makefile for checking dependencies and building. Using libtoolz will give more control on dependency checks and flexibility. This patch also introduce rpm build feature. Compiling: $ ./autogen.sh $ ./configure $ make -j $ make install Building RPMS: $ make rpms Running: $ systemctl start gluster-blockd.service Using CLI: $ gluster-block help Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>