summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* barrier : fsync call over NFS should be barriered when barrier is enabledAtin Mukherjee2014-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | barrier_fsync was not getting hit when fsync call is issued from the application over NFS mount. Investigation reveals that NFS doesn't send an explicit fsync call to the glusterfs server, however NFS converts it with a stable write with O_DSYNC flag, so for a fsync call over NFS mount point, barrier feature always needs to check for writev and its correspoding flags. So to meet all the coditions of write with O_SYNC and fsync getting blocked when barrier is enabled the check has been modified with following: if (!((flags | fd->flags) & (O_SYNC | O_DSYNC))) Point to be noted here is we need to check both fd's flag and the explicit flag as for NFS write fd->flags is 0. Bug ID : 1091902 Change-Id: Ifd5377fca2cc93bb72158dd525b2aab8b4164ca8 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/7633 Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* barrier : barrier O_SYNC write incorrect flag checkAtin Mukherjee2014-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | barrier_writev function was doing the following check to determine whether its a O_SYNC write or not: if (!(flags & O_SYNC)) The problem here is this flag is not fd's flag and gfapi write does not copy open call fd's flag into write flag because of which O_SYNC writes were not getting barriered even if barrier was enabled. The check has been modified as: if (!(fd->flags & (O_SYNC | O_DSYNC))) Change-Id: I07b23852d150b81c7317100ca6d22d082ad897cd BUG: 1090488 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/7549 Reviewed-by: Varun Shastry <vshastry@redhat.com> Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cli/hooks : Add volume set options to enable/disable nfs-ganesha support.Meghana M2014-05-0313-3/+356
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. gluster volume set nfs-ganesha.enable ON/OFF If the option is set to ON, the volume field in the nfs-ganesha configuartion file is edited. Gluster-nfs is disabled on that volume and the volume is exported using nfs-ganesha. 2.gluster volume set nfs-ganesha.host IP This is used to provide the IP of the nfs-ganesha host. Note : nfs-ganesha.host MUST be set before using nfs-ganesha.enable ON The switch from gluster-nfs to nfs-ganesha is mostly done by the hook-scripts in the post phase of the 'set' option. As a result, gluster volume reset does not function as it is expected to. By default, nfs-ganesha will be set to off but the process will not be killed. Hence, a few changes have to be made post 'reset' option as well. Those changes also have been added. Change-Id: I7fdc14ee49d1724af96eda33c6a3ec08b1020788 BUG: 1092283 Signed-off-by: Meghana <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/7321 Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd/snapshot: Restore cleanupRajesh Joseph2014-05-026-29/+518
| | | | | | | | | | | | | | | If restores fails for some reason then we should revert the restore operation. To do so we take the backup of vols folder before doing a restore and if the restore fails then we revert the changes done. Change-Id: I97f72aec3a34fc122bf137beb336e94db3a04dff BUG: 1061685 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/7548 Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* extras/hookscripts: Remove %P from smb share path value.Raghavendra Talur2014-05-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | We had added %P in the value for path in smb share definitions to avoid ctdb errors. However, %P does not work well for windows clients and they fail to access the share. Solution for the original problem: The error messages were being generated by a monitoring script that ctdb runs. The script reads the path value from testparm and tests if it exists in the local machine. This particular check does not hold valid for virtual file system backends like gluster. There is no harm in asking ctdb to not to check the existence of such backend and can be done by setting the following config in ctdb.conf: CTDB_SAMBA_SKIP_SHARE_CHECK=YES. Change-Id: I91627c8a279126a5cc24c6347847f9bfbad53dd5 BUG: 1068776 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/7598 Reviewed-by: Jose A. Rivera <jarrpa@redhat.com> Reviewed-by: Poornima G <pgurusid@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
* storage/posix: do not dereference gfid symlinks before ↵Xavier Hernandez2014-05-023-8/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | posix_handle_mkdir_hashes() Whenever a new directory is created, its corresponding gfid file must also be created. This was done first calling MAKE_HANDLE_PATH() to get the path of the gfid file, then calling posix_handle_mkdir_hashes() to create the parent directories of the gfid, and finally creating the soft-link. In normal circumstances, the gfid we want to create won't exist and MAKE_HANDLE_PATH() will return a simple path to the new gfid. However if the volume is damaged and a self-heal is running, it is possible that we try to create an already existing gfid. In this case, MAKE_HANDLE_PATH() will return a path to the directory instead of the path to the gfid. To solve this problem, every time a path to a gfid is needed, a call to MAKE_HANDLE_ABSPATH() is made instead of the call to MAKE_HANDLE_PATH(). Change-Id: Ic319cc38c170434db8e86e2f89f0b8c28c0d611a BUG: 859581 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/5075 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd: Differentiate rebalance status and remove-brick status messagesggarg2014-05-024-1/+59
| | | | | | | | | | | | | | | | | | | | | | | | | previously when user triggred 'gluster volume remove-brick VOLNAME BRICK start' then command' gluster volume rebalance <volname> status' showing output even user has not triggred "rebalance start" and when user triggred 'gluster volume rebalance <volname> start' then command 'gluster volume remove-brick VOLNAME BRICK status' showing output even user has not run rebalance start and remove brick start. regression test failed in previous patch. file test/dht.rc and test/bug/bug-973073 edited to avoid regression test failure. now with this fix it will differentiate rebalance and remove-brick status messages. Signed-off-by: ggarg <ggarg@redhat.com> Change-Id: I7f92ad247863b9f5fbc0887cc2ead07754bcfb4f BUG: 1089668 Reviewed-on: http://review.gluster.org/7517 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd/snapshot: Activation and De-activation of snapshotJoseph Fernandes2014-05-029-67/+601
| | | | | | | | | | | | | | | | | | | | | Previously, snapshots by default were activated on creation and there was no option to activate or deactivate them on demand. This will allow the user to activate and deactivate on demand. The CLI goes as follows 1) Activate the snap using a command "gluster snapshot activate <snapname> [force]" 2) Deactivate the snap using a command "gluster snapshot deactivate <snapname>" Note: Even now the snapshot will be activated during creation. Change-Id: I0946d800780f26c63fa1fcaf29aabc900140448f BUG: 1061685 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/7476 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd/snapshot: Move read-only xlator to client graphRajesh Joseph2014-05-021-2/+16
| | | | | | | | | | | | | | | read-only xlator is moved from server graph to client graph so that AFR & DHT healing can take place at server Change-Id: I140ec962330c59d3b44f9bc8084a1544a1fd6c54 BUG: 1061685 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/7582 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd: avoid repetitive logging of disconnect messagesKrishnan Parthasarathi2014-05-021-3/+6
| | | | | | | | | | | | | | NFS/SHD process disconnecting from glusterd, when the respective service are down, would lead to repeated logging of disconnect related messages, owing to the rpc reconnect logic in glusterfs(d). This patch addresses that by logging the disconnect only on the first disconnect event. Change-Id: I4008d2436721f4ba093270df4ccb3fc885f22ca0 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/7468 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* scripts: CTDB lockvol ping-timeout should be 10secsHarshavardhana2014-05-021-0/+9
| | | | | | | | | | | | | | | Users often forget to update the ping-timeout, perhaps we should take care of this automatically Change-Id: I6d14df8aa52665847233cb1760dfd54f41baadec BUG: 1091600 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/7569 Reviewed-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Jose A. Rivera <jarrpa@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/changelog: Fix to remove Warning message.Kotresh H R2014-05-021-2/+0
| | | | | | | | | | | | | | | Fix warning message introduced in changelog draining patch. It is not caught in gcc 4.4, caught in gcc 4.8!! Signed-off-by: Kotresh H R <khiremat@redhat.com> Change-Id: I01a8fda2102a409dd6e935805d4d48b41b615fe8 BUG: 1091817 Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/7636 Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* glusterd/snapshot : Copy the quota config and cksum file before taking a ↵Sachin Pandit2014-05-013-3/+116
| | | | | | | | | | | | | | | | | | | | | | snapshot Quota config and cksum file needs to be copied before taking a snapshot, so that when a snapshot is restored these files is copied back to the original place, and the restored snap volume can make use of these quota files. Before taking a snapshot the quota files are copied to /var/lib/glusterd/snaps/<snapname>/quota/ Change-Id: Id175f28d4ee47be64d7491c6aae81a1794928490 BUG: 1061685 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7527 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd/snapshot : Copy geo-rep status and config files before taking a ↵Sachin Pandit2014-05-016-2/+518
| | | | | | | | | | | | | | | | | | | | | | | | | | | snapshot. geo-rep status and conf files needs to be copied before taking a snapshot. The idea here is, when the snapshot is restored, these config and status files needs to be placed back in geo-replication folder so that geo-replication can start with the same state it was when taking a snapshot. Details : Before a snapshot is taken, Copy the status and config files present in /var/lib/glusterd/geo-replication/. The files copied are gsyncd.conf and status files of each session belonging to a volume whose snapshot is about to be taken. Change-Id: I0234ecd846883350c59777c2505290729de0ce05 BUG: 1061685 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7495 Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd/geo-rep: Looks for state_file and pid-file in gsyncd_template.confAvra Sengupta2014-05-014-165/+460
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If entries like state_file or pid-file are missing in the gsyncd.conf or if the gsyncd.conf is also missing, glusterd looks for the missing configs in the gsyncd_template.conf status will display "Config Corrupted" as long as the entry is missing in the config file. Missing state-file entry in both config and template will not allow starting a geo-rep session. However stop force will successfully stop an already running session, if the state-file entries are missing in both the config file and the template, as long as either of them have a pid-file entry. if the pid-file entry is missing in the gsyncd.conf file, starting a geo-rep session will not be allowed. if the pid-file entry is missing in an already started session, then stop force will fetch it from the config template and stop the session. if the pid-file entry is missing in both the config and the template, stop force will fail with appropriate error stating pid-file entry is missing. Change-Id: I81d7cbc4af085d82895bbef46ca732555aa5365d BUG: 1059092 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/6856 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* features/changelog: Barrier in changelog during snapshot.Kotresh H R2014-05-016-36/+334
| | | | | | | | | | | | | | | | | | Changelog barriers unlink, rename, rmdir fops on barrier 'on' notification from glusterfsd mgmt layer and unbarriers the same on barrier 'off' notification during snapshot. Please see the following link for more details. http://www.gluster.org/community/documentation/index.php/Changelog_Design_changes_for_snapshot Signed-off-by: Kotresh H R <khiremat@redhat.com> Change-Id: Iea9c62fafc86242f9404e03679b1941aa9c88c9a Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/7415 Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Varun Shastry <vshastry@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* feature/changelog: Draining of in-transit fops in changelog.Kotresh H R2014-05-013-12/+800
| | | | | | | | | | | | | | | | | | | | This is required for Geo-rep to work with snapshots. Following things are done in this patch. 1. Draining of in-transit fops during changelog rollover. 2. Explicit rollover of changelog when snapshot barrier notification comes. During this, intransit fops are drained and changelog is rolled over. For more details on the purpose of the patch. Please visit following link. http://www.gluster.org/community/documentation/index.php/Changelog_Design_changes_for_snapshot Change-Id: I22690131e19d3027f6d8957178bdc3431b9062f6 Signed-off-by: Kotresh H R <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/7216 Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Varun Shastry <vshastry@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* glusterd/snapshot : Barrier code integration with snapshot codebase.Sachin Pandit2014-05-014-9/+125
| | | | | | | | | | | | | | | | | As we have new barrier translator in place, we are making use of that during snapshot phase. During snapshot create (pre-commit), we enable the barrier feature and after the commit we disable it. Change-Id: I94212b1c06b0d9b12255ee98313e2d8549b34b17 BUG: 1061685 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7561 Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* mgmt/glusterd: Fix wrong usage of snprintfPranith Kumar K2014-05-011-1/+1
| | | | | | | | | | | Change-Id: I7db752390bb742fb9f6cacce84563ff782ae352b BUG: 1087677 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7608 Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* storage/posix: Remove dead code in xattropPranith Kumar K2014-05-011-32/+0
| | | | | | | | | Change-Id: I48ba81ad342e3c8fe1d81f8e57e61676dd356fb0 BUG: 1092749 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7318 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* logging: use duplicate stderr, instead of re-openingAnand Avati2014-04-301-2/+24
| | | | | | | | | | | | | | | | | | The special filename "-" is supposed to log to stderr. Instead of trying to explictly open "/dev/stderr" again (which may not be possible as permissions might have changed by then), dup the stderr and use the copy. It is not a good idea to use @stderr global variable directly, as ctx->log.logfile is fclose()d in glfs_fini() (was fixed in http://review.gluster.org/6452) Change-Id: Ia6c538fe363905588dcf4fc4783804073956a586 BUG: 1088589 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/7607 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* logging: Introduce suppression of repetitive log messagesKrutika Dhananjay2014-04-3011-108/+1030
| | | | | | | | | Change-Id: I8efa08cc9832ad509fba65a88bb0cddbaf056404 BUG: 1075611 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/7475 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* [glusterd/snapshot] snapshot create force optionJoseph Fernandes2014-04-304-18/+86
| | | | | | | | | | | | | | | | | | | | Implement force option in snapshot create i.e 1) Creation of snapshot fails if the original volume bricks are down 2) With a force option creation of snapshot will continue even if the original volume bricks are down. This was the fix for bugs 1089527 and 1083502 Change-Id: I8de0242adf8ee0af00db9fa8701d86fabc12e7fc BUG: 1090042 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/7520 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd/snapshot : Fix for snapshot delete failureVijaikumar M2014-04-301-20/+21
| | | | | | | | | | | | | | | | | | | Problem : snapshot delete used to fail when executed in loop, as there was race between process kill and umount. Solution : Before an umount is issued check if the process is still running, If so then issue for process termination. Give three tries for doing umount operation Change-Id: I7f4315e5d7d4a156dd513ec77443ead6ccd37b2e BUG: 1090449 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7532 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* [glusterd/snapshot]: snapshot create CLI msg correctionJoseph Fernandes2014-04-301-2/+2
| | | | | | | | | | | | Uniformity in cli output while creating snapshots Change-Id: Ic0fd09bbde9a1f55c441e1745f93c588d2e4c1a1 BUG: 1090041 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/7518 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* [glusterd/snapshot] Glusterd crashes when a same commandJoseph Fernandes2014-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | eg snapshot create is fired simultaneously on a node Cause: In glusterd_mgmt_v3_initiate_snap_phases() , the function glusterd_mgmt_v3_post_validate() asserts on the NULL value of req_dic. req_dic is not initialized as glusterd_mgmt_v3_initiate_lockdown() is not able to acquire the lock and comes to the "out" section, before initializing req_dic (via glusterd_mgmt_v3_build_payload) Fix: Call glusterd_mgmt_v3_post_validate() only if the lock is acquired. Change-Id: I7cb55b6c0013ad1c8bbb922a62c34aab097bafe9 BUG: 1090047 Signed-off-by: Joseph Fernandes <josferna@redhat.com> Reviewed-on: http://review.gluster.org/7500 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* geo-rep: Consume Changelog History APIAravinda VK2014-04-304-31/+198
| | | | | | | | | | | | | | | | | | | | | | | | Every time when geo-rep restarts it first does FS crawl using XCrawl and then switches to Changelog Mode. This is because changelog only had live API, that is we can get changes only after registering. Now this(http://review.gluster.org/#/c/6930/) patch introduces History API for changelogs. If history is available then geo-rep will use it instead of FS Crawl. History API returns TS till what time history is available for given start and end time. If TS < endtime then switch to FS Crawl. (History => FS Crawl => Live Changelog) If TS >= endtime, then switch directly to Changelog mode (History => Live Changelog) Change-Id: I4922f62b9f899c40643bd35720e0c81c36b2f255 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/6938 Reviewed-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* glusterd/snapshot : Clean up of old barrier code.Sachin Pandit2014-04-304-478/+0
| | | | | | | | | | | | | | As a new barrier translator is introduced, we dont require the old barrier code. Hence cleaning thar up. Change-Id: Ieedca6f33a746898f0d2332fda1f1d4c86fff98f BUG: 1061685 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7577 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* snapshot/config : Fix for bug which states gluster snapshot configSachin Pandit2014-04-293-11/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | command should only accept the decimal numeric value. Syntax : gluster snapshot config [volname] [snap-max-hard-limit <count>] [snap-max-soft-limit <percentage>] Problem : Snapshot config used to consider the alphanumeric value staring with digit as an integer (Example: "9abc" is converted to "9"). Solution : Refined the code to check if the entered value is numeric. This patch also fixes some of the minor problems related to snapshot config. 1) Output correction in gluster snapshot config snap-max-soft-limit. 2) setting the soft limit to greater than 100% displays that "Invalid snap-max-soft-limit 0". The error message used to display "zero" in the output, Changed this to display relevant value. 3) Setting greater than allowed snap-max-hard-limit output needs to have space in between. Change-Id: Ie7c7045722fe57b2b3c50c873664b67c28eb3853 BUG: 1087203 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7457 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd: make sure that mntent.h is conditionally includedHarshavardhana2014-04-291-0/+5
| | | | | | | | | Change-Id: I39c362c0908166707e10e8820cc1ee9a0989dcbe BUG: 1089172 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/7584 Reviewed-by: Anand Avati <avati@redhat.com> Tested-by: Anand Avati <avati@redhat.com>
* strfd: introduce strvprintf() APIAnand Avati2014-04-292-4/+17
| | | | | | | | | | | | variant of strprintf() which accepts va_list as parameter instead of variable args (...) Change-Id: I205acf3aaf5440890d5f9cad693c6a358a5d9218 BUG: 1089216 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/7539 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* glusterd: Ping timer implmentationKrishnan Parthasarathi2014-04-2919-306/+351
| | | | | | | | | | | | | | | | | | | | | | | | This patch refactors the existing client ping timer implementation, and makes use of the common code for implementing both client ping timer and the glusterd ping timer. A new gluster rpc program for ping is introduced. The ping timer is only started for peers that have this new program. The deafult glusterd ping timeout is 30 seconds. It is configurable by setting the option 'ping-timeout' in glusterd.vol . Also, this patch introduces changes in the glusterd-handshake path. The client programs for a peer are now set in the callback of dump_versions, for both the older handshake and the newer op-version handshake. This is the only place in the handshake process where we know what programs a peer supports. Change-Id: I035815ac13449ca47080ecc3253c0a9afbe9016a BUG: 1038261 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/5202 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* storage/posix: add list xattr capability to lookupPranith Kumar K2014-04-292-16/+94
| | | | | | | | | BUG: 1078061 Change-Id: Ie26d28b8a74aa0d1eceff14a84c3cd3e302dcdb5 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7293 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* feature/quota: Logging correctionsVarun Shastry2014-04-292-21/+110
| | | | | | | | | | | This patch solves the inconsistent quota usage logging when soft limit reached. Change-Id: I47e7f1e65ed4b8306a999a20cc8f6b1772d47627 BUG: 1087198 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/7451 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cli: Add a cli command to enable/disable barrierKaushal M2014-04-299-3/+316
| | | | | | | | | | | | | | | This patch adds a new 'gluster volume barrier <VOLNAME> {enable|disable}' cli command. This helps in testing the brick op code path when testing the barrier xlator. This patch can be reverted later if not required for end users. Change-Id: Icd86a2d13e7f276dda1ecbb2593d60638ece7dcd BUG: 1060002 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/6958 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd: Add a barrier brick-opKaushal M2014-04-296-1/+182
| | | | | | | | | | | | | | | | This patch introduces a new 'barrier' brick-op which will be used to activate/deactivate the barriering on the bricks. This includes barriering in the barrier xlator and in the changelog xlator. All the required code has been including a bricks select function, a payload builder and a brick-op handler. Change-Id: I91d9d77f691c2e89823f7dc4e84900ec40dc4dd2 BUG: 1060002 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/6943 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd/snapshot : Dont acquire a lock if config is ofSachin Pandit2014-04-291-205/+258
| | | | | | | | | | | | | | | | | | | | | | | | | type DISPLAY. Problem : Currently we are acquiring a lock if we give "gluster snapshot config <volname>". As this is just a Read-Only command, we need not acquire a lock. Solution : This patch checks if the command given is of type DISPLAY. If so, then glusterd_v3_mgmt framework is not called, as reading information from local node is enough. This Patch also fixes "Assertion failed: volname" while doing the system config change when snap create was in progress. Change-Id: Ie8991f2cd746987b11152006e113e8706516138b BUG: 1087677 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7458 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* build: glusterfs.spec.in, minor/nit changes to sync with Fedora specKaleb S. KEITHLEY2014-04-291-18/+25
| | | | | | | | | | | minor/nit changes to sync with Fedora spec Change-Id: I939eb79d5c3a19c09a3df3f30c82c86e1a610cd0 BUG: 1091408 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/7565 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* logging: Fix msg-id segment allocationKrutika Dhananjay2014-04-291-14/+28
| | | | | | | | | | Change-Id: I85efa4b91c263d7374d34dd0d84e9f1032d07ab6 BUG: 1075611 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/7580 Reviewed-by: N Balachandran <nbalacha@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* debug/trace: Fix length issue found in compilationPranith Kumar K2014-04-291-44/+45
| | | | | | | | | Change-Id: I1cd7fd6464d0912294009c2293ed70f3f6744930 BUG: 1092196 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7586 Reviewed-by: Anand Avati <avati@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* nlm: fix rpc.statd typoHarshavardhana2014-04-281-1/+1
| | | | | | | | | Change-Id: I701fd82a8dd5a72727b8035bc6c2861465f1aa1f BUG: 1089172 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/7585 Reviewed-by: Anand Avati <avati@redhat.com> Tested-by: Anand Avati <avati@redhat.com>
* libgfapi: A minor bug-fix in glfs_h_setxattr and glfs_h_removexattr calls.Soumya Koduri2014-04-281-2/+3
| | | | | | | | | | | | Change-Id: I62f63da37edf722d6d79c75f72ee7403e93e4936 BUG: 1089414 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/7529 Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Tested-by: Meghana M <mmadhusu@redhat.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* cluster/afr: Fix inode_forget assert failurePranith Kumar K2014-04-282-28/+47
| | | | | | | | | | | | | | | | | | | | | | Problem: If two self-heals are triggered on same inode in parallel then one inode will be linked and the other inode will not be linked as an inode with that gfid is already linked in inode table. Calling inode-forget on that inode leads to assert failure. Fix: Always use linked inode for performing self-heal. Added inode-forgets in other places as well even though its not really a memory leak. Change-Id: Ib84bf080c8cb6a4243f66541ece587db28f9a052 BUG: 1091597 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7567 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* dict: de-allocate data on dict-set failuresPranith Kumar K2014-04-281-0/+32
| | | | | | | | | | | Found the bug while browsing code. Very difficult to hit this though. Change-Id: I84bd5d23d19b6aa16866fc0f1b56aa22cb8a5f1f BUG: 1079215 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7310 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* glusterd: Help does not show performance.nfs.* optSantosh Kumar Pradhan2014-04-281-7/+31
| | | | | | | | | | | | | | | | Gluster does not display performance.nfs.* options in help. In Gluster NFS, write-behind is the only performance xlator which gets loaded. Gluster volume set help should display all the options provided by write-behind xlator. Change-Id: I4a41151a6c15eeed8e8d123a6044c6f0c42b56b0 BUG: 1090826 Signed-off-by: Santosh Kumar Pradhan <spradhan@redhat.com> Reviewed-on: http://review.gluster.org/7546 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* cli: Error out when character "." is available in volume nameggarg2014-04-282-2/+27
| | | | | | | | | | | | | | | | previously it was failed without showing any information why it is failed. Now with this fix, when "." or any non alphanumeric character present in volume name, it will give error messages Change-Id: I17e8e69c08345c4d760f3ba333fe841e754bc9c8 BUG: 921215 Signed-off-by: ggarg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/7364 Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* features/libgfchangelog: APIs to process history changelogs.Kotresh H R2014-04-284-2/+336
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Create directories in following fashion for history API's usage when consumer is registered with libgfchangelog shared library through gf_changelog_register. scratch_dir/.history scratch_dir/.history/.current scratch_dir/.history/.processed scratch_dir/.history/.processing 2. Added new file 'gf-history-changelog.c' and following APIs are provided for consumers to process history changelogs. 1. gf_history_changelog_scan: Move processed history changelog file from .processing to .processed 2. gf_history_changelog_next_change: Return the next history changelog file entry. Zero means all history chanelogs are consumed. 3. gf_history_changelog_done: Scan .processing directory and generate a list of change entries. 4. gf_history_changelog_start_fresh: For a set of changelogs, start from the begining. NOTE: Though this patch provides above funcationalities. It is considered functionally full with the patch (http://review.gluster.org/#/c/6930/). Change-Id: I200780c7278e0a6c008910d93faad5858a4b3e76 Original-author: Kotresh H R <khiremat@redhat.com> Signed-off-by: Kotresh H R <khiremat@redhat.com> Signed-off-by: Ajeet Jha <ajha@redhat.com> Reviewed-on: http://review.gluster.org/6998 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
* glusterd/snapshot: Compare and update snapshots during peer handshakeAvra Sengupta2014-04-288-126/+985
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During a peer-handshake, after the volumes have synced, and the list of missed snapshots have synced, the node will perform the pending deletes and restores on this list. At this point, the current snapshot list in the node will be updated, and hence in case of conflicts arising during snapshot handshake, the peer hosting the bricks will be given precedence Likewise, if there will be a conflict, and both peers will be in the same state, i.e either both would be hosting bricks or both would not be hosting bricks, then a decision can't be taken and a peer-reject will happen. glusterd_compare_and_update_snap() implements the following algorithm to perform the above task: Step 1: Start. Step 2: Check if the peer is missing a delete on the said snap. If yes, goto step 6. Step 3: Check if there is a conflict between the peer's data and the local snap. If no, goto step 5. Step 4: As there is a conflict, check if both the peer and the local nodes are hosting bricks. Based on the results perform the following: Peer Hosts Bricks Local Node Hosts Bricks Action Yes Yes Goto Step 7 No No Goto Step 7 Yes No Goto Step 8 No Yes Goto Step 6 Step 5: Check if the local node is missing the peer's data. If yes, goto step 9. Step 6: It's a no-op. Goto step 10 Step 7: Peer Reject. Goto step 10 Step 8: Delete local node's data. Step 9: Accept Peer Data. Step 10: Stop Change-Id: I79be0f0f5f2a4f5c72277a4e77c2be732af432e1 BUG: 1061685 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7525 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd: Rename the export dictionary as peer_dataAvra Sengupta2014-04-283-121/+144
| | | | | | | | | | | | | | | | | | During a glusterd handshake, a dictionary is passed among the peers which contains, info of volumes, global opts, and now also info of snaps and list of missed snaps As it now contains more than just volume specific data, renaming the dict in the code-base from "vols" to "peer_data" Change-Id: Ib457172789ddd0d8978b08bceab0988c48e9eea7 BUG: 1061685 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7524 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd/snapshot: Recreate the mount dirs and mount the lvm snapshots on ↵Avra Sengupta2014-04-284-70/+415
| | | | | | | | | | | | | | | | | | node reboot. The lvm snapshots of the bricks are mounted at /var/run/gluster/snaps/ or /run/gluster/snaps. These paths being on a tempfs, on reboot are removed. So when glusterd starts, we need to recreate these paths, activate the respective logical volumes (lvm snapshots of the bricks), and mount these logical volumes at their respective paths. Change-Id: Ic5ef61e79a25d9830df717c592391965fe09db62 BUG: 1061685 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7452 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>