142 Commits

Author SHA1 Message Date
Harshavardhana
49ae6d8cd0 build: AM_PATH_XML2 needs proactive check
AM_PATH_XML2 needs check for its existence using
aclocal macros - to avoid problems like below when
libxml2 development libraries are not installed

--------------------------------------------------

... GlusterFS autogen ...

Generate gf-error-codes.h ...
`gf-error-codes.h' -> `libglusterfs/src/gf-error-codes.h'
Running aclocal...
configure.ac:524: warning: macro `AM_PATH_XML2' not found in library
Running autoheader...
Running libtoolize...
Running autoconf...
configure.ac:524: error: possibly undefined macro: AM_PATH_XML2
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
Running automake...
--------------------------------------------------

Change-Id: Ife463c34c45babc1c4c0ed6e8128b5c43419b9b9
BUG: 947226
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/5962
Reviewed-by: Kaushal M <kaushal@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2013-09-18 01:05:37 -07:00
Brian Foster
3b23f9acae performance/readdir-ahead: introduce directory read-ahead translator
This is a translator to improve the performance of typical,
sequential directory reads (i.e., ls). readdir-ahead begins
preloading the contents of a directory on open and serves readdir
requests from the preloaded content. readdir-ahead is currently
implemented to only handle the single threaded directory read
case.

readdir-ahead is currently disabled by default. It can be enabled
with the following command:

	gluster volume set <volname> readdir-ahead on

The following are results of a getdents test on a single brick
volume.

Test info:

- Single VM, gluster client/server.
- Volume mounted with native client using --gid-timeout=2.
- getdents on single directory with 100k 0-byte files.

Test results:

- !readdir-ahead

read 3120080 bytes from offset 0
3 MiB, 4348 ops, 0:00:07.00 (416.590 KiB/sec and 594.4737 ops/sec)

- readdir-ahead

read 3120080 bytes from offset 0
3 MiB, 4348 ops, 0:00:03.00 (820.116 KiB/sec and 1170.3043 ops/sec)

BUG: 980517
Change-Id: Ieceb9e1eb47d1d5b5af8da2bf03839537364653f
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-on: http://review.gluster.org/4519
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-09-04 09:04:15 -07:00
Anand Avati
53e98f11d1 features/qemu-block: support for QCOW2 and QED formats
This patch adds support for internals snapshots using QCOW2 and
general framework for external snapshots (next patch) with
QCOW2 and QED.

For internal snapshots, the file must be "initialized" or
"formatted" into QCOW2 format, and specify a file size.

Snapshots can be created, deleted, and applied ("goto").

e.g:

 // Format and Initialize

sh# setfattr -n trusted.glusterfs.block-format -v qcow2:10GB /mnt/imgfile
sh# ls -l /mnt/imgfile
-rw-r--r-- 1 root root 10G Jul 18 21:20 imgfile

 // Create a snapshot

sh# setfattr -n trusted.glusterfs.block-snapshot-create -v name1 imgfile

 // Apply a snapshot

sh# setfattr -n trusted.gluterfs.block-snapshot-goto -v name1 imgfile

Change-Id: If993e057a9455967ba3fa9dcabb7f74b8b2cf4c3
BUG: 986775
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5367
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
2013-09-03 11:26:26 -07:00
Amar Tumballi
9cef281090 gfid-access: virtual access to filesystem through gfid path
BUG: 952029
Change-Id: I7405d473d369a4a951836eceda4faccbad19ce0e
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Reviewed-on: http://review.gluster.org/5497
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-08-21 12:13:50 -07:00
Kaushal M
ee98605f96 build: Better configure control & messages for xml output
Users were not given a correct indication to whether xml output was
going to be built on running configure as the only information was lost
in the checks output. This would lead to conditions where the user would
assume gluster was compiled with xml output, when it wasn't the case.

With this change, a new line is added to the end of the configure output
which indicates if xml output is being built or not. Also, a new
configure flag, '--disable-xml-output', has been introduced which can be
used to explicitly disable xml outpu from being built.

Change-Id: Ie80ba0372b4c3967a836769c61b60263c8e5e350
BUG: 947226
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/4793
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2013-08-01 03:10:00 -07:00
Niels de Vos
7e6432015a build: use -Werror=implicit-function-declaration to detect build issues
There have been review requests that include a call to a non-existent
function. These problems should be detected as early as possible,
preferably before (automated) regression tests.

Bug: 990243
Change-Id: Idcf4d27f45a1a6177105d02a039363702eb8e3b9
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/5435
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-07-30 20:34:53 -07:00
Avra Sengupta
5757ed2727 glusterd/cli changes for distributed geo-rep
Commands:
gluster system:: execute gsec_create
gluster volume geo-rep <master> <slave-url> create [push-pem] [force]
gluster volume geo-rep <master> <slave-url> start [force]
gluster volume geo-rep <master> <slave-url> stop [force]
gluster volume geo-rep <master> <slave-url> delete
gluster volume geo-rep <master> <slave-url> config
gluster volume geo-rep <master> <slave-url> status

The geo-replication is distributed. The session will be created, and
gsyncd will be spawned on all relevant nodes, instead of only one
node.

geo-rep: Collecting status detail related data

Added persistent store for saving information about
TotalFilesSynced, TotalSyncTime, TotalBytesSynced

Changes in the status information in socket:
Existing(Ex):
FilesSynced=2;BytesSynced=2507;Uptime=00:26:01;

New(Ex):
FilesSynced=2;BytesSynced=2507;Uptime=00:26:01;SyncTime=0.69978;
TotalSyncTime=2.890044;TotalFilesSynced=6;TotalBytesSynced=143640;

Persistent details stored in
/var/lib/glusterd/geo-replication/${mastervol}/${eSlave}-detail.status

Change-Id: I1db7fc13ffca2e415c05200b0109b1254067f111
BUG: 847839
Original Author: Avra Sengupta <asengupt@redhat.com>
Original Author: Venky Shankar <vshankar@redhat.com>
Original Author: Aravinda VK <avishwan@redhat.com>
Original Author: Amar Tumballi <amarts@redhat.com>
Original Author: Csaba Henk <csaba@redhat.com>
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/5132
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
2013-07-26 13:19:18 -07:00
Avra Sengupta
b13c483dca gsyncd: distribute the crawling load
* also consume changelog for change detection.
* Status fixes
* Use new libgfchangelog done API
* process (and sync) one changelog at a time

Change-Id: I24891615bb762e0741b1819ddfdef8802326cb16
BUG: 847839
Original Author: Csaba Henk <csaba@redhat.com>
Original Author: Aravinda VK <avishwan@redhat.com>
Original Author: Venky Shankar <vshankar@redhat.com>
Original Author: Amar Tumballi <amarts@redhat.com>
Original Author: Avra Sengupta <asengupt@redhat.com>
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/5131
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
2013-07-26 13:18:57 -07:00
Avra Sengupta
950371be29 move 'xlators/marker/utils/' to 'geo-replication/' directory
Change-Id: Ibd0faefecc15b6713eda28bc96794ae58aff45aa
BUG: 847839
Original Author: Amar Tumballi <amarts@redhat.com>
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/5133
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2013-07-22 01:53:03 -07:00
Avra Sengupta
11f6c56f83 features/changelog: changelog translator
This is the initial version of the Changelog Translator.

What is it
-----------
Goal is to capture changes performed on a GlusterFS volume.
The translator needs to be loaded on the server (bricks) and
captures changes in a plain text file inside a configured
directory path (controlled by "changelog-dir", should be
somewhere in <export>/.glusterfs/changelog by default).

Changes are classified into 3 types:
    - Data:     : TYPE-I
    - Metadata  : TYPE-II
    - Entry     : TYPE-III

Changelog file is rolled over after a certain time interval
(defauls to 60 seconds) after which a changelog is started.
The thing to be noted here is that for a time interval
(time slice) multiple changes for an inode are recorded only
once (ie. say for 100+ writes on an inode that happens within
the time slice has only a single corresponding entry in the
changelog file). That way we do not bloat up the changelog
and also save lots of writes.

Changelog Format
-----------------
TYPE-I and TYPE-II changes have the gfid on the entity on
which the operation happened. TYPE-III being a entry op
requires the parent gfid and the basename. Changelog format
has been kept to a minimal and it's upto the consumers to
do the heavy loading of figuring out deletes, renames etc..
A single changelog file records all three types of changes,
with each change starting with an identifier ("D": DATA,
"M": METADATA and "E": ENTRY). Option is provided for the
encoding type (See TUNABLES).

Consumers
----------
The only consumer as of today would be geo-replication, although
backup utilities, self-heal, bit-rot detection could be possible
consumers in the future.

CLI
----
By default, change-logging is disabled (the translator is present
in the server graph but does nothing). When enabled (via cli) each
brick starts to log the changes. There are a set of tunable that
can be used to change the translators behaviour:

- enable/disable changelog (disabled by default)
  gluster volume set <volume> changelog {on|off}

- set the logging directory (<brick>/.glusterfs/changelogs is the
  default)
  gluster volume set <volume> changelog-dir /path/to/dir

- select encoding type (binary (default) or ascii)
  gluster volume set <volume> encoding {binary|ascii}

- change the rollover time for the logs (60 secs by default)
  gluster volume set <volume> rollover-time <secs>

- when secs > 0, changelog file is not open()'d with O_SYNC flag
- and fsync is trigerred periodically every <secs> seconds.
  gluster volume set <volume> fsync-interval <secs>

features/changelog: changelog consumer library (libgfchangelog)

A shared library is provided for the consumer of the changelogs
for easy acess via APIs. Application can link against this library
and request for changelog updates. Conversion of binary logs to
human-readable ascii format is also taken care by the library which
keeps a copy of the changelog in application provided working
directory.

Change-Id: I75575fb7f1c53d2bec3dba1a329ea7bb3c628497
BUG: 847839
Original Author: Venky Shankar <vshankar@redhat.com>
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/5127
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2013-07-22 01:52:24 -07:00
Bala.FA
040319d8bc log: enhance syslog logging using CEE format
This patch enables to use syslog as log target in addition to the
default.  The logs are sent in CEE format (http://cee.mitre.org/).
This logging can be disabled using compile time option by

./configure --disable-syslog
(or)
rpmbuild glusterfs.tar.gz --without syslog

The framework provides two api

void gf_openlog (const char *ident, int option, int facility);
void gf_syslog (int error_code, int facility_priority, char *format, ...);

consumers need to call gf_openlog() prior to gf_syslog() like the way
traditional syslog function calls.  error_code is mandatory when using
gf_syslog().  For example,

gf_openlog (NULL, -1, -1);
gf_syslog (GF_ERR_DEV, LOG_ERR, "error reading configuration file");

Using syslog, admin is free to configure logger to
* reduce repeated log messages
* forward logs to remote logger
* execute a command on certain log pattern
* alert people for certain log pattern by email, snmp etc
* and many more

Change-Id: Ibacbcbbc547192893fc4a46b387496b622e4811f
BUG: 928648
Signed-off-by: Bala.FA <barumuga@redhat.com>
Reviewed-on: http://review.gluster.org/4915
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2013-07-19 03:55:35 -07:00
Justin Clift
a2a01c5653 Adjust configure.ac to honor existing CFLAGS env variable
Change-Id: I43a8defc7a8c0c2d391e7bd2c0b7bebfcc522a2a
BUG: 961892
Signed-off-by: Justin Clift <jclift@redhat.com>
Reviewed-on: http://review.gluster.org/4979
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-07-15 00:13:35 -07:00
Niels de Vos
75ee14ffbe build: declare lvm_lv_from_name() if it is missing from lvm2app.h
The bd-xlator can not be built successfully on certain Debian
distributions due to a missing declaration of lvm_lv_from_name(). This
function is available for linking, but it does not exist in the header
file.

This change adds a detection for lvm_lv_from_name() in both the library
for linking, and the declaration in the header file. If the 1st is
missing, the bd-xlator can not be built, and if only the 2nd one is
missing, we'll declare lvm_lv_from_name() ourselves. This makes it
possible to build the bd-xlator on the affected Debian distributions
too.

Change-Id: I0c823a7861b02bb5d9c1abb76ebfff92f272f9eb
BUG: 976946
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/5250
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2013-06-27 04:37:53 -07:00
Kaleb S. KEITHLEY
f7b1245ca2 build: sync glusterfs.spec.in with Fedora glusterfs.spec
* add glusterfs-api and glusterfs-api-devel sub-packages
 * add extras/systemd/glusterd.service. Use it (or extras/init.d/glusterd)
   instead of the Fedora versions.
 * restores ability to build glusterfs RPMs from the dist tarball with
   'rpmbuild {-ts,-tb,-ta} glusterfs-XXX.tar.gz'
 * other minor cleanups mostly to sync with fedora .spec and to build
   from the dist tarball. Any differences will be resolved in the fedora
   .spec in the next release (i.e. beta4 or GA).

(still considering whether to add fedora glusterfsd.{init,service} files
to glusterfs or remove them from fedora.)

BUG: 950083
Change-Id: Ibda3cd57b24ef5c2a27446703e718e5044ec546c
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/5230
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Bala FA <barumuga@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
2013-06-26 04:36:47 -07:00
Brian Foster
d1ccc4e400 gluster: add fallocate fop support
Implement support for the fallocate file operation. fallocate
allocates blocks for a particular inode such that future writes
to the associated region of the file are guaranteed not to fail
with ENOSPC.

This patch adds fallocate support to the following areas:

	- libglusterfs
	- mount/fuse
	- io-stats
	- performance/md-cache,open-behind
	- quota
	- cluster/afr,dht,stripe
	- rpc/xdr
	- protocol/client,server
	- io-threads
	- marker
	- storage/posix
	- libgfapi

BUG: 949242
Change-Id: Ice8e61351f9d6115c5df68768bc844abbf0ce8bd
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-on: http://review.gluster.org/4969
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-06-13 14:37:21 -07:00
Krishnan Parthasarathi
31f5822181 template: A minimal example xlator to build on
This xlator is intended to save new GlusterFS developers
from fighting it with autotools.

How to add template xl onto the xlator graph?
[..]

volname-template
type testing/features/template
subvolumes volname-dht
end-volume

[..]

Change-Id: If513284bb590be7c3b093054108dba2883064190
BUG: 916985
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/4604
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2013-06-05 05:32:21 -07:00
Ram Raja
b054009064 configure.ac: add build option for glupy
Check whether Python.h, glupy dependency, is installed in the system.
 ('Python.h' part of python-devel or python-dev package.)

Allow following build options:
 --enable-glupy   build glupy; If dependencies are not met, abort
                  configure script run with error.

 --disable-glupy  don't build glupy even if dependencies are met.

 default          build glupy; If dependencies are not met, don't build
                  glupy and allow configure script run with warning.

glupy-specific dependencies:
 python2.x, python-devel/python-dev package

Change-Id: Ia495dd00cac7d12ad76645c8576a0adc0cb5d590
BUG: 961856
Signed-off-by: Ram Raja <rraja@redhat.com>
Reviewed-on: http://review.gluster.org/5093
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-05-28 22:37:42 -07:00
Kaleb S. KEITHLEY
10fbae681e configure.ac: build glupy with installed python
IOW with more than just python2.6. Python2.7 is certainly what's on
the vast majority of non-RHEL systems that are out there. Also our
rpm.t regression test will build on epel-5 under mock; RHEL5 has
Python2.4.

Change-Id: I09c95c1fb6b3498e910ad239c4f0af7f786c3700
BUG: 961856
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/5007
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2013-05-19 06:13:01 -07:00
Kaleb S. KEITHLEY
2b65c50554 configure.ac: enable-debug change breaks _hardened_build
See RHBZ 955283, and http://fedoraproject.org/wiki/Packaging:Guidelines#PIE

The previous change for BZ 851092 in
commit 058a736f9e36238c284ca80e7ed5f62434655019
breaks the ability to enable _hardened_build in release-3.4 and master

BUG: 851092
Change-Id: Ib298a492fee22dd82042af704fe8cdd34c3e100e
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/4998
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2013-05-19 06:08:39 -07:00
Raghavendra G
05d2d4a401 rpc-transport/rdma: use rdma-cm for connection establishment.
Till now gluster used tcp/ip based communication channel with
gluster specific protocol to exchange infiniband addresses.

Change-Id: I9de4db398a0e2af51d3d2d68c2fe42168102b190
BUG: 765051
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Reviewed-on: http://review.gluster.org/149
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2013-05-17 00:18:36 -07:00
Ram Raja
1e62ff42df glupy: Importing Jeff's glupy project into glusterfs
Change-Id: I3891ef6eaf6ede7c8cbedc3298ce2501a69b2b05
BUG: 961856
Original-author: Jeff Darcy <jdarcy@redhat.com>
Signed-off-by: Ram Raja <rraja@redhat.com>
Reviewed-on: http://review.gluster.org/4906
Reviewed-by: Justin Clift <jclift@redhat.com>
Tested-by: Justin Clift <jclift@redhat.com>
2013-05-10 14:15:08 -07:00
Niels de Vos
432ce7e60f build: really disable fusermount if you say so
There is no logic in configure.ac that provides a $disable_fusermount
variable. So, use the $enable_fusermount variable instead.

Follow-up-for: http://review.gluster.org/4773
Change-Id: I81cdbd0045409d0036438d542ca6dc1934f784e4
BUG: 948205
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/4803
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Sachidananda Urs <sacchi@gmail.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2013-04-10 23:31:41 -07:00
Anand Avati
125e0cc4eb build: enable fusermount by default
The fusermount available in gluster is customized to ensure
mounting with SELinux happens properly, i.e - to have a separate
thread for fuse_thread_proc which can process getxattr requests
and in parallel perform sys_mount() in a different thread, thereby
avoiding a deadlock.

However our build and packaging defaults to not including our
fusermount. This patch reverses the defaults.

Change-Id: I793af4c2f56aeac46efae3db30e7c64ee7c18850
BUG: 811217
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/4773
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2013-04-03 15:23:54 -07:00
Kaleb S. KEITHLEY
544945a128 config: better (i.e. more portable) test for libxml2
Over the weekend I tried to build on MacOS X¹ and ran into the following
issues:
1) The recent change to autogen.sh to test for pkg-config falls down.
2) After removing the pkg-config test in autogen.sh, w/o pkg-config the
   PKG_CHECK_MODULES macro invocation in configure[.ac] falls down. N.B.
   Solaris users run into this too, even through there's a (broken)
   pkg-config package that can be installed.
3) There are other problems in the code related to fuse that are beyond the
   scope of this.

It seems that pkg-config is only a requirement for the definition of the
PKG_CHECK_MODULES macro used to detect libxml2. Since this seems to be
inherently unportable — at least to MacOS X and Solaris — I'd like to:
A) Change the use of the PKG_CHECK_MODULES macro to the more portable
   AM_PATH_XML2 macro provided by the libxml2 package in
   /usr/.../share/aclocal/libxml.m4
2) Revisit the decision to add the check for pkg-config in autogen.sh in
   BZ 921817.

For now this is just an rfc. If people are agreeable I'll reenter this
change against BZ 921817.

¹Mountain Lion 10.8.3, XCode 4.6.1

Change-Id: I237b1ed8919088345b8fd943423b2a6ad289981b
BUG: 921817
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/4720
Reviewed-by: Justin Clift <jclift@redhat.com>
Tested-by: Justin Clift <jclift@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-03-25 14:50:25 -07:00
Justin Clift
ac524f5907 Fix improperly quoted PKG_CHECK_MODULES parameters.
Change-Id: I11765fd1a25058b84fc32249ea745abefbade3f9
BUG: 920372
Signed-off-by: Justin Clift <jclift@redhat.com>
Reviewed-on: http://review.gluster.org/4652
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-03-12 20:08:01 -07:00
Kaleb S. KEITHLEY
84f5e4b354 glusterfs.spec.in: resync with Fedora glusterfs.spec
Resync with Fedora's glusterfs.spec, being careful to preserve recent
additions to the glusterfs.spec.in such as the package-config for -devel
and the OCF sub-package

To build a set of RPMs:
 % ./autogen.sh
 % ./configure --enable-fusermount
 % make dist
 % cd extras/LinuxRPM && make glusterrpms

Updated rpm.t, hopefully build system has all the dependencies to build UFO

BUG: 819130
Change-Id: I1b1c161337ad780cf7d3ab401fa1b10648f38cbd
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Reviewed-on: http://review.gluster.org/4454
Reviewed-by: Peter Portante <pportant@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-02-17 19:32:02 -08:00
Jeff Darcy
fcc230c99d features: add a directory-protection translator
This is useful to find all calls that remove a file from the protected
directory, including renames and internal calls.  Such calls will cause
a stack trace to be logged.  There's a filter script to add the needed
translators, and then the new functionality can be invoked with one of
the following commands.

	setfattr -n trusted.glusterfs.protect -v log $dir
	setfattr -n trusted.glusterfs.protect -v reject $dir
	setfattr -n trusted.glusterfs.protect -v anything_else $dir

The first logs calls, but still allows them.  The second rejects them
with EPERM.  The third turns off protection for that directory.

Change-Id: Iee4baaf8e837106be2b4099542cb7dcaae40428c
BUG: 888072
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/4496
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-02-17 12:04:48 -08:00
Anand Avati
45c04e107c open-behind: translator to perform open calls in background
This is functionality peeled out of quick-read into a separate
translator.

Fops which modify the file (where it is required to perform the
operation on the true fd) will trigger and wait for the backend
open to succeed and use that fd.

Fops like fstat() readv() etc. will use anonymous FD (configurable)
when original fd is unopened at the backend.

Change-Id: Id9847fdbfdc82c1c8e956339156b6572539c1876
BUG: 846240
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/4406
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
2013-02-06 13:16:08 -08:00
Niels de Vos
b9249c8f9f Fix format security errors with hardening build flags
These problems were found while building with the hardening options used
by Debian. In order to prevent introducing new unsafe constructs, the
options -Wformat" and -Werror=format-security are addeded to the CFLAGS
by configure.ac if the compiler supports them.

Also, a small spelling fix in posix-aio.c is included.

Change-Id: I1034311644fa3c21bc5a7b842c41a3ca79108b3f
BUG: 887278
Original-author: Patrick Matthäi <pmatthaei@debian.org>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/4311
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2013-01-16 17:44:43 -08:00
Kaushal M
c5a70e5b1b Changes to support automake-1.13
automake-1.13 obsoletes some macros that were being used. This patch replaces
these macros.

Change-Id: I2a24a923f284e9b54fb57ccc27eb0b5ad8dd6050
BUG: 892882
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.org/4368
Tested-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2013-01-11 09:08:18 -08:00
Niels de Vos
06d4cced24 build: include OCF resource agents by default and package them
This change introduces a glusterfs-resource-agents sub-package that
contains the Open Cluster Framework (OCF) Resource Agents (RA). It also
changes the build infrastructure to include the RA by default, making
them available for anyone who is interested in using them with a OCF
compatible Hight-Availability solution like Pacemaker.

Build the RPMs without RA:
$ make dist && rpmbuild -ta --without ocf *.gz

Build the RPMs with RA (default):
$ make dist && rpmbuild -ta *.gz

There is no need to run ./autogen.sh from within the .spec, the whole
autotools infrastructure is included in the 'make dist' tarball already.

This also adds a test-case which builds the rpms with mock for the
latest two EPEL releases.

Change-Id: I12ef5f30f466868825352376156fb4e56b135c58
BUG: 869559
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/4130
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
2012-12-12 10:58:45 -08:00
M. Mohan Kumar
ee968619cf xlators: Add Block Device(BD) backend translator
Add a new server storage xlator 'bd mapper'. Intention of this xlator is
to add block device backend support to gluster. It exports block devices
as regular files to the gluster client.

The immediate goal of this translator is to use logical volumes to
store VM images and expose them as files to QEMU/KVM.

Given Volume group is represented as directory and its logical
volumes as files.

By exporting LUNs/LVs as regular files, it becomes possible to:
* Associate each VM to a LV/LUN
* Use file system commands like cp to take copy of VM images
* Create linked clones of VM  by doing LV snapshot at server
side
* Implement thin provisioning by developing a qcow2 translator

As of now this patchset maps only logical volumes. BD Mapper volume
file specifies which Volume group to export to the client. BD xlator
exports the volume group as a directory and all logical volumes under that
as regular files.

BD xlator uses lvm2-devel APIs for getting the list of Volume Groups
and Logical Volumes in the system.

The eventual goal of this work is to support thin provisioning,
snapshot, copy etc of VM images seamlessly in glusterfs storage environment

BUG: 805138
Change-Id: I13b69d39d7fd199c101c8e9e4f2cf10772bdc3dd
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Reviewed-on: http://review.gluster.org/3551
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Tested-by: Vijay Bellur <vbellur@redhat.com>
2012-11-29 09:35:20 -08:00
Emmanuel Dreyfus
04fc3fdb58 POSIX sh uses = and not ==
BUG: 815227
Change-Id: I5a498f1b917fb658914133ee071783e7b8e0d025
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/4151
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
2012-11-05 16:02:39 -08:00
Florian Haas
61c1d77f22 Add OCF compliant resource agents for glusterd and volumes
These resource agents plug glusterd into Open Cluster Framework
(OCF) compliant cluster resource managers, like Pacemaker.

The glusterd RA is fairly trivial; it simply manages the glusterd daemon
like any upstart or systemd job would, except that Pacemaker can
do it in a cluster-aware fashion.

The volume RA is a bit more involved; It starts a volume and monitors
individual brick's daemons in a cluster aware fashion, recovering bricks
when their processes fail.

Note that this does NOT imply people would deploy GlusterFS servers
in pairs, or anything of that nature. Pacemaker has the ability to
deploy cluster resources as clones, meaning glusterd and volumes would be
configured as follows in a Pacemaker cluster:

primitive p_glusterd ocf:glusterfs:glusterd \
	op monitor interval="30"
primitive p_volume_demo ocf:glusterfs:volume \
	params volname="demo" \
	op monitor interval="10"
clone cl_glusterd p_glusterd \
	meta interleave="true"
clone cl_volume_demo p_volume_demo \
	meta interleave="true" ordered="true"
colocation c_volume_on_glusterd inf: cl_volume_demo cl_glusterd
order o_glusterd_before_volume 0: cl_glusterd cl_volume_demo

The cluster status then looks as follows (in a 4-node cluster; note
the configuration above could be applied, unchanged, to a cluster
of any number of nodes):

============
Last updated: Fri Mar 30 10:54:50 2012
Last change: Thu Mar 29 17:20:17 2012 via crmd on gluster02.h
Stack: openais
Current DC: gluster03.h	- partition with quorum
Version: 1.1.6-3.el6-a02c0f19a00c1eb2527ad38f146ebc0834814558
4 Nodes configured, 4 expected votes
8 Resources configured.
============

Online: [ gluster02.h gluster03.h gluster04.h gluster01.h ]

 Clone Set: cl_glusterd [p_glusterd]
     Started: [ gluster02.h gluster03.h gluster04.h gluster01.h ]
 Clone Set: cl_volume_demo [p_volume_demo]
     Started: [ gluster01.h gluster02.h gluster03.h gluster04.h ]

This is also a way of providing automatic glusterd and brick recovery
in systems where neither upstart nor systemd are available.

Change-Id: Ied46657bdfd2dd72dc97cf41b0eb7adcecacd18f
BUG: 869559
Signed-off-by: Florian Haas <florian@hastexo.com>
Reviewed-on: http://review.gluster.org/3043
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-10-24 17:46:48 -07:00
Krishnan Parthasarathi
d6b5690c38 core: Add support for systemtap
- First cut (configure plumbing only)
- Intended to allow people who want to test userspace
  probes for their favourite xlator(s).

Change-Id: I5bf202073a2f1cc29dc4a55714167b7f48b463a1
BUG: 865734
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/3638
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-10-12 09:16:57 -07:00
Jeff Darcy
565cf6625d build: libraries must be in LDADD/LIBADD
Libraries must not be listed in LDFLAGS, because _order is important_.
Details see
http://stackoverflow.com/questions/4241683/linker-flags-in-wrong-place
http://www.gentoo.org/proj/en/qa/asneeded.xml#doc_chap2_sect3

Change-Id: I0479456d6702748c555031bb20641ce430732ec7
BUG: 862082
Original-author: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/4030
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-10-03 12:32:14 -07:00
Jeff Darcy
1ecbb7ca68 build: remove useless explicit -fPIC -shared from
CFLAGS

libtool will automatically add "-fPIC" to the compiler command line as
needed, so there is no need to specify it separately.

"-shared" is normally a linker flag and has an odd effect when used with
libtool --mode=compile, namely that it inhibits production of static
objects. For that however, using AC_DISABLE_STATIC is a lot simpler.

Change-Id: Ic4cba0fad18ffd985cf07f8d6951a976ae59a48f
BUG: 862082
Original-author: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/4027
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-10-03 12:24:59 -07:00
Jeff Darcy
7d347b2b0f build: replace INCLUDES by CPPFLAGS
automake warns: "INCLUDES" is the old name for "AM_CPPFLAGS"
(or "*_CPPFLAGS")

So abolish INCLUDES, and place the flags into GF_CPPFLAGS which then
needs to be mentioned for glusterd.

Change-Id: I326f890a69724d8b7163ce726f70ca4618c53958
BUG: 862082
Original-author: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/4016
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-10-02 09:40:29 -07:00
Jeff Darcy
9059a76c67 build: consolidate common compilation flags into one variable
Some -D flags are present in all files, so collect them.
This adds -D${GF_HOST_OS} to some compiler command lines,
but this should not be a problem.

Change-Id: I1aeb346143d4984c9cc4f2750c465ce09af1e6ca
BUG: 862082
Original-author: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/4013
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-10-01 16:44:50 -07:00
Varun Shastry
3e2057542d All: License message change
License message changed for server-side, dual license GPLV2 and LGPLv3+.

Change-Id: Ia9e53061b9d2df3b3ef3bc9778dceff77db46a09
BUG: 852318
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/3940
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-09-13 13:19:37 -07:00
Emmanuel Dreyfus
e1d24d45c5 Honour configure --localstatedir and --sysconfdir
Makes sure /etc/glusterd to /var/lib/glusterd migration does nonour
configure --localstatedir and --sysconfdir.

BUG: 764655
Change-Id: I65a5f96424d67531e81e75b084265bd4e6e30f29
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.org/3890
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2012-09-05 07:47:50 -07:00
Varun Shastry
2ff5e1c2a1 All: License message change
The license message is changed to
  Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com>
  This file is part of GlusterFS.

  This file is licensed to you under your choice of the GNU Lesser
  General Public License, version 3 or any later version (LGPLv3 or
  later), or the GNU General Public License, version 2 (GPLv2), in all
  cases as published by the Free Software Foundation.

Change-Id: I07d2b63ed5fbbbd1884f1e74f2dd56013d15b0f4
BUG: 852318
Signed-off-by: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/3858
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
2012-08-28 03:45:06 -07:00
Deepak C Shetty
058a736f9e 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>
2012-08-23 03:08:06 -07:00
Anand Avati
dbd7aa2d6b glusterfs-api.pc: pkgconfig for API consumers
Change-Id: I08c60ff9ec5d336077c39f903720f8850d4ddc72
BUG: 839950
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.com/3665
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
2012-07-18 12:11:37 -07:00
Anand Avati
2475e0193c gfapi: API/library for accessing gluster volumes
Change-Id: Ie4cbcf91b58218bebf23cf951c313aceeb29f311
BUG: 839950
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.com/3664
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Bharata B Rao <bharata.rao@gmail.com>
2012-07-18 12:10:44 -07:00
Anand Avati
fb8efa4c6a storage/posix: implement native linux AIO support
Configurable via cli with "storage.linux-aio" settable option

Change-Id: I9929e0d6fc1bbc2a0fe1fb67bfc8d15d8a483d3f
BUG: 837495
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.com/3627
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
2012-07-14 18:09:07 -07:00
Amar Tumballi
1c2624a3ff glusterd: change working-directory from /etc/glusterd to /var/lib/glusterd
as it is changed in RPM based install (using spec file), makes sense to do
it everywhere, even in source install

Change-Id: Ibe5ebd860b1529aca295b79d683a3b2e6797506c
Signed-off-by: Amar Tumballi <amar@gluster.com>
BUG: 824231
Reviewed-on: http://review.gluster.com/3338
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-05-29 22:08:14 -07:00
Emmanuel Dreyfus
c023c1517a Provide missing basename_r and dirname_r
Some systems (e.g.: NetBSD) do not have thread-safe basename(3) and
dirname(3). This is fine with OpenGroup's Single Unix Specification
which allows these functions to use static storage. Unfortunately,
glusterfs uses them a lot and assume thread-safety.

This patch brings FreeBSD's thread-safe basename_r(3) and dirname_r(3)
in the contrib directory, and tweaks the build process so that
NetBSD builds use them instead of libc basename(3) and dirname(3)

BUG: 764655
Change-Id: Ic9a159fffdc7bacc9408f8e90854e4c2db81930c
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3320
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-05-18 19:17:58 -07:00
Emmanuel Dreyfus
7313b22f10 NetBSD build fixes
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>

Change-Id: I8f9aabeadd2f842521a82e59594115bd80155d68
BUG: 2923
Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
Reviewed-on: http://review.gluster.com/3053
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
2012-04-23 21:29:03 -07:00
Krishnan Parthasarathi
fdcbf065a9 glusterfs.spec: Added hook-scripts in server rpm
Change-Id: Idd0ed2a72ea9ec947eaf142b889730e8d4be63c1
BUG: 806996
Signed-off-by: Krishnan Parthasarathi <kp@gluster.com>
Reviewed-on: http://review.gluster.com/3211
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
2012-04-23 05:31:02 -07:00