summaryrefslogtreecommitdiffstats
path: root/rpc
Commit message (Collapse)AuthorAgeFilesLines
* logger: improve logging at server sidePrasanna Kumar Kalever2017-06-051-1/+52
| | | | | Change-Id: I7a2f8804b7d33c58101bbfb58dcff15370239311 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* cache: implement LRU cache to hold glfs objectsPrasanna Kumar Kalever2017-06-053-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* Only when RPC is sent move status to CONFIGFAILPranith Kumar K2017-06-051-7/+19
| | | | | | | | | | | | | | | | | | Problem: When the config node is given as an address that has no route, connection to the node fails with EHOSTUNREACH(No route to Host). Since the code doesn't treat it as special errno, the config ends up updating its status as CONFIGFAIL and as part of cleanup it attempts to delete it, but fails again because the host is not reachable. So the block file lingers on in that state forever. Fix: Irrespective of errno, unless we don't send an rpc we know that we don't need to move the status to CONFIGFAIL, so get that info and act accordingly irrespective of the errno. Change-Id: Ie3fb9413f089a4875b5612c60ed3d65bc5b5bba1 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
* info: show node as configured if status is GB_CLEANUP_INPROGRESSPrasanna Kumar Kalever2017-06-021-0/+1
| | | | | | | | | | status GB_CLEANUP_INPROGRESS means someone attemped a delete, but node was not in contact/reach. So the configuration on that node is untouched. Hence such nodes need to be shown in configured list or so called 'BLOCK CONFIG NODE(S):' as part of info command. Change-Id: I56f26fdb3fe6e0ac57fae08c58256d8ccb4dc10d Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* 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>
* gluster-block: update journal data synchronouslyPrasanna Kumar Kalever2017-05-191-1/+1
| | | | | | | Also use O_SYNC while creating/truncating block file. Change-Id: Ic0bcc3f2905c438ca5b5d3e95955bbd5d95d3ef4 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* cli: increase the clnt_call() total time out.Prasanna Kumar Kalever2017-05-052-22/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The connect() in daemon takes too long to return for invalid IP addresses, the delay is much higher that the CLI RPC Timeout, hence the CLI returns before the daemon returns. Hence SIGPIPE is issued. The issue can be fixed by increasing the CLI RPC clnt_call() TIMEOUT. This should actually be handled like: struct timeval tv; CLIENT *cl; cl=clnt_create("somehost", SOMEPROG, SOMEVERS, "tcp"); if (cl=NULL) { exit(1); } tv.tv_sec=60; /* change timeout to 1 minute */ tv.tv_usec=0; clnt_control(cl, CLSET_TIMEOUT, &tv); But currently there is a bug in sun RPC which ignores TIMEOUT set using cln_control. See [1] Hence using regex to override default TIMEOUT generated in rpc code. [1] https://lists.gnu.org/archive/html/bug-glibc/2000-10/msg00095.html Change-Id: I75eceea6b9f362f8bf8c2fcb687155635efc65d7 Fixes: #15 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* login: one command for logging-in to all gateways of a targetPrasanna Kumar Kalever2017-05-043-163/+365
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently from the initiator side we need to login to mpath no. of nodes individually for establishing connect with all multipathed block devices from the client side, thus we need to execute mpath no. of login commands (i.e. login to each server) This can be minimized to single login command per target by configuring all gateways for a particular target in all gateways. Currently, $ gluster-block create VOL/BLOCK ha 3 HOSTx,HOSTy,HOSTz 10GiB Creates only one TPG i.e tpg1 (Read as Target Portal Group with Tag 1) on each node/server, with one portal listening on respective IP. All the gateways/nodes emulate same backend as target LUN with same WWN (for multipath representation) So at client side. we need to execute 3 commands to login all gateways $ iscsiadm -m discovery -t st -p HOSTy -l $ iscsiadm -m discovery -t st -p HOSTz -l $ iscsiadm -m discovery -t st -p HOSTx -l In the above case, user may login in any fashion, which is out of our control. Since we have failover multipath configuration, at a given time only one gateway can TX RX the data. so predicting active path/connection is not possible. With this patch, $ gluster-block create VOL/BLOCK ha 3 HOSTx,HOSTy,HOSTz 10GiB Creates 3 TPG's, tpg1(portal HOSTx), tpg2(portal HOSTy) and tpg3(portal HOSTz) on all the three gateways/nodes (IN same order). Basically, each gateway is define to every other gateway - but the other (other than local) gateway entries are in a disabled state. When the client starts the login sequence it issues the RPTG to the one nodes, but now that node can respond with portal IP's for all of the gateways. e.g. GW1 GW2 GW3 - tpg1/enabled - tpg1/disabled - tpg1/disabled - tpg2/disabled - tpg2/enabled - tpg2/disabled - tpg3/disabled - tpg3/disabled - tpg3/enabled Advantage, * Only one login command is needed, unlike 3 login's before, $ iscsiadm -m discovery -t st -p ANYONEHOST -l * Always tpg1 will be tried for making an active path/connection, hence we can predict that the first host in the list {HOSTx,HOSTy,HOSTz} will be tried for active connection. Hence we can be able to better manage load on each nodes, by selectively supplying Hosts in the list. Change-Id: I70f73b1d46812cb1bd8dc80f771ec20b0f0415bf Fixes: #9 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* create: support 'auth enable' optionPrasanna Kumar Kalever2017-05-022-12/+58
| | | | | | | | | | | | | | | | | | | | | | This patch add support to enable auth while create. The schematics of authentication setting for/while create, looks like $ gluster-block create block-test/sample-block ha 1 auth enable \ 192.168.0.105 1GiB --json-pretty { "IQN":"iqn.2016-12.org.gluster-block:dc6cca79-f9b7-44f5-acaf-ac81c9cc7c2e", "USERNAME":"dc6cca79-f9b7-44f5-acaf-ac81c9cc7c2e", "PASSWORD":"ae48635a-6902-454c-949a-f2ad0e056086", "PORTAL(S)":[ "192.168.0.105:3260" ], "RESULT":"SUCCESS" } Change-Id: Ib8f5ddd904cb879e0ee05f6a7c3c381c6615a0e4 Fixes: #5 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* modify: add support for one way authenticationPrasanna Kumar Kalever2017-05-024-119/+707
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* block: show reason for cmd failue on non-existent/not started volumePranith Kumar K2017-04-281-0/+11
| | | | | | | | | show the right reason for block operations failure on any non-existent/not started volume. Change-Id: I6340c80aa1a6125038c3e2a2399833562bd5fe8c Fixes: #10 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: support json responsePrasanna Kumar Kalever2017-04-285-279/+590
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* logging: redirect configshell logs to GB_LOGDIRPrasanna Kumar Kalever2017-04-131-1/+3
| | | | | | | | | | | | | | | | | | | | currently, GLOBAL CONFIG GROUP =================== [...] logfile=hello ------------- Logfile to use. [...] i.e. configshell logs are collected at 'hello' file. This patch will redirect configshell logs to 'GB_LOGDIR/gluster-block-configshell.log' Change-Id: I487c6197578c24412fbec72cb8c354725614de59 Fixes: #13 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* build: use rpcgen to generate all XDR codeNiels de Vos2017-03-1710-506/+97
| | | | | | | | | | | | | | | | | | | | | Remove all generated files and have them generated when needed. This build a libgbrpcxdr.la archive with the .o files that gets linked into the libgbrpc.la archive. 'rpcgen' generates .c code that triggers warnings for various compilers. This is not something that can easily be fixed, so add rpc-pragmas.h (like GlusterFS does) to prevent these warnings. There are some functions used by gluster-blockd.c that are not part of the header and were manually added to block.h. Because block.h get regenerated now, these functions have been added to a new file block_svc.h. Note that generated and compiled files land in $(top_builddir). This directory does not need to be the same as $(top_srcdir). Change-Id: I0e764d159d6d785699537eed4e24b16883218038 Fixes: #2 Signed-off-by: Niels de Vos <ndevos@redhat.com>
* gluster-block: create portal only with ip addressPrasanna Kumar Kalever2017-03-134-10/+10
| | | | | | | | | portal create with FQDN or hostname seems to be not working i.e. iscsiadm fails to discover the nodes or the otherway targetcli is unable to export the LUN right. Change-Id: Ibe0e2aa1b365d6c74a7974b2faf502d2c2ac38ad Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-blockd: parse create and delete outputsPrasanna Kumar Kalever2017-02-271-60/+415
| | | | | | | | | | | | | | | | The new parsed output of create and delete command will look like: $ gluster-block create sample/sample-block ha 2 ${HOST1} ${HOST2} 1GiB IQN: iqn.2016-12.org.gluster-block:aafea465-9167-4880-b37c-2c36db8562ea PORTAL(S): ${HOST1}:3260 ${HOST2}:3260 RESULT: SUCCESS $ gluster-block delete sample/sample-block SUCCESSFUL ON: ${HOST1} ${HOST2} RESULT: SUCCESS Change-Id: Id98e643c62a898a1f7298b6cfeb6ddfa10397b7f Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* build: refactorNiels de Vos2017-02-251-2/+2
| | | | | | | | | | | - tcmu-runner and targetcli are not build dependencies - use pkg-config to get libgfapi build parameters - cleanup .spec file Change-Id: Ib1451f7a375438cd2e78ae4137d1d02e01516fbd Signed-off-by: Niels de Vos <ndevos@redhat.com>
* gluster-blockd: defend on connect() issuesPrasanna Kumar Kalever2017-02-201-5/+24
| | | | | | | | | | | | | | | currently remote connect(b/w gluster-blockd's) failed cases such as, ECONNREFUSED No-one listening on the remote address. ENETUNREACH Network is unreachable. ETIMEDOUT Timeout while attempting connection ... are considered as CONFIGFAIL, this patch defend on these errno's. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-blockd: treat delete success if block doesn't existPrasanna Kumar Kalever2017-02-201-0/+15
| | | | | | | | | | | | | problem: say because of some reasons create failed to config on node, so it will log CONFIGFAIL in the metafile. At the time of delete since config failed it is obvious that block will not exist. since delete cannot find it now it fails to delete hence returning -1. solution: treat delete success if there is no block with given name on that node. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-blockd: fix violation of double pointer usagePrasanna Kumar Kalever2017-02-201-50/+21
| | | | Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-blockd: fix bug in glusterBlockCleanUpPrasanna Kumar Kalever2017-02-201-3/+3
| | | | | | | fix filename in GB_METAUPDATE_OR_GOTO() i.e change gbid to blockname Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: improve log messagesPrasanna Kumar Kalever2017-02-202-83/+123
| | | | | | | improve strings add missing log messages wherever helpful Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: refactor return valuesPrasanna Kumar Kalever2017-02-192-72/+173
| | | | Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* create: cleanup config in all the nodes if mpath is not satisfiedPrasanna Kumar Kalever2017-02-171-82/+88
| | | | | | partial success is treated as failure. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* cli: deprecate volserver optionPrasanna Kumar Kalever2017-02-176-22/+11
| | | | | | | 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>
* meta: thread safe GB_METAUPDATE_OR_GOTOPrasanna Kumar Kalever2017-02-161-63/+37
| | | | | | | | | | | | GB_METAUPDATE_OR_GOTO used an already opened glfs fd to update the meta data, since we have mpath number of threads writing to the same metadata file simultaneously, this will lead to thread concurrency and data consistency issues. Hence this patch protects GB_METAUPDATE_OR_GOTO with a lock and removes fd sharing by moving glfs_creat/open and glfs_close within the MACRO. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* daemon: fix minor bugsPrasanna Kumar Kalever2017-02-163-90/+108
| | | | | Reported-by: Pranith Kumar K <pkarampu@redhat.com> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* cli: cart off unwanted output from create commandPrasanna Kumar Kalever2017-02-151-3/+3
| | | | | | | | | | | | | | The response of below sub-operations as part of create are undesired $ targetcli set global auto_add_default_portal=false $ targetcli / saveconfig $ targetcli set attributes generate_node_acls=1 demo_mode_write_protect=0 Hence redirecting them to '/dev/null' This patch also fix a bug in the previous patch i.e. missed inverting [!] function return in if() Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-blockd: create logging directoriesPrasanna Kumar Kalever2017-02-151-2/+4
| | | | Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: add portal creationPrasanna Kumar Kalever2017-02-151-3/+20
| | | | | | | The portal that target listens on by default will be 0.0.0.0; With this patch we will be changing that to hostname of local machine. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* daemon: redirect logs to logdirPrasanna Kumar Kalever2017-02-141-1/+1
| | | | | | replace fprintf calls with LOG() Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* cli: review fixes in gluster-blockPrasanna Kumar Kalever2017-02-111-2/+0
| | | | | | Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* glfs: fix memory leak in blockStuffMetaInfoPrasanna Kumar Kalever2017-02-111-15/+28
| | | | | | Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: threadify remote requestsPrasanna Kumar Kalever2017-02-092-66/+219
| | | | | | | | | | | | | | | Before: ------ rpc clnt_call() is synchronous, for a multipath request each remote call has to wait until the previous remote call returns i,e each remote op happens in serial. After: ----- As we now threadify the remote calls, all the remote call's happens in parallel shrinking the overall latency for create and delete requests. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: create block files in '/block-store' dirPrasanna Kumar Kalever2017-02-083-16/+71
| | | | | | | | | | | | | | | | | 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>
* build: fix minor warningsPrasanna Kumar Kalever2017-02-082-52/+114
| | | | | | | mostly uninitialized use of variables. check return values from function calls. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* build: add uuid and pthread libraries to dependency listPrasanna Kumar Kalever2017-02-071-1/+1
| | | | Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gfapi: unify calls to glfs_init and friendsPrasanna Kumar Kalever2017-02-073-28/+11
| | | | | | | 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-077-112/+1201
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* gluster-block: refresh loggingPrasanna Kumar Kalever2017-02-051-9/+10
| | | | | | | | add more meaningful log messages minor code changes such as renaming, indentation and et cetera. Signed-off-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: do not need --block-host option for list | info |deletePrasanna Kumar Kalever2017-01-303-12/+0
| | | | | | From now we read the block-hosts from journal i.e targets meta file. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-blockd: consider spare nodes to satisfy the multipath requestPrasanna Kumar Kalever2017-01-303-0/+4
| | | | | | | | | | | In case if number of block hosts are more than the multipath request, consider that spare nodes to satify the request. Lets say we need multipath of 3, but the admin provides 5 block-hosts. If any of the node fail to configure target from first three, then consider configuring fourth node to satify the HA request. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: clean block_exec procedurePrasanna Kumar Kalever2017-01-304-29/+0
| | | | | | | | This was a hack to implement list and info commands, now that both list and info reads the metadata from the volume, we don't need block_exec anymore. Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-blockd: implement transaction frameworkPrasanna Kumar Kalever2017-01-303-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduce the transaction locking also, start maintaining meta data journaling per block Every request is follows transaction, at the start of any transaction we take blocking lock on "/block-meta/meta.lock" file and at the end we unlock. Meanwhile while, when the transaction is in progress we do journaling, while performing series of operations, used for future purposes and roll backing. A sample journal file looks like: $ cat /mnt/block-meta/LUN1 GBID: xyz-abc SIZE : 5GiB HA: 3 ENTRYCREATE: INPROGRESS ENTRYCREATE: SUCCESS NODE1: INPROGRESS NODE2: INPROGRESS NODE3: INPROGRESS NODE2: SUCCESS NODE3: FAIL NODE1: SUCCESS NODE4: INPROGRESS NODE4: SUCCESS NODE3: CLEANUPSUCCESS <EOF> Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: add list and info rpcPrasanna Kumar Kalever2017-01-303-0/+8
| | | | Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: add delete rpcPrasanna Kumar Kalever2017-01-305-1/+243
| | | | Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-block: listen on unix and inetPrasanna Kumar Kalever2017-01-305-51/+275
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from now We basically have 2 RPC connections, 1. Between gluster block CLI and local gluster-blockd This connection is basically UNIX/local netid ,listening on /var/run/gluster-blockd.socket file. The CLI always Send/Receive the commands to/from the local gluster-blockd via local rpc. 2. Between gluster-blockd's, i.e local (to cli) gluster-blockd and the gluster-blockd's running on remote(blockhost) This is the tcp connection. The rpc requests are listening on 24006 Also from now gluster-blockd is multi threaded (As of now 2 threads) Lets consider the Create Request to understand what each thread solves Thread1 (THE CLI THREAD) * Listening on local RPC * Generate the GBID (UUID) and create the entry with name GBID in the given volume with a requested size. * And Send the Configuration requests to remote hosts, waits for the replies (HINt: after this point Read Thread2 and come back) * Return to CLI. Thread 2 (THE SERVER THREAD) * Listens on 24006 * On Receiving an event, read the structure. * Executes the required "targetcli bla bla bla" command locally * Fills the command exitcode and the output in the RPC reply structure and send reply Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
* gluster-blockd: daemonize the utilityPrasanna Kumar Kalever2017-01-165-0/+208
this patch, deprecate ssh way of communicating between server nodes/pods Reason: ssh way is hard to be accepted in container world (Kube). An another option kubeExec way seems to be a bit weird, to have uniform way of communication in container and non container worlds, we prefer RPC. From now we communicate via RPC, using a static port 24009 Hence, we have two components, server component -> gluster-blockd (daemon) client component -> gluster-block (cli) Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>