Commit Graph

282 Commits

Author SHA1 Message Date
Angus Salkeld
21f1008be8 Clean up the poll loop resourses on exit
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-11-11 08:13:08 +11:00
Angus Salkeld
f5a31e55a2 Add calls to missing object_find_destroy() to fix mem leaks
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-11-11 08:12:13 +11:00
Anton Jouline
a358791d5b Adding support for dynamic membership with UDPU transport
Add a new object called totem.interface.dynamic to allow creation/deletion
of new child objects using the corosync-objctl utility:

to add new member:
linux#  corosync-objctl -c totem.interface.dynamic.10-211-55-12

to delete an existing member:
linux#  corosync-objctl -d totem.interface.dynamic.10-211-55-12

Corosync will dynamically add these members to the configuration and start
communicating with those nodes.

Signed-off-by: Anton Jouline <anton.jouline@cbsinteractive.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-10-27 23:52:16 -07:00
Jan Friesse
783dd4e553 Remove unused buf and len variables in log_printf
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-10-25 16:29:10 +02:00
Masatake YAMATO
721e2d2a2a Remove cloned lines in main of main.c
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2011-10-09 20:32:39 -07:00
Steven Dake
e920fef7e9 Get rid of hdb usage in totempg.h interface
hdb has some expense and is not necessary in the totempg.so runtime.  This
patch removes the dependence on hdb and instead uses a direct pointer.

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-08-23 22:29:01 -07:00
Steven Dake
67972efa7d use va version of external log function
This removes a sprintf operation in the totem and ipc logging operations

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-08-22 19:31:15 -07:00
Angus Salkeld
cdf5e95ab4 Make realtime scheduling optional not the default.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-08-09 10:37:16 +10:00
Angus Salkeld
37e17e7a94 libqb: logging & trace
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-08-09 10:37:16 +10:00
Angus Salkeld
a716f13bf9 Fix some compiler warnings
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-08-09 10:37:16 +10:00
Angus Salkeld
bd150728bf libqb: Improve IPC dispatch and async handling
Reviewed-by: Steven Dake <sdake@redhat.com>
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
2011-08-09 10:37:16 +10:00
Angus Salkeld
b8eae0e769 libqb: rip out objdb & serialize locks
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-08-09 10:37:15 +10:00
Angus Salkeld
b785c5ed08 libqb: use the main loop to shutdown
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-08-09 10:37:15 +10:00
Angus Salkeld
63e16ab583 libqb: remove tsafe.c
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-08-09 10:37:15 +10:00
Angus Salkeld
f717bc60e1 libqb: make timer api a wrapper around qb_loop timers.
- change timeout value to nano seconds
- fix timer handles (don't alloc on stack)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-08-09 10:37:14 +10:00
Angus Salkeld
c6895faa05 libqb: change ipc -> qb_ipc
IPC: return 0/-ENOBUFS from message handler
IPC: use the new rate_limit API to improve perf.
CPG: add send_async API & hook up flow control
IPC: Fix flow control getting stuck.
IPC: Port the remaining libs to use libqb IPC
IPC: remove libqb flowcontrol API
TEST: put cpg_dispatch() in it's own thread
IPC: cleanup ipc_glue.c name everything cs_ipcs_*()
IPC: add back statistics
IPC: remove coroipcc_ symbols from lib*.versions
IPC: init each se's IPC as it is loaded.
IPC: use the new connection_closed() event to free the context.
IPC: re-add zero copy functionality back
IPC: remove cpg_mcast_joined_async() and make it the default
 -> now cpg_mcast_joined() == cpg_mcast_joined_async()
libqb: expose a libqb error converter
libqb: add missing error conversions
libqb: remove repeat try loop in lib/cpg.c
CPG: fix zero copy mcast
CPG: use newer return codes
Add ENOTCONN to qb_to_cs_error()
libqb: fix error conversion from errno to cs_error_t in confdb
libqb: change errno_to_cs to qb_to_cs_error
libqb: add a cs_strerror() to get a more meaningful message
libqb: fix some confusing error conversions.
libqb: set the timeout on recv's to -1 (wait forever)

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-08-09 10:37:14 +10:00
Angus Salkeld
fce8a3c3b6 libqb: convert coropoll calls to qb_loop calls.
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-08-09 10:37:14 +10:00
Jan Friesse
d4fb83e971 main: let poll really stop before totempg_finalize
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-07-26 10:07:08 +02:00
Tim Beale
04f37df2f7 Add some more stats for debugging
+ overload - number of times client is told to try again
+ invalid_request - message contained invalid paramter, e.g. invalid size
+ msg_queue_avail - messages currently available at the Totem layer
+ msg-queue_reserved - messages currently reserved at the Totem layer

Signed-off-by: Tim Beale <tim.beale@alliedtelesis.co.nz>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-07-19 08:58:41 -07:00
Jan Friesse
8c717c22b2 Remove spinlocks
Spinlocks are now removed, because even spinlock can improve
speed is some special cases, in most cases it makes corosync CPU usage
much more intensive and less responsive then if only mutexes are used.

What we were doing is:
pthread_mutex_lock
pthread_spin_lock
pthread_spin_unlock
pthread_mutex_unlock

what is not safe.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-06-29 12:01:54 +02:00
Jerome Flesch
00434a4f10 Fix usage of strerror_r()/perror()
Signed-off-by: Jerome Flesch <jerome.flesch@netasq.com>
Reviewed-by: Angus Salkeld <asalkeld@redhat.com>
2011-06-28 09:56:58 +02:00
Steven Dake
ae4a3af340 sched_params log message incorrect
The sched_params parameter was set before being printed.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Reviewed-by:  <sdake@redhat.com>
2011-06-22 22:46:56 -07:00
Jerome Flesch
6bec0aa227 logsys: When corosync is compiled with --enable-small-memory-footprint, also reduce the size of the logsys SHM
Signed-off-by: Jerome Flesch <jerome.flesch@netasq.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-05-27 13:45:27 +02:00
Jerome Flesch
fe51e70367 Corosync: Fix build when done with --enable-fatal-warnings
Signed-off-by: Jerome Flesch <jerome.flesch@netasq.com>
Reviewed-by: Jan Friesse<jfriesse@redhat.com>
2011-05-27 13:29:12 +02:00
Angus Salkeld
0ad2494ae7 Fix some "set but not used" warnings [-Wunused-but-set-variable]
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-03-16 07:13:42 +11:00
Russell Bryant
c112ee8c89 Add content for the doxygen main page.
This creates some content on the main page of the documentation
generated by doxygen.  The main page includes the license and a link
to the project web site.

Signed-off-by: Russell Bryant <russell@russellbryant.net>
eviewed-by: Steven Dake <sdake@redhat.com>
2011-03-07 08:42:01 -06:00
Angus Salkeld
34cb488999 STATS: fix key name length on "join_count"
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Seven Dake <sdake@redhat.com>
2011-02-04 09:46:52 -07:00
Jan Friesse
5c951ac641 Add objdb firewall_enabled_or_nic_failure
New objdb var runtime.totem.pg.mrp.srp.firewall_enabled_or_nic_failure
is set to 1 if continuous_gather is larger then MAX_NO_CONT_GATHER.
Under normal conditions, value of variable is 0.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
2011-01-12 11:26:25 +01:00
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
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
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
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
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
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
Angus Salkeld
4ff33854ad add __attribute__((noreturn)) to functions that always exit.
we had some __attribute__((__noreturn__))
and some    __attribute__((noreturn))

I made them all: __attribute__((noreturn))



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2853 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-19 04:34:53 +00:00
Angus Salkeld
6bae61d835 log: remove "Member left/join" log messages
No longer needed by CTS and likely to be very noisy
with large node numbers.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2804 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-05 04:36:56 +00:00
Angus Salkeld
ea345ef0fd check and discard unknown messages
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2800 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-04 04:25:31 +00:00
Angus Salkeld
8ebe03efd5 diags: add a mechanism to trigger the writing the flight data
trigger the dumping of flight data using:
 corosync-objctl -w runtime.blackbox.dump_flight_data=anything
trigger the dumping of state using:
 corosync-objctl -w runtime.blackbox.dump_state=anything

then read the flight data as usual:
 corosync-fplay

This patch includes a wrapper script called:
 corosync-blackbox



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2799 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-04 00:56:25 +00:00
Jan Friesse
12c5f31a89 Handle some valgrind errors
- Memset for res_setup variable in coroipcs:req_setup_send
- Two memset in logsys for buffers
- Problem in corosync_totem_stats_updater where avg_token_holdtime has
size of avg_backlog_calc
- corosync_totem_stats_init where avg_backlog_calc is 32 bits (not 64)
- objdb problem if new_valie_len != object->value_len. In such case
newly allocated memory is not initialized and in some situations,
value_len is not updated.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2787 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-04-23 08:03:05 +00:00
Angus Salkeld
ce492d7008 add a list of member nodes into the objdb runtime tree.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2678 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-03-09 22:04:06 +00:00
Angus Salkeld
4e7ded5bf3 Add tsafe (thread safe) file to catch unsafe function calls.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2669 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-03-03 01:27:37 +00:00
Angus Salkeld
824fd8e82a Add a test harness to corosync that uses CTS from pacemaker.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2668 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-03-03 00:08:57 +00:00
Angus Salkeld
20f3331d0e convert strerror() into strerror_r()
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2665 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-02-25 19:28:36 +00:00
Angus Salkeld
5dd31150ee convert strtok to strtok_r
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2663 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-02-25 19:25:20 +00:00
Angus Salkeld
fdeea0b3b1 Add a debug message on node join/leave.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2662 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-02-18 20:12:14 +00:00
Jan Friesse
5a8200c1cb Fix corosync shutdown process
This patch change corosync shutdown process, so now:
- exit function of service engine is called
- all IPC connections are closed and removed from poll
- service engine is unlocked


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2657 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-02-16 11:29:14 +00:00
Angus Salkeld
c6beee076a pass transitional members into the sync_init() callbacks.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2653 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-02-04 00:18:51 +00:00