Commit Graph

1288 Commits

Author SHA1 Message Date
Jan Friesse
b9df4424b1 Display warning when not possible to form cluster
This may typically happen if local firewall is enabled. Patch adds new
item to statistics called continuous_gather where is number of
continuous entered gather state. If this number is bigger then
MAX_NO_CONT_GATHER, warning message is displayed. This is also used on
exiting, so stop of corosync is now possible even with enabled firewall.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2010-12-03 10:11:11 +01:00
Steven Dake
9096c4d96b Set the max buffer size for sockets
Set the recv buffer to a large size and the send buffer to a large size to
allow the kernel to store more messages before dropping messages.

Amended to change optlen type to socklen_t

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Fabio M. Di Nitto <fdinitto@redhat.com>
2010-12-01 09:45:30 -07:00
Steven Dake
00e340d095 The flushing code was introducing data corruption because of recursion errors
that occur as a result of the design of udpu.  Totem no longer requires
the flushing technique because we don't mark a packet as missing until it has
not been seen by a certain number of token rotations per a previous patch.  This
mechanism was introduced to work around a problem in switches where multicast
messages may be delayed by long periods compared to the unicast token.

This patch removes the flushing logic from udpu since it is no longer necessary.

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2010-11-28 01:45:08 -07:00
Angus Salkeld
2c46de5ac1 Add totem/interface/ttl config option.
This adds a per-interface config option to
adjust the TTL.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2010-11-24 14:35:56 +11:00
Steven Dake
aa03dca478 Merge branch 'topic-udpu'
Conflicts:
	Makefile.am

Signed-off-by: Steven Dake <sdake@redhat.com>
2010-11-18 15:03:19 -07:00
Steven Dake
b403fcbea9 Remove dead soresueaddr code
Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2010-11-18 14:51:17 -07:00
Steven Dake
bb05aed93f Add the UDPU transport
The UDPU transport is useful for those deployments which can't use multicast.
UDPU works by using UDP unicast, which is fully supported by every switch
manufacturer by default and doesn't rely on a functional IGMP implementation.

An example of the UDPU transport is contained in the corosync.conf.example.udpu
file which shows a 16 node cluster.  This file should be copied to each node
in the cluster and IP addresses changed as appropriate.

Amended to remove dead udpu REUSEADDR socket option.

Signed-off-by: Steven Dake <sdake@redhat.com>
2010-11-18 14:21:30 -07:00
Fabio M. Di Nitto
b2400314b2 add release script and git based versioning
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2010-11-10 07:46:53 -07:00
Angus Salkeld
f0104b6d31 Add .gitignore files.
Otherwise "git status" is a pain.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@edhat.com>
2010-10-21 07:43:46 -07:00
Jan Friesse
7c8cdfb197 Remove delay in library on corosync shutdown
Patch removes 2 seconds delay in library on normal corosync shutdown.
Delay is still present on abnormal shutdown.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3059 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-10-12 13:03:37 +00:00
Angus Salkeld
10be299e7b Check for a properly configured multicast address.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3057 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-09-27 22:41:26 +00:00
Angus Salkeld
07d06c0c0f Add monitoring and watchdog services.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3053 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-09-27 21:12:03 +00:00
Angus Salkeld
72addbc4cd Add a Finite State Machine.(fsm.h)
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3052 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-09-27 21:11:04 +00:00
Angus Salkeld
61b7d85978 Add a Finite State Machine.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3051 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-09-27 21:08:01 +00:00
Angus Salkeld
53b0aa47e6 objdb: fix some ugly indentation.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3048 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-09-25 06:51:36 +00:00
Angus Salkeld
739f9ab1b7 objdb: delete trackers when an object is deleted
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3047 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-09-25 06:50:21 +00:00
Angus Salkeld
23e3455fa7 objdb: object_created_notification() fix the order of the parent and object handles.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3046 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-09-25 06:49:28 +00:00
Steven Dake
4ac55e52e4 Patch from Kacper Kowalik to support honoring user defined LDFLAGS.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3042 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-09-14 18:10:12 +00:00
Steven Dake
71c54f9440 Fix few xopen tsafe issues.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3037 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-08-31 20:16:20 +00:00
Angus Salkeld
3b320c17ae IPC: return CS_ERR_NO_RESOURCES to library when low on fds.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3029 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-08-25 01:13:14 +00:00
Angus Salkeld
f95c4f76c3 POLL: gracefully handle running out of file descriptors.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3028 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-08-25 01:07:37 +00:00
Steven Dake
6992410df6 Remove checking of sub parameters in service.d files.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3024 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-08-24 18:45:43 +00:00
Steven Dake
5a3c285fbd Properly detect shutdown of corosync process
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3022 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-08-17 18:08:13 +00:00
Steven Dake
fef259970a Remove cancel token retransmit timeout.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3012 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-08-03 17:31:33 +00:00
Jan Friesse
93fb44ed0f Allow running only one instance of Corosync
Patch makes Corosync more compliant with common practices
for writing daemon. It creates pid file (usually 
/var/run/corosync.pid) and flocks it. So only one instance
of Corosync can be executed now.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3010 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-08-02 12:36:20 +00:00
Steven Dake
8fa6f4f58e Remove consensus check for two node cluster cases which can have smaller
consensus values.  Document in man page the behavior of consensus.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3005 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-07-27 19:00:37 +00:00
Steven Dake
1135c911cd Fix problem where flow control could lock up ipc under very heavy load in very
rare circumstances.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@3001 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-07-21 17:03:36 +00:00
Fabio M. Di Nitto
2b253383dc Fix logging_daemon config parser code.
Resolves: rhbz#615203


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2997 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-07-19 06:36:48 +00:00
Angus Salkeld
0fab390ae4 SYNC: always call sync_aborted() in sync_confchg_fn().
1) sync_callbacks.sync_abort can be null.
2) sync_processing is set to 0 after syncv1 is done.
   Then syncv2 processing is down. If we get a config change
   after syncv1 is down, but before syncv2 is done then it won't
   get aborted.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2995 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-07-17 04:59:40 +00:00
Angus Salkeld
b10fb56e8e SYNCV2: add debug when messages are discarded
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2993 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-07-16 02:11:25 +00:00
Angus Salkeld
2b4d150f81 SYNC: add some ENTER() trace points.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2992 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-07-16 02:09:51 +00:00
Angus Salkeld
7e7a32ffc2 SYNCV2: reset the my_memb_determine_ring_id in sync_v2_memb_list_abort()
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2991 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-07-16 02:08:54 +00:00
Angus Salkeld
e43e760dde SYNC: remove unused primary_designated from sync_primary_callback_fn()
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2990 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-07-16 02:07:09 +00:00
Steven Dake
b8878d2e76 Remove reset of token timeout on retransmitted token reception. The timer
should only be reset when a real token is received or membership protocol
could run into problems with certain timing parameters.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2988 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-07-14 18:35:36 +00:00
Steven Dake
95615b2fec Fix fail list fault that occurs in very rare circumstances.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2984 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-07-03 21:54:22 +00:00
Andrew Beekhof
0883fc877b Safely redirect stderr/in/out to /dev/null to prevent fork() from crashing
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2976 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-30 10:20:42 +00:00
Steven Dake
cf0d63aa3f Patch to fix stack protector sig abort that occurs when ipc buffer is too
short.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2974 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-29 18:15:20 +00:00
Angus Salkeld
b116eaca00 ipc: Fix error handling of mmap util functions.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2972 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-29 05:31:44 +00:00
Steven Dake
7b832592b0 Fix problem where flight data leaks files in /dev/shm when corosync is
restarted continuously via init scripts.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2964 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-28 22:15:48 +00:00
Jan Friesse
c4cb9ae4f0 Fix OBJDB locking
Patch fixes following situation:

1. objdb receives reload notification and ends in function
object_reload_config. This will call objdb_wrlock. I will call this
thread #1

2. Another thread will decide to update corosync statistics and calls
object_key_increment. This calls objdb_rdlock. This thread is #2. But
because condition (lock_thread != pthread_self()) is satisfied, it will
also calls pthread_rwlock_rdlock. This will blocks, because thread #1
holds the lock.

3. object_reload_config will call reload functions (as real example
xml2objdb). xml2objdb needs to calls object_create. This calls
objdb_rdlock, but will hang on pthread_mutex_lock(&meta_lock), because
this lock is held by thread #2.

-> deadlock

It is handled by using recursive mutex.

Also every function is now really locked.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2963 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-28 13:32:56 +00:00
Jan Friesse
eda1e364f4 Remove pathconf which may fall
Corosync has problem with readdir_r if pathconf function fails.

Main problem is hidden in calling pathconf (internally calls statfs)
which may fail. After this fail, newly allocated memory for readdir_r
was smaller than expected and memory was overwritten by readdir_r.

Patch removes calling of pathconf and rather use NAME_MAX constant which
is always large enough for all file systems.

Also return value of malloc SHOULD be checked.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2962 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-23 08:39:49 +00:00
Steven Dake
0eb0a06a14 Stop the totem stats updater timer during shutdown to prevent references to
invalid memory.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2953 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-19 00:27:46 +00:00
Steven Dake
1e76356159 Unlock global serializer lock during shutdown.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2949 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-19 00:10:41 +00:00
Andrew Beekhof
daa85f8f6c Prevent segfault in fork()
Not closing stdin/stderr/stdout leads to a segfault in fresetlockfiles()
See https://lists.linux-foundation.org/pipermail/openais/2010-June/014854.html for further info.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2948 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-18 14:33:01 +00:00
Christine Caulfield
bc1cca69b3 object_key_iter() calls object_key_iter_typed() and then always tries to
dereference the string it returns, even if the call fails. The attached
patch fixes this. 



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2944 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-15 15:48:58 +00:00
Steven Dake
402c553dd2 Update logsys to use proper ring buffer on file backed map
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2922 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-09 20:14:50 +00:00
Steven Dake
b8af7c3764 sem_wait can be interrupted by signal. Handle interruption properly.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2920 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-03 22:05:17 +00:00
Steven Dake
22471e113d Fix fail to receive logic which occurs very rarely on high loss networks with
software based multicast.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2919 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-03 21:36:21 +00:00
Steven Dake
79c60fd0ad Totem spec is clear:
reject retransmitted tokens
if token.aru = aru in token on last rotation ... do some logic

Here is how the current code works:

last_aru = instance->my_last_aru;
instance->my_last_aru = token->aru;
reject retransmitted tokens
if token.aru = aru in token on last rotation ... do some logic

The issue is last_aru will be set to token->aru when a token retransmission
occurs before a new token arrives.

This results in the "do some logic" part happening more often then it should.    


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2917 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-06-01 20:35:53 +00:00
Steven Dake
c3a6b98bdc The static function 'decode_mode()' is used by the static function
'dump_subsys_config()' which is is turn used by the static function
'dump_full_config()' which is never used.

Are these functions used by someone using some magic? I did not find
any reference and even the flag LOGSYS_DEBUG, which prevents them from
compiling, does not exist at some other point.

If these functions are really not used, please remove them (because at
least one of them has a buffer overflow). Patch against 1.2.3
is attached.

If there is a need for these functions, I'll send a patch to fix
the 'decode_mode()' function.

Kind regards

Andreas Florath

Signed-off-by: Andreas Florath <gnu4u at flonatel dot org>



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2915 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-28 20:39:58 +00:00