summaryrefslogtreecommitdiffstats
path: root/daemons/cmirrord
Commit message (Collapse)AuthorAgeFilesLines
* cmirrord: check for result of chdirZdenek Kabelac2012-08-231-1/+5
| | | | Error exit if chdir fails.
* cleanup: replace memset with struct initilizationZdenek Kabelac2012-06-222-8/+3
| | | | | Simplifies the code, properly detects too long socket paths, drops unused parameter.
* cmirrord: add missing checks for kernel_sendZdenek Kabelac2012-06-202-4/+9
| | | | Log errors if kernel_send fails.
* cmirrord: fix cut&pasteZdenek Kabelac2012-06-201-1/+1
|
* cmirrord: add test for closedir() and close()Zdenek Kabelac2012-06-202-8/+19
|
* Fix bug in cmirror that caused incorrect status info to print on some nodes.Jonathan Earl Brassow2012-04-262-3/+3
| | | | | | | | | | | | | | | | Looking at the code in cmirrord/local.c, we can see the various different request types handled in different ways. Some information that is non-changing does not need to go around the cluster and can be short-circuited. For example, once the cluster mirror is in-sync, it is pointless to continue sending that query around the cluster. We can save network bandwidth and reply directly back to the kernel. When it comes to status information, there are two types 'TABLE' and 'INFO'. The 'TABLE' information never changes and belongs to the group of requests that can be safely short-circuited. The 'STATUS' information can change - and will change if a device fails. Thus it cannot be short-circuited, but this is exactly what was found. The 'STATUS' information request was being short-circuited and therefore never reporting the failure condition to anyone other than the "server" that experienced it directly.
* Remove some whitespaces.Milan Broz2012-03-104-14/+14
| | | | (test commit)
* s/CPG_/CS_: Various CPG constants are going away, even though CPG itself staysJonathan Earl Brassow2012-03-011-8/+8
| | | | | | | | | | F17 is getting rid of OpenAIS libraries (and checkpointing). While the CPG stuff is staying, some if its constants are being removed. So, we must adjust and use the remaining constants which the CPG constants were based on. [~]# egrep 'CPG_DISPATCH_ALL|CPG_OK' /usr/include/*/* corosync/corotypes.h:#define CPG_DISPATCH_ALL CS_DISPATCH_ALL corosync/corotypes.h:#define CPG_OK CS_OK
* Allow cluster mirrors to handle the absence of the checkpoint lib (libSaCkpt).Jonathan Earl Brassow2012-02-291-22/+115
| | | | | | | | | | | | The OpenAIS checkpoint library is going away; therefore, cmirrord must operate without it. The algorithms the handle the timing of when to send a checkpoint, the determination of what to send, and which ongoing cluster requests are relevent with respect to the checkpoints are unaffected. We need only replace the functions that actually perform the storing/transmitting and retrieving/receiving of the checkpoint data. Rather than store the checkpoint data in an OpenAIS checkpoint file, we simply transmit it along with the message that notifies the incoming node that the checkpoint is ready.
* Remove unneeded assignmentsZdenek Kabelac2012-02-081-1/+1
| | | | Variables have (or will have) those values set.
* Keep page_size as signed numberZdenek Kabelac2012-02-081-1/+1
| | | | Since it's return value from sysconf and is checked for <0.
* cmirrord now returns log name to kernel in CTR so it can be registeredJonathan Earl Brassow2011-10-141-1/+4
| | | | | | | | | | | | Version 2 of the userspace log protocol accepts return information during the DM_ULOG_CTR exchange. The return information contains the name of the log device that is being used (if there is one). The kernel can then register the device via 'dm_get_device'. Amoung other things, this allows for userspace to assemble a correct dependency tree of devices - critical for LVM handling of suspend/resume calls. Also, update dm-log-userspace.h to match the kernel header associated with this protocol change. (Includes a version inc.)
* Check for failing 'stat' and skip this loop iterationZdenek Kabelac2011-09-212-7/+29
| | | | | | | | | | | | | (since data in statbuf are invalid). Check whether sysconf managed to find _SC_PAGESIZE. Report at least debug warning about failing unlink (logging scheme here seems to be a different then in lvm). Duplicate terminal FDs and use similar code as is made in clvmd and cleanup warns about missing open/close tests. FIXME: Looks like we already have 3 instancies of the same code in lvm repo.
* Detect sscanf recovering_region input errorZdenek Kabelac2011-09-061-2/+5
| | | | Missing check for sscanf found by static analyzer.
* Fix memory leak of allocated bitmap in error pathZdenek Kabelac2011-09-061-0/+2
| | | | Found by static analyzer.
* Log unlink() errorZdenek Kabelac2011-09-061-1/+2
|
* Removed unused pointerZdenek Kabelac2010-12-201-3/+2
| | | | Pointer 'duplicate' is unused.
* Use dm_free for dm_malloc-ed areas in _clog_ctr/_clog_dtr (cmirrord).Zdenek Kabelac2010-12-201-15/+12
| | | | | | Use dm_zalloc to obtain zeroed memory block. Use dm_free for dm_ allocated memory blocks. Test close() for error.
* Add new dm_prepare_selinux_context fn to libdevmapper and use it throughout.Peter Rajnoha2010-12-131-0/+2
| | | | | | | | | | | Detect existence of new SELinux selabel interface during configure. Use new dm_prepare_selinux_context instead of dm_set_selinux_context. We should set the SELinux context before the actual file system object creation. The new dm_prepare_selinux_context function sets this using the selabel_lookup fn in conjuction with the setfscreatecon fn. If selinux/label.h interface (that should be a part of the selinux library) is not found during configure, we fallback to the original matchpathcon function instead.
* Add missing return for NULL passed bufferZdenek Kabelac2010-10-261-1/+3
| | | | | | Function pull_stateo() checks for NULL 'buf' - but return for this error path was missing. cmirror code never calls this function with NULL 'buf', so this fix has no effect on current code base, but makes clang happier.
* Fix missing initilisation to 0Zdenek Kabelac2010-10-251-1/+1
| | | | | Add missing init value for variable 'found' which is later tested and may have contained some garbage value.
* This patch fixes an issue where cluster mirror write I/OJonathan Earl Brassow2010-08-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | can be opprobriously slow if created with '--nosync'. One of the ways cluster mirrors coordinate I/O and recovery amoung the different machines is by the use of the log function 'is_remote_recovering()' which lets nodes know if a region they wish to perform a write on is currently being recovered on another node. If the region is being recovered, the I/O is delayed. The 'is_remote_recovering' routine has been optimized to avoid the deluge of requests that would be issued to the userspace log server by maintaining a marker of how far the recovery has gotten. It can then immediately return 'not recovering' if the region being inquired about is less than this mark. Additionally, if the region of concern is greater than the mark, the function will limit the number of transmissions to userspace by assuming the region /is/ being recovered when skipping the transmission. This limits the amount of processing and updates the mark in 1/4 sec time steps. This patch fixes a problem where 'the mark' is not being updated because of faulty logic in the userspace log daemon. When '--nosync' is used to create a cluster mirror, the userspace log daemon never has a chance to update the mark in the normal way. The fix is to set the mark to "complete" if the mirror was created with the --nosync flag.
* Fix for bug 596453: multiple mirror image failures cause lvm repair...Jonathan Earl Brassow2010-08-171-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The lvm repair issues I believe are the superficial symptoms of this bug - there are worse issues that are not as clearly seen. From my inline comments: * If the mirror was successfully recovered, we want to always * force every machine to write to all devices - otherwise, * corruption will occur. Here's how: * Node1 suffers a failure and marks a region out-of-sync * Node2 attempts a write, gets by is_remote_recovering, * and queries the sync status of the region - finding * it out-of-sync. * Node2 thinks the write should be a nosync write, but it * hasn't suffered the drive failure that Node1 has yet. * It then issues a generic_make_request directly to * the primary image only - which is exactly the device * that has suffered the failure. * Node2 suffers a lost write - which completely bypasses the * mirror layer because it had gone through generic_m_r. * The file system will likely explode at this point due to * I/O errors. If it wasn't the primary that failed, it is * easily possible in this case to issue writes to just one * of the remaining images - also leaving the mirror inconsistent. * * We let in_sync() return 1 in a cluster regardless of what is * in the bitmap once recovery has successfully completed on a * mirror. This ensures the mirroring code will continue to * attempt to write to all mirror images. The worst that can * happen for reads is that additional read attempts may be * taken.
* A misunderstanding of the return value of 'dm_bit' has been causing a dataJonathan Earl Brassow2010-08-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | corruption bug in cmirror. 'dm_bit' is only ever used as a boolean operation within LVM, but it can return a range of values. If the bit is set, a power of 2 is returned. If the bit is unset, 0 is returned. 'log_test_bit' (a function in the cluster mirror log daemon code) has switched to using the dm bit operations in rhel6. There are two places in the daemon code where 'log_test_bit' is not used merely as a boolean, but rather the return value is used as the return value for the log functions 'is_clean' and 'in_sync' - having assumed that 'dm_bit' was returning 0 or 1 only. One place the 'in_sync' function is utilized is in 'dm_rh_get_state' - a function that informs the mirroring code how to treat I/O and which devices to read/write from. 'dm_rh_get_state' was checking if the return value of 'in_sync' was 1 to determine if the region was DM_RH_CLEAN. Since 'dm_bit' (and by extension 'log_test_bit' and 'in_sync') was returning powers of 2, DM_RH_CLEAN was rarely being reported as it should have been. Thinking the region was out-of-sync, the mirroring code would write only to the primary device. When the primary device was failed, all of those writes were lost - leaving the entire mirror corrupted.
* Add dm_create_lockfile to libdm to handle pidfiles for all daemons.Fabio M. Di Nitto2010-07-131-44/+8
| | | | | | Switch dmeventd to use dm_create_lockfile and drop duplicate code. Allow clvmd pidfile to be configurable. Switch cmirrord and clvmd to use dm_create_lockfile.
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-095-11/+11
|
* Add error checking for calls to sprintf - it can fail for moreJonathan Earl Brassow2010-06-211-15/+40
| | | | reasons than just 'out-of-space'.
* daemons/cmirrord/functions.c (part of cmirrord) was referencingJonathan Earl Brassow2010-06-181-1/+0
| | | | | | | | | | linux/kdev_t.h even though it wasn't needed. Strangely, it seems to be causing problems on various architectures (i686) in the function daemons/cmirrord/functions.c:disk_status_info()->sprintf. I'm not sure why this is a problem since none of the macros in kdev_t.h are used in that code, but it certainly doesn't hurt to pull an unnecessary header and it seems to fix the problem.
* Use "" instead of <> for configure.h and libdevmapper.hZdenek Kabelac2010-06-151-1/+1
| | | | Move configure.h as the first header for clvmd source files.
* INSTALL rules updatesZdenek Kabelac2010-04-091-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Patch is inspired by Debian's extra patch. - removes OWNER & GROUP make vars they are parts of INSTALL command. - adds INSTALL_PROGRAM for executable, uses $(INSTALL) - adds INSTALL_DATA for non-executable data, uses ($INSTALL) - adds INSTALL_WDATA for writable non-executable data, uses ($INSTALL) - adds configure option --enable-write_install - to support installatin of writable files used by distribution - replaces usage of ifeq @LIB_SUFFIX@ with $(LIB_SUFFIX) - installs .a files from static builds without executable flag - installs .a files to $(usrlibdir) instead of $(libdir) - installs all static binaries to $(staticdir) - create .so links for devel package in $(usrlibdir) instead of $(libdir) - makes .so and .so.LIB_VERSION files within builddir - removes VERSIONED_SHLIB and created versioned LIB_SHARED automagicaly - install LIB_SHARED via install_lib_shared target - install plugins via install_lib_shared_plugin target - prints whole 'install' command during installation instead of less informative "Installing $(something) $(somewhere)" - install multiple man pages with one INSTALL command - use DISTCLEAN_TARGETS instead of creating multiple distclean targets
* Use vpath instead of VPATH.Zdenek Kabelac2010-04-091-1/+0
| | | | | | | | | | | | | | | Usage of VPATH makes troubles when used within $(builddir). Not only source files are being found through VPATH, but targets as well. (make --debug=v) Thus if user builds the code in $(srcdir) and also in some $(builddir) he gets mangled results as some generated files (i.e. .export.sym) are 'reused' from $(srcdir) instead of $(builddir). This patch switches to use vpath were we could explicitly name suffixes that should be looked via vpath - we must take care, we do not generate files with these suffixes: .c, .in, .po, .exported_symbols
* Fixing compilation warning: implicit declaration of function ‘umask’Zdenek Kabelac2010-03-291-0/+1
|
* Use $(top_builddir) for inclusion of make.tmpl in Makefiles.Zdenek Kabelac2010-03-041-1/+1
|
* Was using dm_list_iterate_items when I should have been usingJonathan Earl Brassow2010-01-271-2/+2
| | | | | | | *_safe. This had the effect of segfaulting the log daemon when converting a mirror from one log type to another. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
* missing headerAlasdair Kergon2010-01-221-0/+1
|
* Deal with a few more compiler warnings.Alasdair Kergon2010-01-203-12/+13
|
* Remove mknod() and add FIXMEs.Alasdair Kergon2010-01-191-6/+9
| | | | In the udev-world, this function should work differently.
* remove more compiler warningsAlasdair Kergon2010-01-191-16/+14
| | | | add FIXMEs for incomplete write()s
* Signal handling FIXMEs.Alasdair Kergon2010-01-193-25/+30
| | | | A few integer type changes.
* Clean up include files.Alasdair Kergon2010-01-1814-112/+67
|
* Fix some compiler warnings.Jonathan Earl Brassow2010-01-183-10/+14
|
* Misc compilation clean-ups.Alasdair Kergon2010-01-188-30/+31
|
* Make the intermachine communication structures architecture independantJonathan Earl Brassow2010-01-156-38/+306
| | | | | | to allow for mixed architecture clusters. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
* When moving the cluster log server into the LVM tree, the in memoryJonathan Earl Brassow2010-01-151-19/+36
| | | | | | | | | | | | | | bitmap tracking was switched from the e2fsprogs implementation to the device-mapper implementation (dm_bitset_t). The latter has a leading uin32_t field designed to hold the number of bits that are being tracked. The code was not properly handling this change in all places. Specifically, when getting the bitmap to/from disk. Endian adjustments will likely need to be made on the accounting field as well, since bitmaps are passed between machines on start-up. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
* At some point "clustered_[core|disk]" was changed to "clustered-[core|disk]".Jonathan Earl Brassow2010-01-151-9/+9
| | | | | | This patch makes the log server recognise the new format. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
* More makefile cleaning up and fixing. (gentoo)Alasdair Kergon2009-10-051-1/+1
|
* Allow for a build directory separate from the source.Alasdair Kergon2009-10-021-2/+3
|
* More cmirror makefile fixes from Fabio.Alasdair Kergon2009-09-143-19/+29
|
* Add daemons/cmirrord files to git - somehow got messed up with cvs rename.Dave Wysochanski2009-09-0413-0/+4696
When clogd was renamed to cmirrord, somehow git got the remove of the old files but not the add of the new files. This patch adds the new files. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>