glusterfs/tests
Krishnan Parthasarathi f34343d375 glusterd: big lock - a coarse-grained locking to prevent races
There are primarily three lists that are part of glusterd process,
that are concurrently accessed. Namely, priv->volumes, priv->peers
and volinfo->bricks_list.

Big-lock approach
-----------------
WHAT IS IT?
Big lock is a coarse-grained lock which protects all three
lists, mentioned above, from racy access.

HOW DOES IT WORK?
At any given point in time, glusterd's thread(s) are in execution
_iff_ there is a preceding, inbound network event. Of course, the
sigwaiter thread and timer thread are exceptions.
A network event is an external trigger to glusterd, via the epoll
thread, in the form of POLLIN and POLLERR.
As long as we take the big-lock at all such entry points and yield
it when we are done, we are guaranteed that all the network events,
accessing the global lists, are serialised.

This amounts to holding the big lock at
- all the handlers of all the actors in glusterd. (POLLIN)
- all the cbks in glusterd. (POLLIN)
- rpc_notify (DISCONNECT event), if we access/modify
  one of the three lists. (POLLERR)

In the case of synctask'ized volume operations, we must remember that,
if we held the big lock for the entire duration of the handler,
we may block other non-synctask rpc actors from executing.
For eg, volume-start would block in PMAP SIGNIN, if done incorrectly.
To prevent this, we need to yield the big lock, when we yield the
synctask, and reacquire on waking up of the synctask.

Change-Id: Ib929f9905b55fb6c3fc27fefb497a26dba058e4f
BUG: 948686
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4784
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2013-04-12 13:47:46 -07:00
..
basic features/quota: regression tests on general functionality of quota 2013-03-11 14:00:33 -07:00
bugs glusterd: big lock - a coarse-grained locking to prevent races 2013-04-12 13:47:46 -07:00
performance performance/open-behind: use anonymous fd for doing fstat and readv 2013-02-19 16:07:21 -08:00
utils glusterd, cli: Task id's for async tasks 2012-12-19 13:32:49 -08:00
cluster.rc tests/cluster.rc: support for virtual multi-server glusterd tests 2013-02-26 09:07:13 -08:00
dht.rc cluster/distribute: Ignore non-participating subvols for layout checks 2013-04-09 12:49:40 -07:00
fileio.rc tests/fileio.rc: library for file descriptor based IO in tests 2013-02-21 23:26:57 -08:00
include.rc glusterd: Removed fd leaks in glusterfs_start utility function 2013-03-25 14:50:53 -07:00
README tests/README: add a note about usage of 'mount -t glusterfs' 2012-11-29 22:01:25 -08:00
volume.rc Tests: Change rebalance status verification 2013-04-02 19:05:36 -07:00

How to use test script framework.
=================================

- Build and install the version of glusterfs with your changes. Make
  sure the installed version is accessible from $PATH.

- To mount glusterfs, NEVER use 'mount -t glusterfs', instead use
  'glusterfs -s ' method. This is because with the patch build setup
  doesnot install the /sbin/mount.glusterfs necessary, where as the
  glusterfs binary will be accessible with $PATH, and will pick the
  right version.

- (optional) Set environment variables to specify location of
  export directories and mount points. Unless you have special
  requirements, the defaults should just work. The variables
  themselves can be found at the top of tests/include.rc. All
  of them can be overriden with environment variables.

- Execute run-tests.sh in the top level directory as root.

- If some test cases fail, you can execute the failed test case script
  directly bypassing run-tests.sh. At this time it might be
  useful to set the envrionment variable DEBUG=1 before running
  the individual test script directly by hand.

- BE WARNED THAT THE TEST CASES DELETE /var/lib/glusterd/* !!!