summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
Commit message (Collapse)AuthorAgeFilesLines
* glusterd: Set errstr for duplicate add-brickKaushal M2012-08-011-0/+3
| | | | | | | | | | | Sets op_errstr when add-brick is given a duplicate brick. BUG: 832293 Change-Id: I2d6d13b2ca29615678902b56e6b394ea05f37923 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.com/3585 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd: Fixed glusterd_brick_create_path algo.Krishnan Parthasarathi2012-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | - check if any prefix of the brick path has "trusted.gfid" or "trusted.glusterfs.volume-id" set. - set trusted.glusterfs.volume-id on the bricks as soon as its induction into the volume is settled. Earlier, the setting of "volume-id" used to happen during the first run of the brick process, leaving of window for bricks part of one volume to be (ab)used by another volume inadvertently. - removed creation of brick directory (if missing), during start volume force. This is to avoid directory creation as part 'force'ful starting of volume and leave the responsibility with the user, who understands the 'availability' of the export directory (brick) better. Change-Id: I4237ec4ea7a4e38a7501027e7de7112edd67de8c BUG: 812214 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/3280 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com> Reviewed-on: http://review.gluster.com/3313
* glusterd: remove-brick: add more error handlingAmar Tumballi2012-05-081-14/+25
| | | | | | | | | | | | | | with this, we can make sure, all wrong patterns in CLI can be reported with proper message back to user, instead of resulting in an wrong volume type. Change-Id: Ib461956dd7d51f7f81c19c27112d44c2adb3a66d Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 803711 Reviewed-on: http://review.gluster.com/3278 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd (remove-brick): fix data-loss issueAmar Tumballi2012-04-181-1/+1
| | | | | | | | | | | | | | | | | * when more than one brick (more than one distribute subvolume) was removed using single command, rebalance process used to get started only on one node, causing data-loss when 'commit' was done, because the brick's data was not migrated at all. Fixed the logic of validating rebalance required in remove- brick case. Change-Id: I3a90ff9f9593e5215110a3a0974bb97e7271f910 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 812770 Reviewed-on: http://review.gluster.com/3173 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Shishir Gowda <shishirng@gluster.com>
* glusterd/remove-brick: Replace ABORT with STOPshishir gowda2012-04-131-16/+3
| | | | | | | | | | | | | | Remove-brick stop now invokes rebalance stop. This leads to a graceful stop of decommissioning. The volfile is also updated (removal of decommission) Change-Id: I5a8f725c0f54439b810ce32d988c21c02229c703 BUG: 811513 Signed-off-by: shishir gowda <shishirng@gluster.com> Reviewed-on: http://review.gluster.com/3126 Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd/remove-brick: Remove support for pause optionshishir gowda2012-04-131-18/+0
| | | | | | | | | | | Decommissioning through rebalance has no pause option. Change-Id: I90f165cdb2eccfaefc99365ae4b48d81320fb753 BUG: 811459 Signed-off-by: shishir gowda <shishirng@gluster.com> Reviewed-on: http://review.gluster.com/3123 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com>
* glusterd: Added volume-id to 'op' dictionaryKrishnan Parthasarathi2012-04-121-0/+8
| | | | | | | | | | | | | | | | | | | | Volume-id passed in op dictionary would help detect possible split brains among peers in a cluster. The idea is to check if the volume's id and the vol-id that was passed are equal. ie, same volume name, but different volume id indicate that glusterd 'metadata' of one of the participating peers is stale or there is a split brain. This is over and above the existing checksum based validation of peer supplied cluster 'metadata' (ie, volume info file). Change-Id: I1049ef249e417e540ccb4243e450f92fcd0f46f9 BUG: 797734 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/3083 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* remove-brick: Abort should revert volume changesshishir gowda2012-04-061-9/+18
| | | | | | | | | | | Also, enhanced gluster cli output. Signed-off-by: shishir gowda <shishirng@gluster.com> Change-Id: I520ccfb63b3568a2e6654d8a5fbf265b9b903af1 BUG: 788524 Reviewed-on: http://review.gluster.com/3082 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: remove-brick validation behavior fixAmar Tumballi2012-03-311-14/+37
| | | | | | | | | | | | | | earlier one of the major validation case was missed if user provided a 'replica N' option for remove-brick where N is already existing replica count of the volume. This would have left the volume in inconsistent state, eventually crashing glusterd. Now fixed. Change-Id: I418f3bbb983d36aa51214c616a887e5a3ee98e74 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 803711 Reviewed-on: http://review.gluster.com/3050 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: add-brick: give proper reason in few error casesAmar Tumballi2012-03-291-0/+19
| | | | | | | | | | | | | had missed few 'else' cases, which were needed to send the right error message to the user regarding the reason for failure. Change-Id: I42d92782f4dec6f6bdffd42df254b7f38a715e36 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 772544 Reviewed-on: http://review.gluster.com/3032 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: bring back the 'non-synctask' behaviorAmar Tumballi2012-03-221-1/+1
| | | | | | | | | | | revert back to non synctask behavior Change-Id: Icfc9cbdeaf8dd6735df8366a6121c6598c56fade Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 805802 Reviewed-on: http://review.gluster.com/3002 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: bring in feature to use syncop for mgmt opsAmar Tumballi2012-03-211-3/+1
| | | | | | | | | | | | | | | | * 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>
* cluster/dht: Rebalance will be a new glusterfs processshishirng2012-02-191-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* glusterd: Fail volume 'modify' operations when rb is ongoingKrishnan Parthasarathi2012-02-141-11/+20
| | | | | | | | | | | | | | | * add-brick, stop-volume, remove-brick are the operations that are explicitly 'failed' when attempted while replace-brick is in progress. * we attach the volume-id to the dst_brick volfile ensuring that the replace-brick operation holds 'claim' on it. Change-Id: If60b2af566ca940b2add600b473c99730e06ab47 BUG: 765470 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/2740 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: Improved err msgs for add_brickKrishnan Parthasarathi2012-02-031-11/+27
| | | | | | | | | Change-Id: I4b97d7e26b8c81ed52657467981be0c4adc291ae BUG: 772145 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/2589 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* glusterd: prevent adding bricks already in useRajesh Amaravathi2012-01-121-19/+20
| | | | | | | | | | | | | | | The add-brick command now checks if the brick provided for add-brick is used in any volumes, even if the volume was never started by looping through the brick lists of all volumes. Change-Id: I15035d41d91386448a3e3d4063d909b880288681 BUG: 771831 Signed-off-by: Rajesh Amaravathi <rajesh@redhat.com> Reviewed-on: http://review.gluster.com/2607 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* glusterd: Fixed add-brick error message.Krishnan Parthasarathi2012-01-051-2/+2
| | | | | | | | | Change-Id: I9260d5a0203ae2990d37b30bcc7c94c81c1e168e BUG: 770678 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/2581 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* glusterd: Added checks for remove-brick handler.Krishnan Parthasarathi2012-01-041-0/+11
| | | | | | | | | | | | | Removing bricks in a plain stripe-replicate is failed if replica count is not reduced explicitly. Change-Id: I6d0de4862595744d1d1998b9a287c34c53d7fe5f BUG: 770561 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/2577 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: Fixed add-brick handler algorithm.Krishnan Parthasarathi2012-01-021-0/+13
| | | | | | | | | | | | | | In the fix for 765774, setting the op dictionary with modified stripe and replica count was (accidentally) removed affecting the correctness. The stage and op functions of add-brick rely on the fact that stripe/replica count are zero if there is no change in them during the add-brick operation. Change-Id: I55a23878e618b355009ffd0fce8c4904dbb70691 BUG: 770914 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/2548 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: Fixed spurious checks in add_brick.v3.3.0qa17Krishnan Parthasarathi2011-12-191-91/+2
| | | | | | | | | | | | | | | Previous algo, - didn't allow volume type change from plain distribute to distribute-[stripe][-][replicate]. - performed 'add-brick' on temporary volinfo without correct initialisations. This was superflous. Change-Id: If5d5d78e59bd04685df9c27974f715df5f0b43f3 BUG: 765774 Signed-off-by: Krishnan Parthasarathi <kp@gluster.com> Reviewed-on: http://review.gluster.com/804 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* XDR: cli-glusterd xdr consolidationshishir gowda2011-11-161-32/+34
| | | | | | | | | | | | | | | | By using only 1 xdr struct for request and 1 xdr struct for response, we will be able scale better and also be able to parse the o/p better For request use- gf1_cli_req - contains dict For response use- gf1_cli_rsp - conains op_ret, op_errno, op_errstr, dict Change-Id: I94b034e1d8fa82dfd0cf96e7602d4039bc43fef3 BUG: 3720 Reviewed-on: http://review.gluster.com/662 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
* changing of the volume types after volume is created.Amar Tumballi2011-10-281-48/+524
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | with this patch, one can do all the below operations: on a simple distribute volume 'test' with bricks A,B, add bricks C and D: bash# gluster volume add-brick test replica 2 C D now the volume 'test' becomes distribute-replicate, with pairs A-C, B-D. same holds good for stripe. and now, one can change the replica count 2 on volume 'test' to 4 like below: bash# gluster volume add-brick test replica 4 E F G H now, volume has 'replica' count 4, with pairs being 'A-C-E-F' and 'B-D-G-H'. after this, if user wants to reduce the replica count, he can do bash# gluster volume remove-brick test replica 3 C H # (one from each pair) This should work to reduce the replica count Change-Id: I4f109141a9ba7be4a92a5f5810a4163baeb92973 BUG: 3305 Reviewed-on: http://review.gluster.com/158 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: take off 'auto-commit' behavior of decommissioningAmar Tumballi2011-10-111-6/+18
| | | | | | | | | | | | | | | | | | | currently if 'remove-brick <BRICKS> start' is given, after all the data is migrated, in the _cbk() function from rebalance complete we used to re-write the volume file without the bricks. But the flaw of this method is that, currently the _cbk() function is called on only the node on which rebalance actually happens, hence other nodes are not aware of this behavior. So, had to remove the 'auto-commit', instead we want the user to issue a command 'remove-brick <Bricks> commit' (or 'force') explicitely to remove the bricks Change-Id: Ifdac1292095029429da502aa6e4c0cf4ee124990 BUG: 1952 Reviewed-on: http://review.gluster.com/551 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Shishir Gowda <shishirng@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
* glusterd: allow non-related directories with same prefixRajesh Amaravathi2011-09-291-1/+1
| | | | | | | | | | | | | | Earlier, using two directories with names like /test and /test1 failed volume creation. This patch sees that the next character is checked to be '/' to conclude that they are recursive. Eg: /test and /test2 succeed, while /test and /test/alpha does not. Change-Id: Idee1e15b7e0a0d0965d1aea910b52f1da286d64b BUG: 3645 Reviewed-on: http://review.gluster.com/511 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Krishnan Parthasarathi <kp@gluster.com>
* glusted: while doing add-brick, handle distribute volume separatelyAmar Tumballi2011-09-271-3/+3
| | | | | | | | | | | so the logic of different type of counts etc won't come into action, which would fail the add-brick operation. Change-Id: I5c8769d6d1c2433ffb084e5dce9c1e01678cff40 BUG: 3630 Reviewed-on: http://review.gluster.com/505 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kp@gluster.com>
* glusterd: cleanup of volinfo '*_count' definitionsv3.3.0qa11Amar Tumballi2011-09-231-58/+65
| | | | | | | | | | | | | | | | | earlier, sub_count was having different meaning depending on the volume type. now, for replica and stripe count, one can directly access the 'replica_count' or 'stripe_count' to get the corresponding value from the volume info. 'sub_count' is preserved as is for backward compatibility. there is a new variable 'dist_leaf_count' to get info about how many bricks are present in one distribute sub volume. Change-Id: I5ea1c8f9ae08f584cca63b91ba69035c7e4350ca BUG: 3158 Reviewed-on: http://review.gluster.com/435 Reviewed-by: Krishnan Parthasarathi <kp@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* glusterd/top: volume top succeeds on partial brickpathRajesh Amaravathi2011-09-191-5/+11
| | | | | | | | | | | | | | 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>
* Proactive self heal process implementationPranith Kumar K2011-09-141-2/+2
| | | | | | | | 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>
* glusterd rebalance: fix minor issuesAmar Tumballi2011-09-131-11/+20
| | | | | | | | | | | | | | | 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-131-73/+296
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Eliminate many "var set but not used" warnings with newer gcc.Jeff Darcy2011-09-071-9/+0
| | | | | | | | | | | | | | | | This fixes ~200 such warnings, but leaves three categories untouched. (1) Rpcgen code. (2) Macros which set variables in the outer (calling function) scope. (3) Variables which are set via function calls which may have side effects. Change-Id: I6554555f78ed26134251504b038da7e94adacbcd BUG: 2550 Reviewed-on: http://review.gluster.com/371 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* modify to the way we used XDR definitions files (.x files)Amar Tumballi2011-09-071-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | Earlier: step 1: copy the existing <xdr>.x files to /tmp step 2: generate '.[ch]' files using 'rpcgen <xdr>.x' step 3: check diff with the to the existing files, add only your part of changes back to the original file. (ignore other changes). step 4: there is another file to write wrapper functions to convert structures to/from XDR buffers, update it with your new structure. step 5: use these wrapper functions in the newly written procedures. step 6: commit :-| Now: step 1: update (mostly adding only) the <xdr>.x file step 2: run '<path-to-src>/extras/generate-xdr-files.sh <xdr>.x' command step 3: implement rpc procedure to handle the request/response. step 4: commit :-) Change-Id: I219f9159fc980438c86e847c6b030be96e595ea2 BUG: 3488 Reviewed-on: http://review.gluster.com/341 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
* mgmt/glusterd: code re-structuringAmar Tumballi2011-09-051-0/+920
created new files per operations, (or group of operations) Change-Id: Iccb2a6a0cd9661bf940118344b2f7f723e23ab8b BUG: 3158 Reviewed-on: http://review.gluster.com/281 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>