summaryrefslogtreecommitdiffstats
path: root/xlators
Commit message (Collapse)AuthorAgeFilesLines
* geo-rep: implement IP address based access controlCsaba Henk2011-09-223-23/+64
| | | | | | | | | | | | | | | | | | | - gsyncd gets allow-network tunable which is expected to hold a comma-separated list of IP network addresses - for IP addess matching, bring in ipaddr module from Google (http://code.google.com/p/ipaddr-py/, rev. trunk@225) This will let users control master's access to slave's volumes until we implement unprivileged geo-rep (delayed due to some technical issues). It's also needed for the completeness of our hardening efforts, as plain file slaves won't be able to work with an unprivileged gsyncd. Change-Id: I58431cba6592f8672e93ea89a5eef478905b00b9 BUG: 2825 Reviewed-on: http://review.gluster.com/488 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* geo-rep: gsyncd: make sure path operations do not act outside the volumeCsaba Henk2011-09-221-0/+28
| | | | | | | | Change-Id: I2da62b34aa833b9a28728fa1db23951f28b7e538 BUG: 2825 Reviewed-on: http://review.gluster.com/462 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* gsyncd: control rsync targetCsaba Henk2011-09-225-20/+258
| | | | | | | | | | | | | - require/perform rsync invocation with unprotected args (so that target is revealed to gateway program) - make use of some procfs wizardry to find gsyncd sibling and match rsync target against its working directory Change-Id: Iae1e39b0e61f22563c0f2a2e0605567e0d1902df BUG: 2825 Reviewed-on: http://review.gluster.com/461 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* gsyncd: implement restricted mode and utility dispatchCsaba Henk2011-09-222-38/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, the suggested way of setting up a geo-sync slave is to use an ssh key with gsyncd as a forced command (see sshd(8)), or set gsyncd as shell. This prevents the master in executing arbitrary commands on slave (a major security hole). Detailed list the changes: - All gsyncd invocations that are not done by glusterd are considered unsafe and then we operate in so-called "restricted mode" (see below) - if we are invoked on purpose (ie. it's not the case that sshd forced us to run as frontend of a remote-invoked command), we execute gsyncd.py - if invoked by sshd as frontend command, we check the remote command line and call the required utility if it's among the allowed ones (rsyncd and gsyncd) - with rsync, we check if invocation is server mode and some other sanity measures - with gsyncd, in restricted mode we enforce the usage of the glusterd provided config file, and in python, we enforce operation in server mode and some other sanity checks Impact on using geo-rep the old way: remote file slave now also requires a running glusterd (to pick up config from). Missing: we not implemented check of the rsync target path. The issue of master being able to modify arbitrary locations is planned to be mitigated by using geo-rep with an unprivileged user. Change-Id: I9b5825bfe282a9ca777429aadd554d78708f1638 BUG: 2825 Reviewed-on: http://review.gluster.com/460 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* geo-rep: rewrite gsyncd wrapper in CCsaba Henk2011-09-224-60/+152
| | | | | | | | | | | | | | | This rewrite does not change functionality; it's purpose is to prepare followup modifications which will let all slave side helper programs being dispatched to through gsyncd. The string processing that's required for that task would be too much cumbersome in shell. Change-Id: Ia7858aba5efeb5dcff16a918ea1c02253f0e49ab BUG: 2825 Reviewed-on: http://review.gluster.com/459 Reviewed-by: Amar Tumballi <amar@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* Peer probe: Handle probe of friend with multiple hostnameshishir2011-09-221-0/+23
| | | | | | | | | | | | | | | | Currently, when a peer is probed with a different hostname already belonging to a cluster, a duplicate entry is created with uuid to set to 0. This leaves the peerinfo in a inconsistent state, and when a detach of this peer is issued, the correct entry gets removed. The fix is to identify a peer with a hostname not matching to the probed hostname and remove the incorrect entry. Change-Id: I2f6c02f505f4426871623a4a8b45a12996095098 BUG: 3200 Reviewed-on: http://review.gluster.com/456 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* NFS : Posix compliance fixes.Gaurav2011-09-221-4/+6
| | | | | | | | | Change-Id: I4f1d8883a3eedee20557e306815674a6dc062bfe BUG: 1337 Reviewed-on: http://review.gluster.com/487 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: fix 'volume status' showing incorrect online statusKaushal M2011-09-221-20/+33
| | | | | | | | | | | | | | glusterd now checks if a brick process is running to set online status, instead of using brickinfo->signed_in. The earlier method used to show incorrect online status as brickinfo->signed_in was not updated when brick process was killed with SIGKILL Change-Id: Id5589ea8abbcffebe5c794e5a4adf4f0e6e489f0 BUG: 3573 Reviewed-on: http://review.gluster.com/476 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* cluster/distribute: validate buf before accessing.Rahul C S2011-09-221-5/+5
| | | | | | | | | | | The macro to check & reset rebalance flags was accessing the iatt structure even in case of failures leading to null dereference. Change-Id: I518f4cc9086cecbe6cf791c8a351287fe3613650 BUG: 3594 Reviewed-on: http://review.gluster.com/472 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shishir Gowda <shishirng@gluster.com>
* nfs: enhance NFS log messages.krishna2011-09-212-71/+194
| | | | | | | | Change-Id: I6c2eaa2795756f515b5fb2ea5098d3dcb4ef77c4 BUG: 3527 Reviewed-on: http://review.gluster.com/433 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* Rebalance: Mount rebalance client with assert-on-child-down set to onshishir gowda2011-09-211-0/+1
| | | | | | | | | | | | | | This will prevent rebalance to be started when a brick is down, or stop rebalance if a brick goes down during a rebalance op. On restarting the rebalance once all the bricks are up, rebalance proceeds as usual. Change-Id: I196ae658c3a3856cce5314eca194e62d42171b9d BUG: 3574 Reviewed-on: http://review.gluster.com/481 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* glusterfs protocol: handshake to log the version of the peerAmar Tumballi2011-09-213-5/+23
| | | | | | | | | | | | | | | | | * As RPC program's name is just used for logging, we now have 'PACKAGE_VERSION' part of the string, which gets logged in client side. * From client, we send the PACKAGE_VERSION in handshake dictionary, which gets logged on serverside handshake. The change doesn't break any compatibility between client or server as it would only enhance the logging part of handshake. Change-Id: Ie7f498af2f5d3f97be37c8d982061cb6021883ce BUG: 3589 Reviewed-on: http://review.gluster.com/467 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* cluster/afr: Make local->child_up immutablePranith Kumar K2011-09-216-164/+113
| | | | | | | | | | | | | | | | | | | | | | | Afr transaction performs lock, pre-op, op, post-op and unlock steps in that order. The child_up[] is overloaded with the information of where all the first two steps succeeded. This works perfectly fine for Transaction, but the locking/unlocking part of the code is re-used by data self-heal. In that each loop_frame does lock, rchecksum, read-from-source and write-to-sinks, unlock steps. Rchecksum fop assumes that the fop needs to happen on one source + all sinks and sets the call_count to that number. But if the lock step fails on any of the sinks it will mark the child_up of that child to 0, which will result in call_count mismatch and the frame will hang thinking that some more cbks need to come. When this happens loop_frame will never go to unlock step leading to hangs on that file. Change-Id: I3dd0449cc6193a980bacf637d935881f4b22210a BUG: 3597 Reviewed-on: http://review.gluster.com/474 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd rebalance: set the proper status as per command givenAmar Tumballi2011-09-211-0/+4
| | | | | | | | | | | for both 'migrate-data start' or 'migrate-data start force' commands the defrag status should start with 'migrate-data-started' state. Change-Id: Ic645bc764c4d24ab438187fb139c4a1c3ade8949 BUG: 3593 Reviewed-on: http://review.gluster.com/477 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shishir Gowda <shishirng@gluster.com>
* mgmt/glusterd: Create volfile in correct pathPranith Kumar K2011-09-211-11/+5
| | | | | | | | Change-Id: Ie52e4b1a338282f2697e2ce374dd566d2c5cf5d1 BUG: 3586 Reviewed-on: http://review.gluster.com/475 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* geo-rep: gsyncd: add --ignore-deletes optionVenky Shankar2011-09-203-3/+29
| | | | | | | | | | | | | | | When this option is set, a file deleted on master will not trigger a delete operation on the slave. Hence, the slave will remain as a superset of the master and can be used to recover the master in case of crash and/or accidental deletes. This options is not enabled by default. Change-Id: I9244d9dfa4f38f19436036f36bec0d9c3a1f7993 BUG: 3552 Reviewed-on: http://review.gluster.com/426 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Csaba Henk <csaba@gluster.com>
* storage/posix: Filter custom getxattrs in lookupPranith Kumar K2011-09-201-2/+33
| | | | | | | | Change-Id: If948ff1b355ea4fd92036bcc43e7b32325aeb3e4 BUG: 3470 Reviewed-on: http://review.gluster.com/325 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* cluster/distribute: minor fixes in open file migrationAmar Tumballi2011-09-195-37/+91
| | | | | | | | | | | * incorporated Avati's comments on the first patch. * send proper stat information while unwinding Change-Id: I36982cec610753c241c372272620ab2bd581fd9f BUG: 3071 Reviewed-on: http://review.gluster.com/408 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* features/locks: free the string allocated by inode_pathRaghavendra Bhat2011-09-191-3/+8
| | | | | | | | Change-Id: I1b7d4059610713b92c4bb78676c3b48335e3a0fe BUG: 3468 Reviewed-on: http://review.gluster.com/465 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: run 'volume top read-perf/write-perf' in different threadKaushal M2011-09-191-195/+0
| | | | | | | | | | | | | | | Runs the 'volume top read-perf/write-perf' operations in a different thread without blocking glusterd. Prvents glusterd from being unresponsive when large values of 'bs' and 'count' are given. Also increase cli timeout for top/profile commands , from 120s to 300s to allow large i/o top read-perf and write-perf to return result. Change-Id: I4b7de1d735f33643d836772db7f25133f112b75a BUG: 2720 Reviewed-on: http://review.gluster.com/375 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shishir Gowda <shishirng@gluster.com>
* s@GFS_PREFIX"/sbin@SBIN_DIR@Csaba Henk2011-09-197-12/+11
| | | | | | | | | | | $sbindir is the install path for gluster* binaries, so this is what should be used in their invocation Change-Id: Ie748b4cbf59c3ee77f721ff6e0ab7151742ce0ab BUG: 2825 Reviewed-on: http://review.gluster.com/458 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* glusterd: provide a option to start processes with valgrindRajesh Amaravathi2011-09-193-6/+50
| | | | | | | | | | | | By enabling the brick-with-valgrind option in glusterd, one can automatically start all bricks with valgrind monitoring them. Change-Id: Ib0a97a83c4461c0878454e96bc84462f6cad6bc8 BUG: 3461 Reviewed-on: http://review.gluster.com/311 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd/top: volume top succeeds on partial brickpathRajesh Amaravathi2011-09-197-60/+79
| | | | | | | | | | | | | | Rewrite of glusterd_volume_brickinfo_get in glusterd-utils.c An additional argument to glusterd_volume_brick_info_get_by_brick and glusterd_volume_brickinfo_get enables matching brick path in two ways: Complete or partial(ancestor and descendent paths matched). Change-Id: Ia87833a6f0c139599c3e40b59d60c64281b4084b BUG: 3271 Reviewed-on: http://review.gluster.com/162 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shishir Gowda <shishirng@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: make sort portableRajesh Amaravathi2011-09-191-8/+1
| | | | | | | | | | fixed for fd leaking. reopening of file was not needed BUG: 3491 Change-Id: I1351bdcaa41a5901574f5e779c33bf6f80a938f9 Reviewed-on: http://review.gluster.com/453 Reviewed-by: Csaba Henk <csaba@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* protocol/client: minor log enhancementsRajesh Amaravathi2011-09-191-21/+14
| | | | | | | | | | minor changes to the log enhancements of bug 3473. Change-Id: Id38d29db5a744e0ab7342d10ead6d16866228062 BUG: 3473 Reviewed-on: http://review.gluster.com/452 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* Fix typo in log message.Sachidananda Urs2011-09-191-1/+1
| | | | | | | | Change-Id: Ia51ffe03c8b94ddfe21c6609bc0d54b5bd29eca7 BUG: 3158 Reviewed-on: http://review.gluster.com/392 Reviewed-by: Vijay Bellur <vijay@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* features/marker: Use appropriate loc struct to do removexattr on newpath ↵Raghavendra G2011-09-191-1/+12
| | | | | | | | | | after rename. Change-Id: I060e62c1fbb288179063a6d64d73bad1a6572661 BUG: 3493 Reviewed-on: http://review.gluster.com/390 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: make sort portableRajesh Amaravathi2011-09-181-9/+21
| | | | | | | | | | | | | The result of sorting the volume info file has been programmatically redirected, instead of using the -o option. Change-Id: Id789fab8dc92b254571a4fc7239e4872f3ac055f BUG: 3491 Reviewed-on: http://review.gluster.com/395 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterfsd: enable max fetch attemptsKaushal M2011-09-181-1/+7
| | | | | | | | | | | | | | Enables usage of 'volfile-max-fetch-attempts' option of glusterfsd. Also, adds an option to 'mount.glusterfs' for setting the max fetch attempts. For a server with multiple ips, each call to gf_resolve_ip6() returns a different ip. Since gf_resolve_ip6() is called for each fetch attempt, this change also enables rrdns support for gluster. Change-Id: I3edadbf0ff43ff414b30eb50dd9ca4a6fd6b1089 BUG: 2441 Reviewed-on: http://review.gluster.com/239 Reviewed-by: Amar Tumballi <amar@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* performance/quick-read: fix memory corruption.Raghavendra G2011-09-181-4/+0
| | | | | | | | | | | | - macro QR_STACK_UNWIND destroys the stub present in local and hence no need of explicitly calling call_stub_destroy on it. Change-Id: Ib81c9a0d382765e783722b14fdbd7877086b1bec BUG: 3562 Reviewed-on: http://review.gluster.com/439 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* protocol/client: log enhancementsRajesh Amaravathi2011-09-181-90/+109
| | | | | | | | | | | * print paths wherever it is possible to log, to help debugging. * bring uniformity in log level. Change-Id: I2fa85b629de5dd0f0057ed96cba08ecb0ff1a798 BUG: 3473 Reviewed-on: http://review.gluster.com/328 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* glusterd: profile cmd incorrectly reports all bricks down.Krishnan Parthasarathi2011-09-154-30/+19
| | | | | | | | | | | | If there are no bricks of a volume running 'local' to glusterd where the 'profile info' command is issued, glusterd incorrectly reports that all bricks of the volume are down. Change-Id: Idd703c991f0bcf59b76b9ef8f4ad8cd71960a55b BUG: 3553 Reviewed-on: http://review.gluster.com/430 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* Proactive self heal process implementationPranith Kumar K2011-09-1423-523/+1592
| | | | | | | | Change-Id: I96db0d94566ceabf1649f890318363f738c06553 BUG: 2458 Reviewed-on: http://review.gluster.com/403 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* debug/io-stats: Allow multiple children in graphPranith Kumar K2011-09-141-2/+2
| | | | | | | | Change-Id: Ie4fb75d8000ff95daa8bf9f6757926822de28a65 BUG: 2458 Reviewed-on: http://review.gluster.com/401 Reviewed-by: Vijay Bellur <vijay@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* features/quota: explicitly create xattrs in marker_create_cbkRaghavendra G2011-09-142-3/+11
| | | | | | | | | | | | | | - the earlier approach of creating quota related xattrs through side-effect of updating size and contribution values won't work, since when no contribution xattr is present, the updation process treats contribution value as zero and hence will be equal to size of freshly created files Change-Id: If9b2063b1ac3a4cf50d3fe2c81e907bc8eccb677 BUG: 3531 Reviewed-on: http://review.gluster.com/385 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Mohammed Junaid <junaid@gluster.com>
* features/quota: implement mknod fop.Raghavendra G2011-09-141-0/+142
| | | | | | | | Change-Id: If8f2a0bb635160ee78f35787ee9f8a4db87ae8ac BUG: 3531 Reviewed-on: http://review.gluster.com/384 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Mohammed Junaid <junaid@gluster.com>
* GlusterFS Hadoop specific DSL for mountbrokerVenky Shankar2011-09-133-12/+65
| | | | | | | | Change-Id: Ie379992bdea0974c8c5e1a4d7bc3e87cefe0d256 BUG: 3539 Reviewed-on: http://review.gluster.com/404 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd rebalance: fix minor issuesAmar Tumballi2011-09-132-35/+42
| | | | | | | | | | | | | | | there were bugs introduced due to parallelizing rebalance op. * argument to dict_set_str () should be static as for the life of dict * uuid_utoa() output should not be considered as static * overloading 'volinfo->defrag' in other nodes is a overkill, just KISS Change-Id: I43d00c8e22beb2dd5c5f9824552f7337543b2255 BUG: 2112 Reviewed-on: http://review.gluster.com/407 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* support for de-commissioning a node using 'remove-brick'Amar Tumballi2011-09-1315-137/+588
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to achieve this, we now create volume-file with 'decommissioned-nodes' option in distribute volume, then just perform the rebalance set of operations (with 'force' flag set). now onwards, the 'remove-brick' (with 'start' option) operation tries to migrate data from removed bricks to existing bricks. 'remove-brick' also supports similar options as of replace-brick. * (no options) -> works as 'force', will have the current behavior of remove-brick, ie., no data-migration, volume changes. * start (starts remove-brick with data-migration/draining process, which takes care of migrating data and once complete, will commit the changes to volume file) * pause (stop data migration, but keep the volume file intact with extra options whatever is set) * abort (stop data-migration, and fall back to old configuration) * commit (if volume is stopped, commits the changes to volumefile) * force (stops the data-migration and commits the changes to volume file) Change-Id: I3952bcfbe604a0952e68b6accace7014d5e401d3 BUG: 1952 Reviewed-on: http://review.gluster.com/118 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* mgmt/glusterd: check the availability of fuse for few glusterd operationsKaushik BV2011-09-135-0/+76
| | | | | | | | | Change-Id: I410cc6a86c32637566e5498f69f46cb40322e7fb BUG: 2715 Reviewed-on: http://review.gluster.com/364 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* mgmt/glusterd: fail glusterd if gsyncd does not behave as expectedKaushik BV2011-09-131-10/+26
| | | | | | | | Change-Id: Ic54220328f15c579dcf441de2aad8620751a97ef BUG: 2744 Reviewed-on: http://review.gluster.com/331 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Csaba Henk <csaba@gluster.com>
* distribute rebalance: handle the open file migrationAmar Tumballi2011-09-1215-1654/+2906
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Complexity involved: To migrate a file with open fd, we have to notify the other client process which has the open fd, and make sure the write()s happening on that fd is properly synced to the migrated file. Once the migration is complete, the client process which has open-fd should get notified and it should start performing all the operations on the new subvolume, instead of earlier cached volume. How to solve the notification part: We can overload the 'postbuf' attribute in the _cbk() function to understand if a file is 'under-migration' or 'migration-complete' state. (This will be something similar to deciding whether a file is DHT-linkfile by its 'mode'). Overall change includes below mentioned major changes: 1. dht_linkfile is decided by only 2 factors (mode(01000), xattr(trusted.glusterfs.dht.linkto)), instead of earlier 3 factors (size==0) 2. in linkfile self-heal part (in 'dht_lookup_everywhere_cbk()'), don't delete a linkfile if there is a open-fd on it. It means, there may be a migration in progress. 3. if a file's revalidate fails with ENOENT, it may be due to file migration, and hence need a lookup_everywhere() 4. There will be 2 phases of file-migration. -> Phase 1: Migration in progress * The source data file will have SGID and STICKY bit set in its mode. * The source data file will have a 'linkto' xattr pointing the destination. * Destination file will have mode set to '01000', and 'linkto' xattr set to itself. -> Phase 2: File migration Complete * The source data file will have mode '01000', and will be 'truncated' to size 0. * The destination file will have inherited mode from the source. (without sgid and sticky bit) and its 'linkto' attribute will be removed. 4. Changes in distribute to work smoothly with a file which is in migration / got migrated. The 'fops' are divided into 3 categories, inode-read, inode-write and others. inode-read fops need to handle only 'phase 2' notification, where as, the inode-write fops need to handle both 'phase 1' and phase2. The inode-write operations will be done on source file, and if any of 'file-migration' procedures are detected in _cbk(), then the operations should be performed on the destination too. when a phase-2 is detected, then the inode-ctx itself should be changed to represent a new layout. With these changes, the open file migration will work smoothly with multiple clients. Change-Id: I512408463814e650f34c62ed009bf2101d016fd6 BUG: 3071 Reviewed-on: http://review.gluster.com/209 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* geo-rep: partial support for unprivileged gsyncd via mountbrokerCsaba Henk2011-09-125-46/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | gsyncd: - mounting code is split to a direct and a mountbroker based backend - option gluster-command gone - new options: gluster-params, gluster-cli-options, mountbroker - mountbroker mount backend is used if either a mountbroker label is given through the mountbroker option, or if gsyncd is unprivileged; in this case the username is used as label - have gluster cli invocations log to stderr so that we don't hit a permission issue with the logfiles glusterd: - do gsyncd pre-config with new options - add option geo-replication-log-group, so if that specified geo-rep logfile directories are given to that group (and thus members of the given group can do logging there) This is just WIP as geo-rep relies on trusted extended attributes and those are not accessible for unprivileged users. Even if we solved this issue, glusterd security settings are too coarse, so that if we made it possible for an unprivileged gsyncd to operate, we would open up too far. Change-Id: Icd520b58cbadccea3fad7c0f437b99de1e22db14 BUG: 2825 Reviewed-on: http://review.gluster.com/399 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd / cli: mount-broker serviceCsaba Henk2011-09-127-3/+1027
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mountbroker is configured in glusterd volfile through a DSL which is restriced enough to be able to appear in the role of the value of a volfile knob. Basically the DSL describes set-theorical requirements against the option set which is sent by the cli (in the hope of getting a mount with these options). If the requirements meet and the volume id and the uid who is to "own" the mount can be unambigously deduced from the given request, glusterd does the mount with the given parameters. The use case of geo-replication is sugared by means of volume options which then generate a complete mount-broker option set. Demo: - add the following option to your glusterd volfile: option mountbroker-root /tmp/mbr option mountbroker.fool EQL(volfile-id=pop*|user-map-root=*|volfile-server=localhost)&MEET(user-map-root=john|user-map-root=jane) - before starting glusterd, create /tmp/mbr owned by root with mode 0755 - with cli, do $ gluster system:: mount fool volfile-id=pop33 user-map-root=jane volfile-server=localhost - on succesful completion (volume pop33 exists and is started, jane is a valid username), the mount path will be echoed to you - you can get rid of the mount by $ gluster system:: umount <mount-path> Change-Id: I629cf64add0a45500d05becc3316f67cdb5b42ff BUG: 3482 Reviewed-on: http://review.gluster.com/128 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* add --user-map-root optionCsaba Henk2011-09-122-0/+15
| | | | | | | | | | | | | | | | | | This makes client fake that given user is a superuser, by changing FUSE requests coming with uid of user so that uid is set to 0. User can be given in numeric form, in which case it's treated as an uid directly, or else it's tried to be resolved to an uid with getpwnam(3). Implies --acl. Change-Id: I2d5a3d3e178be7ffdf22b46a56f33a7eeaaa7fe1 BUG: 3242 Reviewed-on: http://review.gluster.com/127 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* gsyncd: python3 compat fixesCsaba Henk2011-09-124-5/+36
| | | | | | | | | | | Also add __codecheck script which can verify if source is OK at the syntactical level with a given Python interpreter. Change-Id: Ieff34bcd3efd1cdc0e8f9a510c05488f35897bbe BUG: 1570 Reviewed-on: http://review.gluster.com/320 Reviewed-by: Kaushik BV <kaushikbv@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* glusterd: fix cleaning up of runner objectCsaba Henk2011-09-121-2/+1
| | | | | | | | | | | in lack of that, if geo-rep component is not installed, glusterd got a zombie child Change-Id: Ic4a2a4ffc943de68dd02db76a32b1618821ddf56 BUG: 2744 Reviewed-on: http://review.gluster.com/317 Reviewed-by: Kaushik BV <kaushikbv@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: free the allocated string to avoid memory leakRaghavendra Bhat2011-09-122-56/+24
| | | | | | | | Change-Id: I520abf3c57a15be8bb7dd1e92ad0b049ef5c8970 BUG: 3341 Reviewed-on: http://review.gluster.com/394 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* protocol/client: avoid code duplication in fd based operationsRaghavendra Bhat2011-09-112-340/+42
| | | | | | | | | Change-Id: I012f78bac8ba82333628c59ef51d5e5f43d05ac7 BUG: 3158 Reviewed-on: http://review.gluster.com/329 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* features/marker: unref the local incase of errors before unwindingRaghavendra Bhat2011-09-111-3/+5
| | | | | | | | Change-Id: I4dcad7ddf84bf98b4b7f4a0e407a418426674280 BUG: 2784 Reviewed-on: http://review.gluster.com/299 Reviewed-by: Vijay Bellur <vijay@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>