712 Commits

Author SHA1 Message Date
Kaushal M
e51f690d7c glusterd: Include port in nfs status
Change-Id: I679e491e801b694e8a0f93dd87cf540441dae927
BUG: 806877
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3060
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-04-02 02:41:18 -07:00
Raghavendra G
243f02a5ef performance/quick-read: make unlink aware of open-behind behaviour of quick-read.
quick-read should do an open of all the fds that are waiting for to be
opened behind before doing an unlink on a path.

Change-Id: I4c8d65c0511e8a37765ff57e30d99dd89b56c4fc
BUG: 765363
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/506
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-28 10:40:41 -07:00
Kaushal M
3184ad0f88 cluster/dht : Acl fix for distribute directory selfheal
Send acl xattrs, if present in the xattrs returned during lookup, during
directory self-heal.

Change-Id: I5337bbd3f3963aeed500a8a552e5f6713089b53e
BUG: 764787
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/737
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-26 15:13:43 -07:00
Raghavendra G
98b98d6cd7 libglusterfs/fd: ref fds while copying the fdentries.
Change-Id: I8973ec5d9858adfbdd6efc7cd596cf5d5af0e3cb
BUG: 767862
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/3006
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-26 15:09:20 -07:00
Amar Tumballi
9d3af972f5 core: adding extra data for fops
with this change, the xlator APIs will have a dictionary as extra
argument, which is passed between all the layers. This can be
utilized for overloading in some of the operations.

Change-Id: I58a8186b3ef647650280e63f3e5e9b9de7827b40
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 782265
Reviewed-on: http://review.gluster.com/2960
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-22 16:40:27 -07:00
Amar Tumballi
dc174a4d60 Revert "core: enable process to return the appropriate error code"
This reverts commit 16717f4df7b0fbd3c255f5faf8a2744444231bb7

Change-Id: I65624db4d31e11e1bec66b07b352ce823ef069b9
Reviewed-on: http://review.gluster.com/3001
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-22 04:19:35 -07:00
Amar Tumballi
11be645bb8 dict: add a dict_dump() function to dump the dictionary contents
helps for debugging some functionalities where we have to understand
what we send from one end point to another is properly received on
the other endpoint without any errors.

Change-Id: I9b802f12ae542e499161a1f3b9a5602f7b93b0ee
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 782265
Reviewed-on: http://review.gluster.com/2959
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-21 12:01:38 -07:00
Amar Tumballi
abae8a2086 core: enable process to return the appropriate error code
Credit of this patch goes to Avati <avati@gluster.com> as I just did a
rebase to the lastest master.

Change-Id: I53b2adf90fd9808433bdc35b57dad0682bc90860
BUG: 762935
Signed-off-by: Amar Tumballi <amar@gluster.com>
Reviewed-on: http://review.gluster.com/579
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-21 11:58:29 -07:00
Amar Tumballi
c3bdb1d4c6 glusterd: bring in feature to use syncop for mgmt ops
* new sycnop routines added to mgmt program
* one should not use 'glusterd_op_begin()', instead can use the
  synctask framework, 'glusterd_op_begin_synctask()'
* currently using for below operations:
  'volume start', 'volume rebalance', 'volume quota',
  'volume replace-brick' and 'volume add-brick'

Change-Id: I0bee76d06790d5c5bb5db15d443b44af0e21f1c0
BUG: 762935
Signed-off-by: Amar Tumballi <amar@gluster.com>
Reviewed-on: http://review.gluster.com/479
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-21 11:58:11 -07:00
Raghavendra G
def3dd7f37 libglusterfs/call-stub: ref dict while storing it in readdirp stub
Change-Id: I11224f7afa2e87dc242cc2e9e865c7ab2bb88c7e
BUG: 765785
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/2974
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-03-19 05:45:16 -07:00
Harshavardhana
65c6e3706f libglusterfs/dict: Add boundary conditions
Functions modified:
1. data_to_int16()
2. data_to_uint16()

Change-Id: I6775ca5d39f519c24ca3a07ce41018472e238cdf
BUG: 769692
Signed-off-by: Harshavardhana <fharshav@redhat.com>
Reviewed-on: http://review.gluster.com/2599
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-18 02:20:28 -07:00
Venky Shankar
5f59fbd818 cluster/stripe: fix {set/get}xattr query for dirs/symlink
This patch fixes the following problems:
* ENOENT returned for getxattr (xtime) on symlinks
    Non-data entities are created only on the first subvolume but
    getxattr fop winds to all subvols. This results in all subvols
    except the first one to return ENOENT which is propogated down
    the stack.

* ENODATA returned for getxattr (xtime) on directory
    setxattr calls always wind to the first stripe subvolume.
    xtime getxattr invocation winds to all subvolumes but the
    xattr is present in only the first one, resulting in all
    subvols except the first one to return ENODATA.

Fix

  For symlinks getxattr now always winds to the first subvol and
  for directories setxattr sets the xattr on all subvols.

NOTE

   For directories the all-subvol-wind in setxattr is done
   only when request is from a special client (client-pid == -1)

Change-Id: I9236345ef319506770d2034b840ee4ac04704b21
BUG: 801394
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.com/2948
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-18 02:19:29 -07:00
Pranith Kumar K
1477fe376a Logs: Improved logs in lock/unlock execution path
Statedump will now start showing the lk-owner of the stack.

Change-Id: I9f650ce9a8b528cd626c8bb595c1bd1050462c86
BUG: 803209
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2968
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-18 01:53:41 -07:00
Kaushal M
93022c0cc6 mgmt/glusterd : volume set validation fixes
This is the new version of the patch by Kaushik at review.gluster.com/699

The following new option types have been introduced:
 * GF_OPTION_TYPE_INTERNET_ADDRESS_LIST
 * GF_OPTION_TYPE_PRIORITY_LIST
 * GF_OPTION_TYPE_SIZE_LIST
and option types of several options in translators have been updated to use the
new types.

valid_internet_address(), valid_ipv4_address() & valid_ipv6_address() functions
has been updated for * wildcard matching. Previously used standalone wildcard
address checking functions have been removed.

Changes have been done to stripe translator to correctly set, update and use
stripe-blocksize. Also minimum value for block-size has been set to 16KB.

Change-Id: I2aa484ff695f6a915a8fc9a9f965cf0344f41d59
BUG: 765248
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/2899
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-18 00:52:40 -07:00
Amar Tumballi
7cc412c7a2 mem-pool: more debug friendly logs by using gf_log_callingfn()
Change-Id: I4d6e53ad8660314315f2ff3aa92ffbe707d6efe9
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 803638
Reviewed-on: http://review.gluster.com/2951
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-03-18 00:02:57 -07:00
Amar Tumballi
5e50175f56 core: bring a cmdline option to set memory-accounting
currently this is implemented as a command line option, and not
as an easier translator option. this is because as of now, before
even the volume files are parsed, we would need memory accounting
enabled. there is scope for improving this behavior, but for now,
this approach solves the problem.

Also, this feature's major consumers are the testers who are
looking for leaks, hence option is hidden from usage output.

Change-Id: I09a5b13743ae43ff42c251989f921319e94cabe3
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 799199
Reviewed-on: http://review.gluster.com/2856
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-15 03:33:18 -07:00
Amar Tumballi
eb8a9aae19 core: dict allocations through mem-pool
Change-Id: I7401639060957d437808779745a1e46c3f9f4585
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 798503
Reviewed-on: http://review.gluster.com/2851
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-14 22:15:25 -07:00
Raghavendra Bhat
a059bc3056 cluster/afr: handle sending NULL dentry name for inode link in self-heal-daemon
* Without the dentry name, dentry cannot be created in inode_link, which
 leads to trying to access the null dentry to check if it is cyclic and
 thus segfault. So send the parent inode also NULL, which just returns
 the proper inode after assigning the gfid and type to the inode without
 trying to create dentry.

* Handle failures such as dentry_create returning NULL, in inode_link
  properly and return NULL in such cases.

* Increase the lru limit of inode table of self-heal-daemon to 2048

Change-Id: I7ae0e0e9be279d1694b6aafb5e054585e43f03ff
BUG: 801149
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/2893
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-14 03:53:35 -07:00
Kaushal M
b61103d7ea core, cli : Changes to statedump
This patch,
* Enables missing inodectx, fdctx dumpops for cli statedump command.
* Reintroduce changes introduced in statedump.c by 489a7a10 which were
  overwritten by db20a0f8.
* Change strncasecmp() in gf_proc_dump_parse_set_option() to strcasecmp()
  to properly parse similar options like fd-fdctx, inode-inodectx

Change-Id: I85ad854dce73048617b933d29cf360af9d0ed90a
BUG: 797788
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/2914
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-03-14 02:57:49 -07:00
Krishnan Parthasarathi
2056df6f5e core: Made lkowner_unparse use 'type-safe' format-specifier
Change-Id: Ibd39edb5fccef525f7f0929401f7329508c59ced
BUG: 767229
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/2907
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2012-03-12 07:59:50 -07:00
Amar Tumballi
58776c0800 iobuf: add a counter to keep track of request misses
requests can be denied if the size of the request is higher than the
available sizes.

Change-Id: Id1bf2a56de799ccb94f3791899f2e33f68cd1e2b
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 802047
Reviewed-on: http://review.gluster.com/2913
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-12 05:32:06 -07:00
Mohammed Junaid
ef108d4fa7 protocol/client: Register a timer(grace-timer) conditionally.
A grace timer is registered on a disconnect, but a reconnect timer sends a
connect request after every 3sec and if the server is down, the client protocol
receives disconnect and a grace timer will be registered which on timeout will
increase the lk-version value. Its enough to register the grace timer once after
the disconnect and later just ignore other psuedo disconnects.

Change-Id: I36a153aa86b350d87fe50d014ee0297f558a7fb6
BUG: 795386
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.com/2906
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-10 05:27:56 -08:00
Pranith Kumar K
5b290bc6e3 syncop: Make syntask scalable
At the moment, synctask uses task->frame to perform
all the syncops, this will lead to high-memory usage if the task
crawls millions of directories. i.e millions of STACK_WINDS/UNWINDS.
To prevent this, in each task a new stack is created to perform
the fops which is reset after every syncop.

Change-Id: I53c262ec348be9b1d91af73da01f1c217f31ce6e
BUG: 798907
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2850
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2012-03-09 22:19:32 -08:00
Raghavendra G
f6a779ffc5 features/marker: GFID file handle based backend related fixes
* make sure loc->gfid is filled.

Change-Id: I5304e650d9fc181ee1f3b65be7f2ff3847d9722e
BUG: 790389
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.com/2888
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-07 21:12:41 -08:00
Amar Tumballi
8e29fe73b9 libglusterfs/fd: fixed fd_anonymous() leak
fd was getting leaked whenever there was a overlapping operations,
which caused memory leak, and process fd leaks, which made most of
the operations on NFS mount of a replicate volume not work. With
the fix, things are back to normal.

Change-Id: I2d2158b2972ba5dae270d6ff7b1a827403653c04
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 787368
Reviewed-on: http://review.gluster.com/2892
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-07 10:39:50 -08:00
Krishnan Parthasarathi
63281d7eeb protocol/client: Added lk_ctx info in fdctx dump
- Added a brief explanation as to why we can't use gf_log
  when in statedump.

- Removed gf_log messages from client_priv_dump since
  it can cause a 'deadlock' - See statedump.c for explanation

- Added try-lock based accessors for fd_lk_list for dump purposes.

Change-Id: I1d755a4ef2c568acf22fb8c4ab0a33a4f5fd07b4
BUG: 789858
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/2882
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-03-07 10:17:41 -08:00
Rajesh Amaravathi
6756245b15 fops/removexattr: prevent users from removing glusterfs xattrs
* Each xlator prevents the user from removing xlator-specific
  xattrs like trusted.gfid by handling it in respective removexattr
  functions.

* For xlators which did not define remove and fremovexattr,
  the functions have been implemented with appropriate checks.

xlator         |     fops-added
_______________|__________________________
               |
1. stripe      |     removexattr and fremovexattr
2. quota       |     removexattr and fremovexattr

Change-Id: I98e22109717978134378bc75b2eca83fefb2abba
BUG: 783525
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/2836
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2012-03-05 09:17:47 -08:00
Pranith Kumar K
72eda6a45b libglusterfs: Handle loc_copy for nameless loc
BUG: 787671
Change-Id: I7601f482ae753ead83be16d1df33c2187e76dc5c
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2825
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-29 02:47:19 -08:00
Amar Tumballi
a3f6b0c4f2 mempool: add more counters to understand the usage scenarios properly
current design of mempool is to fallback to standard calloc/free if
all the buffers in pool are exhausted. Understanding more about those
numbers will help us to tune mempool parameters properly over time.

Change-Id: I2c94373186f7c6a486caff2611c2d9df2c37db3c
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 797730
Reviewed-on: http://review.gluster.com/2804
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-27 02:18:35 -08:00
Csaba Henk
20b50008c7 libglusterfs: fix GF_FREE
Argument-taking macros should be possible to use with
same syntax that of C functions. In particular (assuming
FOO is a single-argument macro),

  FOO(bar)

should break and

  if (cond)
    FOO(bar);
  else
    baz();

should compile.

Change-Id: If852c128a7317dc0dda1c669be7c6af40501e48d
BUG: 762061
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.com/2816
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-02-27 02:15:51 -08:00
Venky Shankar
5842656feb Introduce new extended attribute: node-uuid
Request for trusted.glusterfs.node-uuid returns pathinfo
like string but containing the UUID of glusterd instead
of the backend path for the requested file. This info
is benificial for tasks like parallel rebalance that will
make use of the UUID for data locality.

Change-Id: I766a09cc4a5f63aebd11c73107924a1b29242dcf
BUG: 772610
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.com/2614
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Shishir Gowda <shishirng@gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-22 23:19:44 -08:00
Raghavendra Bhat
683ce1bca3 glusterfsd: unref the dict and use dict_set_dynstr to avoid memleak
Unref the new dict and use proper dict api (dict_set_dynstr) to save
data for displaying volume status information, which otherwise leads
to memory leak in the process.

Change-Id: Icb9ceb1a867c5b9759211a67027d983ab9b7e1c2
BUG: 796186
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/2799
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-22 21:21:22 -08:00
Amar Tumballi
67104b716a mempool: adjustments in pool sizes
* while creating 'rpc_clnt', the caller knows what would be the ideal
  load on it, so an extra argument to set some pool sizes

* while creating 'rpcsvc', the caller knows what would be the ideal
  load of it, so an extra argument to set request pool size

* cli memory footprint is reduced

Change-Id: Ie245216525b450e3373ef55b654b4cd30741347f
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 765336
Reviewed-on: http://review.gluster.com/2784
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-22 04:23:48 -08:00
Harshavardhana
2d470cd910 libglusterfs/options: Cleanup xlator percent_sizet code.
Change-Id: I1a39252d6c26f7e30b77ef682b8b3cdcde8a4a51
BUG: 769691
Signed-off-by: Harshavardhana <fharshav@redhat.com>
Reviewed-on: http://review.gluster.com/2619
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-02-21 22:23:09 -08:00
Pranith Kumar K
709de8c86a libglusterfs: Warn on missing _cbk calls in xlator
Change-Id: I44684b5eeca3674ed8d5b7b0120699bb3767e38d
BUG: 763820
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2782
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-02-21 02:50:17 -08:00
Amar Tumballi
0ef7e763c8 core: utilize mempool for frame->local allocations
in each translator, which uses 'frame->local', we are using
GF_CALLOC/GF_FREE, which would be costly considering the
number of allocation happening in a lifetime of 'fop'. It
would be good to utilize the mem pool framework for xlator's
local structures, so there is no allocation overhead.

Change-Id: Ida6e65039a24d9c219b380aa1c3559f36046dc94
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 765336
Reviewed-on: http://review.gluster.com/2772
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-02-21 02:42:09 -08:00
Amar Tumballi
bca46fd46b rpc/clnt: handle PARENT_DOWN event appropriately
Change-Id: I4644e944bad4d240d16de47786b9fa277333dba4
BUG: 767862
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Reviewed-on: http://review.gluster.com/2735
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-21 01:42:42 -08:00
Raghavendra G
7197111677 fuse-bridge: Handle graph-switch.
The purpose of this patch is to let protocol/client know when its transports can
be disconnected, without application running on gluster mount noticing any
effects of graph switch.

In order to do this, we migrate all fds and blocked locks to new graph.
Once this migration is complete and there are no in-transit frames as viewed
by fuse-bridge, we send a PARENT_DOWN event to its children. protocol/client
on receiving this event, can disconnect up its transports.

Change-Id: Idcea4bc43e23fb077ac16538b61335ebad84ba16
BUG: 767862
Reviewed-on: http://review.gluster.com/2734
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-21 01:05:14 -08:00
Pranith Kumar K
81ab6622d4 cluster/afr: Add commands to see self-heald ops
Change-Id: Id92d3276e65a6c0fe61ab328b58b3954ae116c74
BUG: 763820
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2775
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-20 21:23:37 -08:00
Pranith Kumar K
5f117a4a1f cluster/afr: Self-heald, Index integration
Change-Id: Ic68eb00b356a6ee3cb88fe2bde50374be7a64ba3
BUG: 763820
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2749
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-20 21:23:21 -08:00
Anand Avati
1206437fcf syncop: Multi-processor support in syncenv
This patch introduces:

- multithreading of syncop processors permitting synctasks to be executed
  concurrently if the runqueue has many tasks.

- Auto scaling of syncop processors based on runqueue length.

- Execute a synctask (synctask_new) in a blocking way if callback function
  is set NULL. The return value of the syncfn will be the return value
  of synctask_new()

Change-Id: Iff369709af9adfd07be3386842876a24e1a5a9b5
BUG: 763820
Reviewed-on: http://review.gluster.com/443
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-02-20 21:12:08 -08:00
Pranith Kumar K
dfc88bf372 storage/posix: Add xattr for gfid2path
Change-Id: I1fe987d255bf50e8433043749b482b67554a0ac3
BUG: 763820
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2774
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-20 10:05:38 -08:00
Pranith Kumar K
12480df27b features/index: Index translator implementation
Change-Id: If8a11ecbdd010f64fb4409add5751080f4b59086
BUG: 763820
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/2722
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-20 08:52:33 -08:00
Krishna Srinivas
ed20369794 NLM - Network Lock Manger V4
Change-Id: Ic31b8bb10a28408da2a623f4ecc0c60af01c64af
BUG: 795421
Signed-off-by: Krishna Srinivas <ksriniva@redhat.com>
Reviewed-on: http://review.gluster.com/2711
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-02-20 07:26:51 -08:00
Raghavendra Bhat
db20a0f8a9 libglusterfs: Implement circular buffer and event history
Implement circular buffer framework, so that it can be used by other components
such as event history management. And event history is implemented which can
be used by xlator to dump some information to a file (such as information of some
structure etc).

Through statedump, history of each xlator can be dumped. An option called history
should be given to the statedump command.

Change-Id: I7c5e8f6bd1018584eaee856e933e7c4b94c6709c
BUG: 795419
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com>
Reviewed-on: http://review.gluster.com/2769
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-20 06:59:11 -08:00
Mohammed Junaid
f764516c2e protocol/client,server: fcntl lock self healing.
Currently(with out this patch), on a disconnect the server cleans up
the transport which inturn closes the fd's and releases the locks acquired on
those fd's by that client. On a reconnect, client just reopens the fd's but
doesn't reacquire the locks. The application that had previously acquired
the locks still is under the assumption that it is the owner of those locks
which might have been granted to other clients(if they request) by the server
leading to data corruption.

This patch allows the client to reacquire the fcntl locks (held on the fd's)
during client-server handshake.

* The server identifies the client via process-uuid-xl (which is a combination
  of uuid and client-protocol name, it is assumed to be unique) and lk-version
  number.

* The client maintains a list of process-uuid-xl, lk-version pair for each
  accepted connection. On a connect, the server traverses the list for a
  matching pair, if a matching pair is not found the the server returns
  lk-version with value 0, else it returns the lk-version it has in store.

* On a disconnect, the server and client enter grace period, and on the
  completion of the grace period, the client bumps up its lk-version number
  (which means, it will reacquire the locks the next time) and the server will
  distroy the connection. If reconnection happens within the grace period, the
  server will find the matching (process-uuid-xl, lk-version) pair in its list
  which guarantees that the fd's and there corresponding locks are still valid
  for this client.

Configurable options:
  To set grace-timeout, the following options are
    option server.grace-timeout value
    option client.grace-timeout value

  To enable or disable the lk-heal,
    option lk-heal [on|off]

gluster volume set command can be used to configurable options
Change-Id: Id677ef1087b300d649f278b8b2aa0d94eae85ed2
BUG: 795386
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Reviewed-on: http://review.gluster.com/2766
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-20 04:45:31 -08:00
Rajesh Amaravathi
975933a25d glusterd: auth allow enhancements
* PROBLEM:

  When address-based authentication is enabled on a volume,
  the gNfs server, self-heal daemon (shd), and other operations
  such as quota, rebalance, replace-brick and geo-replication
  either stop working or the services are not started if all
  the peers' ipv{4,6} addresses or hostnames are not added in
  the "set auth.allow" operation, breaking the functionality
  of several operations.

  E.g:
    volume vol in a cluster of two peers:
    /mnt/brick1 in 192.168.1.4
    /mnt/brick2 in 192.168.1.5

    option auth.allow 192.168.1.6
    (allow connection requests only from 192.168.1.6)

    This will disrupt the nfs servers on 192.168.1.{4,5}.
    brick server processes reject connection requests from both
    nfs servers (on 4,5), because the peer addresses are not in
    the auth.allow list.

    Same holds true for local mounts (on peer machines),
    self-heal daemon, and other operations which perform
    a glusterfs mount on one of the peers.

* SOLUTION:

  Login-based authentication (username/password pairs,
  henceforth referred to as "keys") for gluster services and
  operations.

  These *per-volume* keys can be used to by-pass the addr-based
  authentication, provided none of the peers' addresses are put
  in the auth.reject list, to enable gluster services like gNfs,
  self-heal daemon and internal operations on volumes when
  auth.allow option is exercised.

* IMPLEMENTATION:

  1. Glusterd generates keys for each volume and stores it in
     memory as well as in respective volfiles.
     A new TRUSTED-FUSE volfile is generated which is
     fuse volfile + keys in protocol/client,
     and is named trusted-<volname>-fuse.vol.
     This is used by all local mounts. ANY local mount (on any peer)
     is granted the trusted-fuse volfile instead of fuse volfile
     via getspec. non-local mounts are NOT granted the trusted fuse
     volfile.

  2. The keys generated for the volume is written to each server
     volfile telling servers to allow users with these keys.

  3. NFS, self-heal daemon and replace-brick volfiles are updated
     with the volume's authentication keys.

  4. The keys are NOT written to fuse volfiles for obvious reasons.

  5. The ownership of volfiles and logfiles is restricted to root users.

  6. Merging two identical definitions of peer_info_t in auth/addr
     and rpc-lib, throwing away the one in auth/addr.

  7. Code cleanup in numerous places as appropriate.

* IMPORTANT NOTES:

  1. One SHOULD NOT put any of the peer addresses in the auth.reject
     list if one wants any of the glusterd services and features
     such as gNfs, self-heal, rebalance, geo-rep and quota.

  2. If one wants to use username/password based authentication
     to volumes, one shall append to the server, nfs and shd volfiles,
     the keys one wants to use for authentication, *while_retaining
     those_generated_by_glusterd*.
     See doc/authentication.txt file for details.

Change-Id: Ie0331d625ad000d63090e2d622fe1728fbfcc453
BUG: 789942
Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com>
Reviewed-on: http://review.gluster.com/2733
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-20 00:30:54 -08:00
shishir gowda
4a65356275 cluster/dht: Support for hardlink rebalance when decommissioning
The support for hardlink rebalance is only available for decommissioning
of a node. this can be triggered in two ways
1. remove-brick start
2. if decommission node value is set in vol file, then a normal rebalance
   command

The way we handle it is-
if (nlink > 1)
do
       * if src file doesnt have linkto xattr
                * mark src's linkto to the dst
       * else
                * perform a link on the dst
                * do a look up
                * if nlinks = dst.nlinks
                        * migrate data
                * else
                        * continue crawling
done
Signed-off-by: shishir gowda <shishirng@gluster.com>
Change-Id: If43b5524b872fd1413e9f7aa7f436cb244e30d8d
BUG: 763844
Reviewed-on: http://review.gluster.com/2737
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-02-19 04:47:50 -08:00
shishirng
7ba1e1ed45 cluster/dht: Rebalance will be a new glusterfs process
rebalance will not use any maintainance clients. It is replaced by syncops,
with the volfile. Brickop (communication between glusterd<->glusterfs process)
is used for status and stop commands.

Dept-first traversal of dir is maintained, but data is migrated as and when
encounterd.
fix-layout (dir)
do
        Complete migrate-data of dir
        fix-layout (subdir)
done

Rebalance state is saved in the vol file, for restart-ability.
A disconnect event and pidfile state determine the defrag-status

Signed-off-by: shishirng <shishirng@gluster.com>
Change-Id: Iec6c80c84bbb2142d840242c28db3d5f5be94d01
BUG: 763844
Reviewed-on: http://review.gluster.com/2540
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-02-19 01:31:19 -08:00
Kaushal M
489a7a10fe cli: Fix for statedump crashing gluster processes
1. Fixes the bug in statedump causing the gluster process to crash when an unknown
option was given in the 'glusterdump.*.options' file.
2. Also fixes cli, making it send full statedump option strings even when only
partial option strings are given in 'volume statedump' command.
3. Minor change to order of operations during statedump to allow option parsing
errors to be written to the dump file.

Change-Id: Ic878cbca4dbf46b83fba0fd88fcb3c03f05ae46d
BUG: 772586
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/2706
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-02-17 00:57:02 -08:00