diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..d853a2a6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +*.o +*.a +*.lcrso +*.so* +.deps +Makefile +Makefile.in +aclocal.m4 +autom4te.cache/ +config.guess +config.log +config.status +config.sub +configure +depcomp +install-sh +missing +tags +ID diff --git a/TODO b/TODO index 33afa173..21a7a518 100644 --- a/TODO +++ b/TODO @@ -1,25 +1,145 @@ -The Corosync Cluster Engine Work Items Requiring Attention -Last Updated: Mar 19, 2009 - -Generic Items -------------- -* doxygen-ize the include and lib directories. - -Totem ------ -* Disallow binding to localhost interface in redundant ring configuration. -* Implement the totem multiring protocol. - -Closed Process Groups ---------------------- -* async cpg multicast. - -IPC ---- -* none. - -SYNC ----- -* Forward compatible sync engine. -* Advanced Synchronization Engine needed to synchronize data without - long blocking delays during configuration changes. +------------------------------------------ +The Corosync Cluster Engine Topic Branches +------------------------------------------ + +-------------------------- +Last Updated: October 2010 +-------------------------- + +We use topic branches in our git repository to develop new disruptive features +that define our future roadmap. This file describes the topic branches +the developers have interest in investigating further. + +targets can be: whitetank, needle, or future (3.0+). +Finished can be: percentage or date merged to master. + +------------------------------------------------------------------------------ +topic-libqb +------------------------------------------------------------------------------ +Main Developer: Angus Salkeld +Started: September 2010 +Finished: 60% +target: needle +Description: +The libqb project is our effort to remove the core infrastructure required for +client server operations of corosync from the corosync code base and place +inside a separate project. + +The main purpose of this topic is to investigate integrating corosync with the +libqb package that has been refactored. Part of this effort also involves +investigation into single threaded operation of the IPC layer without +peformance penalties. + +------------------------------------------------------------------------------ +topic-rr +------------------------------------------------------------------------------ +Main Developer: Steven Dake +Started: Not Started +Finished: 0% +target: needle +Description: +Redundant ring may have quality problems near boundary conditions for sequence +numbers. This effort involves qualifying and hardening redundant ring around +these boundary numbers. A further stretch goal of this topic is to +automatically reenable a redundant ring when it has been back in service. + +------------------------------------------------------------------------------ +topic-snmp +------------------------------------------------------------------------------ +Main Developer: Steven Dake +Started: Not Started +Finished: 0% +target: needle +Description: +This topic involves investigation of adding SNMP support into Corosync. + +------------------------------------------------------------------------------ +topic-udpu +------------------------------------------------------------------------------ +Main Developer: Steven Dake +Started: October +Finished: 80% +target: needle +Description: +The UDPU transport mode offers a mechanism for Corosync to operate in network +environments where multicast or broadcast are prohibited. The main mechanism +it uses to do this is to UDP unicast to each of the target node IP addresses +listed in the configuation. + +------------------------------------------------------------------------------ +topic-onecrypt +------------------------------------------------------------------------------ +Main Developer: Honza Friesse +Started: not started +Finished: 0% +target: needle +Description: +Currently encryption code is located in totemudp.c, totemudpu.c, and iba has +no encryption support. This topic merges the encryption code into a new +file such as totemcrp.c and provides a mechanism for totemnet.c to register +encrypt and decrypt functions with totem[udp|iba|udpu] and use them as +requested by the configuration. + +------------------------------------------------------------------------------ +topic-netmalloc +------------------------------------------------------------------------------ +Main Developer: Steven Dake +Started: not started +Finished: 0% +target: needle +Description: +The totemiba.c driver must allocate memory and assign it to a protection domain +in order for an infiniband driver to transmit memory. In the current +implementation, totemsrp.c also allocates these same frames. This results in +an extra memcpy when transmitting with libibverbs technology. Memory copies +are to be avoided. The simple solution is to have each network driver provide +a memory allocation function. When totemsrp wants a free frame, it requests +it from the network driver. + +------------------------------------------------------------------------------ +topic-iazc +------------------------------------------------------------------------------ +Main Developer: Steven Dake +Started: not started +Finished: 0% +target: needle +Description: +The totempg.c file uses alloca/memcpy to deal with misaligned data structures +to avoid bus errors on hardware which does not support unaligned access. This +topic addresses the totempg.c code to avoid memory copies on platforms which +support unaligned access (x86/x86_64) and use the current alloca/memcpy +on platforms which don't (pretty much all other processor types). + +------------------------------------------------------------------------------ +topic-rdmaud +------------------------------------------------------------------------------ +Main Developer: Steven Dake +Started: not started +Finished: 0% +target: needle or future +Description: +Currently our RDMA code uses librdmacm to setup connections. We are not +certain this extra library is needed, and may be able to use only ibverbs. If +this is possible, the totem code may be more reliable, especially around +failure conditions. + +------------------------------------------------------------------------------ +topic-zerocopy +------------------------------------------------------------------------------ +Main Developer: Steven Dake +Started: not started +Finished: 0% +target: future +Description: +Totem has many copies involved in messaging which we would like to investigate +removing. Our goal is to deliver wire speed performance for rdma networks, +and if this can be achieved by our other topic investigations, we may not +further investigate this topic. The basic idea of the topic is to handle +message assembly/fragmentation in libcpg, and have totem be responsible for +sending these pages that are shared via posix shared memory. + +------------------------------------------------------------------------------ +other topics not yet defined: +* disallow binding to localhost interfae in redundant ring configuation. +* doxygenize include and lib directories. +* sort out binding to localhost in general diff --git a/cts/.gitignore b/cts/.gitignore new file mode 100644 index 00000000..6f99c8ff --- /dev/null +++ b/cts/.gitignore @@ -0,0 +1,2 @@ +CTSvars.py +*_test_agent diff --git a/exec/.gitignore b/exec/.gitignore new file mode 100644 index 00000000..d746f183 --- /dev/null +++ b/exec/.gitignore @@ -0,0 +1 @@ +corosync diff --git a/include/corosync/.gitignore b/include/corosync/.gitignore new file mode 100644 index 00000000..7c9b0fc9 --- /dev/null +++ b/include/corosync/.gitignore @@ -0,0 +1,3 @@ +config.h* +cs_config.h +stamp-* diff --git a/init/.gitignore b/init/.gitignore new file mode 100644 index 00000000..6ab38927 --- /dev/null +++ b/init/.gitignore @@ -0,0 +1 @@ +generic diff --git a/lcr/.gitignore b/lcr/.gitignore new file mode 100644 index 00000000..aafc88c2 --- /dev/null +++ b/lcr/.gitignore @@ -0,0 +1,3 @@ +test +test_static +uic diff --git a/man/.gitignore b/man/.gitignore new file mode 100644 index 00000000..2d19fc76 --- /dev/null +++ b/man/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/pkgconfig/.gitignore b/pkgconfig/.gitignore new file mode 100644 index 00000000..6fd0ef02 --- /dev/null +++ b/pkgconfig/.gitignore @@ -0,0 +1 @@ +*.pc diff --git a/test/.gitignore b/test/.gitignore new file mode 100644 index 00000000..f5a7b95a --- /dev/null +++ b/test/.gitignore @@ -0,0 +1,20 @@ +cpgbench +cpgbound +cpgverify +evsbench +evsverify +logsys_s +logsys_t1 +logsys_t2 +logsysbench +logsysrec +stress_cpgcontext +stress_cpgfdget +testconfdb +testcpg +testcpg2 +testevs +testquorum +testsam +testvotequorum1 +testvotequorum2 diff --git a/test/cpgverify.c b/test/cpgverify.c index c7b400a3..56a9b8b8 100644 --- a/test/cpgverify.c +++ b/test/cpgverify.c @@ -1,157 +1,173 @@ /* * Copyright (c) 2009 Red Hat, Inc. * * All rights reserved. * * Author: Steven Dake (sdake@redhat.com) * * This software licensed under BSD license, the text of which follows: * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * - Neither the name of the MontaVista Software, Inc. nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #include +#include #include #include #include #include #include #include #include #include #include #include "../exec/crypto.h" struct my_msg { unsigned int msg_size; unsigned char sha1[20]; unsigned char buffer[0]; }; static int deliveries = 0; static void cpg_deliver_fn ( cpg_handle_t handle, const struct cpg_name *group_name, uint32_t nodeid, uint32_t pid, void *m, size_t msg_len) { const struct my_msg *msg2 = m; unsigned char sha1_compare[20]; hash_state sha1_hash; unsigned int i; printf ("msg '%s'\n", msg2->buffer); sha1_init (&sha1_hash); sha1_process (&sha1_hash, msg2->buffer, msg2->msg_size); sha1_done (&sha1_hash, sha1_compare); printf ("SIZE %d HASH: ", msg2->msg_size); for (i = 0; i < 20; i++) { printf ("%x", sha1_compare[i]); } printf ("\n"); if (memcmp (sha1_compare, msg2->sha1, 20) != 0) { printf ("incorrect hash\n"); exit (1); } deliveries++; } static void cpg_confchg_fn ( cpg_handle_t handle, const struct cpg_name *group_name, const struct cpg_address *member_list, size_t member_list_entries, const struct cpg_address *left_list, size_t left_list_entries, const struct cpg_address *joined_list, size_t joined_list_entries) { } static cpg_callbacks_t callbacks = { cpg_deliver_fn, cpg_confchg_fn }; static struct cpg_name group_name = { .value = "cpg_bm", .length = 6 }; static unsigned char buffer[200000]; -int main (void) +int main (int argc, char *argv[]) { cpg_handle_t handle; cs_error_t result; - unsigned int i = 0, j; + int i = 0; + int j; struct my_msg msg; hash_state sha1_hash; struct iovec iov[2]; - int res; + const char *options = "i:"; + int iter = 1000; + int opt; + int run_forever = 1; + + while ((opt = getopt(argc, argv, options)) != -1) { + switch (opt) { + case 'i': + run_forever = 0; + iter = atoi(optarg); + break; + } + } result = cpg_initialize (&handle, &callbacks); if (result != CS_OK) { printf ("Couldn't initialize CPG service %d\n", result); exit (0); } - res = cpg_join (handle, &group_name); - if (res != CS_OK) { - printf ("cpg_join failed with result %d\n", res); + result = cpg_join (handle, &group_name); + if (result != CS_OK) { + printf ("cpg_join failed with result %d\n", result); exit (1); } iov[0].iov_base = (void *)&msg; iov[0].iov_len = sizeof (struct my_msg); iov[1].iov_base = (void *)buffer; /* * Demonstrate cpg_mcast_joined */ - for (i = 0; i < 1000000000; i++) { + i = 0; + do { msg.msg_size = 100 + rand() % 100000; iov[1].iov_len = msg.msg_size; for (j = 0; j < msg.msg_size; j++) { buffer[j] = j; } sprintf ((char *)buffer, "cpg_mcast_joined: This is message %12d", i); sha1_init (&sha1_hash); sha1_process (&sha1_hash, buffer, msg.msg_size); sha1_done (&sha1_hash, msg.sha1); try_again_one: result = cpg_mcast_joined (handle, CPG_TYPE_AGREED, iov, 2); if (result == CS_ERR_TRY_AGAIN) { goto try_again_one; } result = cpg_dispatch (handle, CS_DISPATCH_ALL); - } + i++; + } while (run_forever || i < iter); cpg_finalize (handle); return (0); } diff --git a/tools/.gitignore b/tools/.gitignore new file mode 100644 index 00000000..aa2eb2e9 --- /dev/null +++ b/tools/.gitignore @@ -0,0 +1,7 @@ +corosync-cfgtool +corosync-cpgtool +corosync-fplay +corosync-keygen +corosync-objctl +corosync-pload +corosync-quorumtool