rpc: Reduce frame-timeout for glusterd connections

Reduce frame-timeout for glusterd connections from 30mins to 10 mins. 30mins is
too long when compared to cli timeout of 2mins. Changing to 10mins reduces the
disparity between cli and glusterd.

Also, fix glusterfs_submit_reply() so that a reply is sent even if serialize
failed.

Change-Id: Id5f68f2ff28ea7453d9a62429fe12aa0c0a66952
BUG: 843003
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3803
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
misleading/wrong keep-alive error message in log

Gluster NFS and brick logs contain the following log entries:

[2012-08-16 09:23:39.498998] W [socket.c:410:__socket_keepalive] 0-socket: failed to set keep idle on socket 8
[2012-08-16 09:23:39.499049] W [socket.c:1876:socket_server_event_handler] 0-socket.glusterfsd: Failed to set keep-alive: Operation not supported
[2012-08-16 09:23:42.673756] I [client-handshake.c:1636:select_server_supported_

Stepping through the code though, setting keep-alive did actually work,
it's the keep-idle that failed.

The actual problem is setting keep-idle on non-AF_INET sockets results
in the spurious error message in the log.

BUG: 848882
Change-Id: I3a54c96aea0642307f17a7945cca9f9438543243
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.com/3823
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
fuse: have setxattr on geo-rep related xattrs take effect

In http://review.gluster.com/3687 setxattr was made to a noop for
geo-rep special clients, with the exception of some special ones,
relevant to geo-rep. These exceptions were all in trusted namespace.

That's no good, because with a mountbroker (unprivileged) setup,
the relevant attributes are in system namespace. So here we
just let setxattr through for any geo-rep related xattr, regardless
of namespace.

Change-Id: I261141293b7db955a2e8b2405b4510cb10a42694
BUG: 848447
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.com/3821
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
fix "--client-pid"

http://review.gluster.com/3698 broke special clients by omitting the
conversion of the client_pid_set parameter to the new xlator option
framework.

Change-Id: I0dc886dffba9c4a9fe8d97e5feccfa5f95784ce1
BUG: 848034
Signed-off-by: Csaba Henk <csaba@redhat.com>
Reviewed-on: http://review.gluster.com/3820
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cli/: Displaying the size in human readable format

rebalance status displaying the size in bytes. Converted to
human readable

Change-Id: Ie39938970f92bf7507db2a6de4d5958408f3892c
BUG: 825193
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.com/3781
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
utils: don't leak after failed GF_REALLOC

This is primarily to avoid a leak upon failed GF_REALLOC
when glusterd_readin_file reads a file that is too large.
Also, remove unnecessary memset-0 of PATH_MAX+256-byte buffer.

Change-Id: Id06bd5faef024e1d865f6f0f56bfbb837c9c6168
BUG: 846755
Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-on: http://review.gluster.com/3804
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
gsyncd: don't use void* arithmetic; don't leak upon OOM; remove cast

(duplexpand): Ignore risk of overflow in computation of the realloc
object count, since we'd need a string with 2^62 space-separated tokens
to trigger that (that's w/64-bit size_t; w/32-bit it'd be easier, but
still improbable).

Change-Id: If4521afe7b46110742991dd0ee234284ef8970df
BUG: 846755
Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-on: http://review.gluster.com/3793
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cluster/dht: don't leak upon GF_REALLOC failure

Change-Id: I7dfabcc2981df5c5a1e1a54c3135400a60626cd1
BUG: 846755
Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-on: http://review.gluster.com/3798
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
performance/write-behind: avoid deadlock while taking the statedump of fds

* Provide a hook for forget

Change-Id: Ide7ea6d4c6a7d0d93b81570cb544f2bbda526eeb
BUG: 846916
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-on: http://review.gluster.org/3795
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
syncop: handle 'dataonly' flag in syncop_fsync()

* and also in syncop_readv(), don't look at _cbk args if op_ret
  is < 0.

Change-Id: I3ab2982bc6d186e75b6adb74c8981e4ff7058bbe
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 839950
Reviewed-on: http://review.gluster.org/3828
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
cli: Proper xml output for "gluster peer status"

Change-Id: I5d72d3844aba0417652498f4dc706b4a68d36bd8
BUG: 847760
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/3814
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <krishnan.parthasarathi@gmail.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Self-heald: Prevent logging of errno ENOENT

Change-Id: Ie56228dfbdc7e519a344681487164a835488a470
BUG: 835423
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/3826
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
rpcsvc: remove .vector_actor and related changes

The .vector_actor method of rpcsvc_actor_desc is defunct now after
rpc unification. Remove the field and all related usage of it.

Change-Id: I53048cebeae78f50259e8c4a7fec3497691fe388
BUG: 762935
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/3832
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
NetBSD build fix

BUG: 764655
Change-Id: I65009625dfa627e0ca3b7ff2784b778d26ec04b1
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/3837
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
syncop: Added scaling down logic

RCA:
Whenever the self-heald tests are done with more than 16 replicates
The number of sync procs goes to > 2. These threads never die.

Fix:
Added scaling down logic in syncops so that the threads terminate
themselves whenever the extra thread is idle for ~10 minutes.
Minimum number of threads is still 2.

Tests:
Added logs for launching and terminating procs, made timeout to
6 seconds and ran volume-heal in a while loop. After logs say
max number of procs are launched, attached process to gdb and
verified that the number of syncop threads are 16. Stopped
volume-heal and observed the logs for terminating the procs.
Attached gdb to process again to check that the syncop threads
are just 2. Did this 5 times. Things worked fine. Which procs
were terminated was random. No proc structure was erroneously
re-used. Procs never exceeded 16 and were never < 2.

Change-Id: I61dd9c25cc478ac8cbda190bee841a995b93c55c
BUG: 814074
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.org/3195
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
fuse: make background queue length configurable

* also make 'congestion_threshold' an option
* make 'congestion_threshold' as 75% of background queue length if
  not explicitely specified
* in glusterfsd.c, moved all the fuse option dictionary setting
  code to separate function

Change-Id: Ie1680eefaed9377720770a09222282321bd4132e
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 845214
Reviewed-on: http://review.gluster.org/3830
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
epoll: whitespace cleanup and remove unused variable

Change-Id: Idd7269f8b3a6dfaf931b378128eff93088b3be73
BUG: 821087
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/3841
Tested-by: Gluster Build System <jenkins@build.gluster.com>
posix-acl: make use of 'umask' flag passed as argument in fop

* currently "umask" is reffered only from xdata dictionary, instead
  we should utilize fop argument.
* not taking of setting of "umask" in fuse for now, considering the
  backward compatibility with earlier releases.
* dict_del() the "umask" and "mode" keys from xdata dict as the fop
  after reaching posix layer tries to set every entry in xdata as
  xattr on file/dir.

Change-Id: I7199b05a5bde132df20e7812a99bc02ef7b988ce
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 850873
Reviewed-on: http://review.gluster.org/3843
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
socket: code cleanup

* for more review friendly way

* reduce the level of indirections at each line.

Change-Id: I82ace7683fb281d97a64da724f054ece28215054
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 764890
Reviewed-on: http://review.gluster.org/3839
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Add support for --enable-debug configure option

Currently default build adds -g -O2 to CFLAGS unconditionally
and there is no way to control them from configure.

This patch adds support for --enable-debug option to the
configure cmdline.

If yes, then only -g is added. If no, then -g -O2 is added.
Build defaults to --enable-debug=no.

Also fixes couple of Makefile.am's which had -g hardcoded.

v2:
   Adds -O0 for debug=yes case.
v3:
   Added bugID while submitting patch

Change-Id: I7505619be6fc683de463a0bd44ba5500b0bedfe1
BUG: 851092
Signed-off-by: Deepak C Shetty <deepakcs@linux.vnet.ibm.com>
Reviewed-on: http://review.gluster.org/3822
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: Deepak Shetty <dpkshetty@gmail.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>