summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-snapshot.c
Commit message (Collapse)AuthorAgeFilesLines
* glusterd/snapshot: Addressed upstream review commentsHEADdevelopmentRajesh Joseph2014-04-071-180/+191
| | | | | | | | | | Code cleanup and review comments fixed. Change-Id: Ie51e3a2f995295632cb1db05bab8b38603ab9a0a Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/7399 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com>
* glusterd/snapshot : Fix for snap creation beyond effective snap-max-hard-limit.Sachin Pandit2014-04-041-3/+14
| | | | | | | | | | Change-Id: I679a1b01bb9d8a41fe463acf4406d896caf939c8 BUG: 1083879 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7396 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: code cleanup and fixes for review commentsVijaikumar M2014-04-041-127/+86
| | | | | | | | | Change-Id: I358c30b42e71e5e1ddaeb5a3954bdd590671839b Signed-off-by: Vijaikumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/7386 Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: Recording the snapshots missed in each brick.Avra Sengupta2014-04-021-34/+643
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Persisting missing snapshot info on disk as well as in memory in the following format: -------------NODE-UUID--------------:---------SNAP-UUID--------------=BRICKNUM:-------BRICKPATH--------:OPERATION:STATUS 927cb5fe-63da-48f5-82f6-e6a09ddc81c4:a17b4fe42c5a45f7a916438643edaa13= 3 :/brick/brick-dirs/brick3: 1 : 1 927cb5fe-63da-48f5-82f6-e6a09ddc81c4:a17b4fe42c5a45f7a916438643edaa13= 3 :/brick/brick-dirs/brick3: 3 : 1 927cb5fe-63da-48f5-82f6-e6a09ddc81c4:83a3cc05453b46b2a7eda4c9a9208638= 3 :/brick/brick-dirs/brick3: 1 : 1 This data will be stored on disk at /var/lib/glusterd/snaps/missed_snaps_list In memory we maintain the data as a list of glusterd_missed_snap_info in conf, the key for this list are the first two fields, i.e NODE-UUID:SNAP-UUID. For every NODE-UUID:SNAP-UUID, there can be multiple operations missed on multiple bricks. So we maintain a list of glusterd_snap_op_t for evert node of glusterd_missed_snap_info This list is maintained or updated during snapshot create, delete, and restore operations which are the only operations that if missed, are recorded in this list. During snapshot create, if a node is down, or a brick is down, we don't receive their mount point infos. snap_status of such bricks is marked as -1, and their brick details are added to this list. During snapshot delete, we check from originator node, if any other nodes, holding bricks of the said snap are down. Those are also added to the list. Also if the node is up, but the snapshot was pending for a snap brick, and its snap_status is -1, we add that to the list too. When a subsequent delete entry is processed for an already existing create entry, we just mark the create entries status as done (2), and don't add the delete entry to the list. During snapshot restore, we check from originator node, if any other nodes, holding bricks of the said snap are down. Those are also added to the list. Also if the node is up, but the snapshot was pending for a snap brick, and its snap_status is -1, we add that to the list too. Change-Id: I22578d14f81a54e13f6832966b70cd4cfdfd5b44 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7208 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: Making snap operations crash consistentAvra Sengupta2014-04-021-26/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the events of a volume's brick being down, or a node being down, making snap ops like create, delete, restore, and status crash consistent. Marking snap status of snap bricks which were not snapshotted because the volume brick was down as -1, and not starting those snap bricks till the snapshot is taken. During delete bypassing lvm snapshot remove for snap bricks whose snap status is -1 During restore bypass replacing xattrs on the snapshot bricks whose snap status is -1. Also bumping restored volume's version so as to handle nodes being down. On handshake of a restored volume, passing brick's snap_status as well. During snapshot status of the non-snapshotted brick details display "N/A". If a node is down, the entry itself will not be displayed. Change-Id: Id042efd7507829995270da0b2b2a6282a08a053d Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7241 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: Storing dynamic strings in dictAvra Sengupta2014-04-021-4/+30
| | | | | | | | | | | | | | Taking a duplicate of a string and storing it as a dynamic string in the dictionary, so that it is independent of the source string. Change-Id: Ib7d18ab8e7342fd71dad80d03259f76a5d2bd66d BUG: 1077196 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7381 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: Using original brickinfo for snap brick pathAvra Sengupta2014-04-021-161/+247
| | | | | | | | | | | | | Using /var/run/gluster/snaps/<snap-uuid>/ <original brick number>/<original brick's mount dir> as the snapshot brick path Change-Id: Icdd838512e662ed687662188bd197ed1a889fbea Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7231 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* Review CommentsAvra Sengupta2014-03-271-1/+1
| | | | | | | | Change-Id: Ifce90b0b617bc0b43a9af0bd692a7290820ac62c Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7358 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot : remove snap_volume variable from struct glusterd_snap_Vijaikumar M2014-03-251-34/+51
| | | | | | | | Change-Id: I3c5eae3f199d97a2fe70599e2cdb4c357d20f20d Signed-off-by: Vijaikumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/7197 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* snapshot/config : snapshot config changes.Sachin Pandit2014-03-251-89/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Syntax : gluster snapshot config [volname] [snap-max-hard-limit <value>] [snap-max-soft-limit <value>] 1)If volume name is not specified, then the value is set system wide. 2)If volume name is specified, then the value is set to that particular volume. *NOTE : snap-max-soft-limit cannot be specified to individual volumes. case 1) When system limit is greater than volume limit. Sample output : Snapshot System Configuration: snap-max-hard-limit : 200 snap-max-soft-limit : 50% Snapshot Volume Configuration: Volume : vol2 snap-max-hard-limit : 100 Effective snap-max-hard-limit : 100 Effective snap-max-soft-limit : 50 (50%) Volume : vol1 snap-max-hard-limit : 150 Effective snap-max-hard-limit : 150 Effective snap-max-soft-limit : 75 (50%) case 2) When system limit is lesser than volume limit. Sample output : Snapshot System Configuration: snap-max-hard-limit : 50 snap-max-soft-limit : 50% Snapshot Volume Configuration: Volume : vol2 snap-max-hard-limit : 100 Effective snap-max-hard-limit : 50 Effective snap-max-soft-limit : 25 (50%) Volume : vol1 snap-max-hard-limit : 150 Effective snap-max-hard-limit : 50 Effective snap-max-soft-limit : 25 (50%) Change-Id: I97b5daefec7205bb9ab7b5b51d38f504cc5ee940 BUG: 1075034 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7303 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* snapshot: cleanup unwanted CG-codeVijaikumar M2014-03-251-352/+10
| | | | | | | | | Change-Id: Id3da2a7aac84027aeff050f6dd9a3484719362bc BUG: 1073780 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/7204 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: populate the snapshot volume list in the order when the ↵Vijaikumar M2014-03-251-2/+3
| | | | | | | | | | | | | | glusterd is restarted We are storing the snapshot objects in the order. We need to do the same for snapshot volumes Change-Id: Iea9594632e52d069f167cc8a840c78d0f7109947 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/7307 Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: Correct the error message when the snapshot name isVijaikumar M2014-03-251-1/+1
| | | | | | | | | | | | more than 255 characters Change-Id: Iaab6889a86ab39fa73eebf30dc08af98d5a774bc BUG: 1078166 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/7296 Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* mgmt/glusterd: do cleanup of snapshots in post-validate phase if half bakedRaghavendra Bhat2014-03-241-1/+146
| | | | | | | | | | objects are there Change-Id: I372cac98ad054cdc1a6fbc7f6c77c25981063b2f Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/7237 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* snapshot restore: Fix error message while volume started.Joseph Fernandes2014-03-241-1/+3
| | | | | | | | | | | | | | Repharse of snap restore failure message when volume is started. Change-Id: Ie3e47856f60ff5d395fca1308cea9a5350a861f3 BUG: 1063775 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/7295 Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* snapshot : Fix for snapshot info ambiguous output.Sachin Pandit2014-03-131-2/+10
| | | | | | | | | Change-Id: I27e50921a2e030ae50b1fd28ee7ab0be65b313fd BUG: 1075454 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7228 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: Validate snapshot name length while creationVijaikumar M2014-03-131-0/+7
| | | | | | | | Change-Id: Iaee04f5209e278d83c086e32c4cafd6c571370cd Signed-off-by: Vijaikumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/7242 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* snapshot : Output correction in snapshot info and create.Sachin Pandit2014-03-131-1/+1
| | | | | | | | | | Change-Id: Ic468e2e64bdfc0f7d79453524a1b2ebc9b445906 BUG: 1075446 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7225 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* feature/snapshot : Snapshot status.Sachin Pandit2014-03-131-7/+905
| | | | | | | | | | | | | | | | | | | | Snapshot status command is used to display the status of available snapshot. The status command will display the Brick path, Volume Group, Brick pid, Whether brick is online, Percentage of data filled, Logical Volume size. The syntax for using snapshot status is : gluster snapshot status [(snapname | volume <volname>)] Change-Id: I621911c305e20ca83d958ff1f8762bef1f2f12f0 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7134 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot : Show volume status in snap info.Sachin Pandit2014-03-101-0/+6
| | | | | | | | | Change-Id: Ifa090b158ca23402fb6afa4f3b65fad1446f350d Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7212 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot : Introduced a macro for snapshot info command.Sachin Pandit2014-03-101-46/+81
| | | | | | | | | | | | | Also populated the error message in case of snapshot create, list, info and delete failure. When snapshot list, info or delete is issued, if the entered snapname/volname does not exist then populate error string along with logging. Change-Id: I632d25110bc63ff0e4ac98b27e2f410f7ccbb990 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7203 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* snapshot/restore : Snapshot restore changes.Sachin Pandit2014-03-101-159/+97
| | | | | | | | | | | | | | | | This Patch includes cli change and few backend changes. Syntax : gluster snapshot restore <snap-name> ** Also removed unwanted snapshot remove parsing code. Change-Id: Ie32590ccd4080da9409fd16c543866c14fae28f5 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7191 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: Modified restore backendRajesh Joseph2014-03-101-13/+25
| | | | | | | | | | | | | | Now instead of creating volume store files first we constructing the in-memory volinfo first and then generate the backend store files. This gives lot of flexibility in restore operation. This patch also fixes the read-only issue with restored snaps. Change-Id: I51032228a5212fc3b90dc6e93f3539af3eb36074 BUG: 1064688 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/7209 Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
* glusterd/mgmt_v3 locks: Using snaps as an entity for mgmt_v3 locks.Avra Sengupta2014-03-071-1/+1
| | | | | | | | | | | | Created framework to process single volume lock, single snap lock, multiple volume locks, multiple snap locks, and multiple snap and volume locks requests. Change-Id: I3f87bdec0bf142d6a1fd3f9d9f5012cc44eaf4bd Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7189 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/mgmt_v3 locks: Generalization of the volume wide locks.Avra Sengupta2014-03-071-2/+2
| | | | | | | | | | Renaming volume locks as mgmt_v3 locks Change-Id: I2a324e2b8e1772d7b165fe96ce8ba5b902c2ed9a Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7187 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* gluster/snapshot: Create missing backend snapshot folderRajesh Joseph2014-03-071-2/+4
| | | | | | | | | | | | | | | | Snapshot volume bricks are mounted under /var/run/gluster/snaps folder. In the latest machines /var/run is a symbolic link to /run folder. In such cases if we use /var/run then there would be mismatch between mtab entry for the mount and the folder where we actually mount. Therefore this patch will get the correct folder and also create it if the folder is missing. Change-Id: I267aa7f3e171b486c5b3bb2a9f88cbd4be0e47ea BUG: 1072253 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/7140
* glusterd/snapshot: snapshot list and info changesVijaikumar M2014-03-061-776/+423
| | | | | | | | | | | | This changes includes snap-driven based list and info changes: Change-Id: Ie82a2a3c785baa36892ca0cd97a958a2ae819d4c Signed-off-by: Vijaikumar M <vmallika@redhat.com> Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7139 Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: Snapshot create and delete changesVijaikumar M2014-03-061-1095/+649
| | | | | | | | | | | | | | | | | | | With the snap driven approach, While creating the snapshot, We have to mention the snap-name first and then the volumes to be associated with that. Corresponding changes has been made in glusterd. While deleting the snapshot, we have to mention only the snapname. Corresponding changes has been made in glusterd. CLI changes for the same can be found here: http://review.gluster.org/#/c/6947/ Change-Id: I8bd8f471da5b728165da5f331faad3dde3486823 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/7123 Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: store location for snap driven changesVijaikumar M2014-03-031-225/+168
| | | | | | | | | | | | | | | | Currently snapshot volfiles are stored at: <workdir>/vols/<volname>/snaps/<snapvol> With snap driven approach we need to store the volfiles at: <workdir>/snaps/<snapname>/<snapvol> Change-Id: I8efdd5db29833b2b06b64a900cbb4c9b9a5d36b6 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7006 Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* Snapshot: snap-max-limit implementedJoseph Fernandes2014-02-181-59/+95
| | | | | | | | | | | | | Added the check on snap-max-limit in snapshot_create_prevalidate. Now snapshot creation will fail if snap count reaches max limit. Change-Id: I5b1cf8441f02c32085d2f6f5fd8902cb61031af5 BUG: 1049834 Author: Joseph Fernandes <josferna@redhat.com> Signed-off-by: Joseph Fernandes <josferna@redhat.com> Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/6981 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
* glusterd/snapshot: Use snap uuid to create lvm snapshotVijaikumar M2014-02-131-63/+91
| | | | | | | | | | | | Using snap uuid to create lvm snapshot will solve the problem of having '-' in the snap name or snap name is too long. Change-Id: If204f02a8f5de599fb409d06c7893ef3542a6300 BUG: 1045333 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/6709 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: Running lvcreate --help to check if setactivationskip is ↵Avra Sengupta2014-02-051-17/+50
| | | | | | | | | | | | | | supported To check if setactivationskip is supported or not, we run lvcreate --help and look for the setactivationskip flag, and accordingly issue lvcreate with or without the said flag. Change-Id: Ief349674ea3f7ceff6b7051b1a5104257e547ce2 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/6776 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot : snapshot delete - check if process is killed before ↵Sachin Pandit2014-02-041-0/+14
| | | | | | | | | | | | | unmounting. Change-Id: Idf0cf63429212142795e1aeb4fd4962b51620426 BUG: 1049353 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/6772 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* mgmt/glusterd: perform store on only newly created snapshotRaghavendra Bhat2014-02-021-1/+1
| | | | | | | | | | | | | | | * Instead performing store on all the snaps of the volume when a new snap is created, store only the new snap's info. Otherwise with more and more snapshots in the volume, time creation for new snapshot becomes very large as glusterd has to store all the snapshots related info everytime (that too by doing fsyncs) Change-Id: I0e005d1d4c044b07a8abde8e6ba55e66a1bbd590 BUG: 1059146 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/6841 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: Move out code from prevalidate functionVijaikumar M2014-01-211-156/+225
| | | | | | | | Move the code part that need to executed at the origin glusterd to a seperate function. Change-Id: Ieb53fbd4fb12e3e4d5087db306be37616657ee04 Signed-off-by: Vijaikumar M <vmallika@redhat.com>
* mgmt/glusterd : Having a separate list for snapshots.Sachin Pandit2014-01-151-1/+1
| | | | | | | | | Creating a separate list for snaps taken, as cluttering snaps in the volume list does not look neat. Change-Id: Ida4a183e95e8694b85ebb5a680d06b7d29a460a0 BUG: 1040947 Signed-off-by: Sachin Pandit <spandit@redhat.com>
* Merge "glusterd: Keeping snapshot delete error messages consistent with that ↵Rajesh Joseph2014-01-151-7/+8
|\ | | | | | | of vol delete." into development
| * glusterd: Keeping snapshot delete error messages consistent with that of vol ↵Avra Sengupta2014-01-151-7/+8
| | | | | | | | | | | | | | delete. Change-Id: I5056c0e46015278bd8d0c39307e4671fd4259961 Signed-off-by: Avra Sengupta <asengupt@redhat.com>
* | Snapshot: Gluster snapshot restore featureRajesh Joseph2014-01-151-138/+33
|/ | | | | | | | | | | Implemented gluster snapshot restore feature. The restore is done by replacing the origin volume with the snap volume. TODO: After the restore the snapshot volume should be deleted. As of now the deletion work is pending. Change-Id: Ib137fb6bb84a74030607ffa47f89cd705dc7e1ff Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot : Making CG Name persistent and handle Snap Description Issue.Sachin Pandit2014-01-131-7/+25
| | | | | | | | | | | | | | | | | 1)Write the CG Name in the "snap_list.info" file, so that CG Name is not lost when we restart the glusterd. 2)Fixes the issue where Description given for CG, as a part of create command, was getting stored as snap description rather than CG Description. 3)Fixes the problem with glusterd restart when we have multiple words in Snap Descripition Change-Id: I3129c53d1ec54dd170ca1300583f278f58c4e0e2 BUG: 1044476 Signed-off-by: Sachin Pandit <spandit@redhat.com>
* glusterd: Pass generated snap-name/cg-name to cli.Avra Sengupta2014-01-091-0/+27
| | | | | | | | Also block operation on response aggregation errors. Change-Id: I641ddc98d986fd44627d790ab84488a6b849f807 BUG: 1043792 Signed-off-by: Avra Sengupta <asengupt@redhat.com>
* glusterd/snapshot: Defining snap-max-soft-limit as a percentage of ↵Avra Sengupta2014-01-071-106/+214
| | | | | | | | | | | | | snap-max-hard-limit. This patch also prohibits configuration of snap-max-hard-limit and snap-max-soft-limit for snap volumes. Also displaying the snapshot configs by reading data only from local node, as all config data will be in sync across the cluster. Change-Id: I635b925c02ed5b108cd10c7193b154ad82d5afad BUG: 1043792 Signed-off-by: Avra Sengupta <asengupt@redhat.com>
* glusterd/snapshot: Introducing snap-max-hard-limit and snap-max-soft-limitAvra Sengupta2014-01-061-201/+255
| | | | | | | | | Note: Manually adding this patch again as this patch got missed in git reset option done on remote development branch Change-Id: I9e81c5ec003c1e1722d0fcb27dd87c365ee43ff4 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot : Fix for CG ID and Name not getting displayed.Sachin Pandit2014-01-061-6/+28
| | | | | | | | | | | | | CG ID was not getting initiated during snapshot create, hence there was problem in listing the CG ID and CG Name. Note: Manually adding this patch again as this patch got missed in git reset option done on remote development branch Change-Id: I81951b42292912c98bab5964fc732b630ff66d14 BUG: 1040435 Signed-off-by: Sachin Pandit <spandit@redhat.com> Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot : Making snap uuid same across different nodes.Sachin Pandit2014-01-061-3/+1
| | | | | | | | | | | | | | Till now we were generation a new uuid for a snap, that uuid was brick id, so the snap uuid was different for different nodes. Now we are copying the snap volume id to snap uuid so that it is unique across nodes. Note: Manually adding this patch again as this patch got missed in git reset option done on remote development branch Change-Id: Icb80caca9672b82de1b2129af47540c651a034ec Signed-off-by: Sachin Pandit <spandit@redhat.com> Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
* glusterd/snapshot: Fix for cksum mismatches at snap create.Avra Sengupta2013-12-171-9/+77
| | | | | | | Also fixes peer rejects on glusterd restart Change-Id: I1671416c1f3fd2afea450cc3b4c632de187351ca Signed-off-by: Avra Sengupta <asengupt@redhat.com>
* cli/glusterd: implement the snap and cg delete functionalitiesRaghavendra Bhat2013-12-121-59/+755
| | | | | Change-Id: Icdb66c89acdd043d0d6368c48ce2e01b1a40966f Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* mgmt/glusterd: snapshot related cleanupRaghavendra Bhat2013-12-121-22/+35
| | | | | Change-Id: I277a70f732666d047ba5dff7a7e6925e0679741b Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
* glusterd/snapshot: Fix Displaying Port, Online Status and Pid for snap vols ↵Avra Sengupta2013-12-101-1/+4
| | | | | | | | | | | in volume status Added a parent_volname member in glusterd_volinfo_ structure to help point the snap vol to the parent volname. Using this to fetch the pidfile location during volume status. Change-Id: I30a16646561394d0f7d16f66abff14c425f31f06 Signed-off-by: Avra Sengupta <asengupt@redhat.com>
* glusterd/snapshot: Fixes for cg name space collisionsAvra Sengupta2013-12-031-18/+11
| | | | | Change-Id: I6137ecb0dbbd37af81433c415568dfede1d740a6 Signed-off-by: Avra Sengupta <asengupt@redhat.com>