Skip to content

Commit

Permalink
libqb: change ipc -> qb_ipc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
asalkeld committed Aug 9, 2011
1 parent fce8a3c commit c6895fa
Show file tree
Hide file tree
Showing 76 changed files with 2,345 additions and 5,037 deletions.
8 changes: 0 additions & 8 deletions corosync.spec.in
Expand Up @@ -237,8 +237,6 @@ This package contains corosync libraries.
%{_libdir}/libevs.so.*
%{_libdir}/libtotem_pg.so.*
%{_libdir}/liblogsys.so.*
%{_libdir}/libcoroipcc.so.*
%{_libdir}/libcoroipcs.so.*
%{_libdir}/libquorum.so.*
%{_libdir}/libvotequorum.so.*
%{_libdir}/libpload.so.*
Expand Down Expand Up @@ -266,9 +264,6 @@ The Corosync Cluster Engine APIs.
%dir %{_includedir}/corosync/
%{_includedir}/corosync/cs_config.h
%{_includedir}/corosync/corodefs.h
%{_includedir}/corosync/coroipc_types.h
%{_includedir}/corosync/coroipcs.h
%{_includedir}/corosync/coroipcc.h
%{_includedir}/corosync/cfg.h
%{_includedir}/corosync/confdb.h
%{_includedir}/corosync/corotypes.h
Expand Down Expand Up @@ -301,8 +296,6 @@ The Corosync Cluster Engine APIs.
%{_libdir}/libevs.so
%{_libdir}/libtotem_pg.so
%{_libdir}/liblogsys.so
%{_libdir}/libcoroipcc.so
%{_libdir}/libcoroipcs.so
%{_libdir}/libquorum.so
%{_libdir}/libvotequorum.so
%{_libdir}/libpload.so
Expand All @@ -318,7 +311,6 @@ The Corosync Cluster Engine APIs.
%{_mandir}/man8/confdb_overview.8*
%{_mandir}/man8/logsys_overview.8*
%{_mandir}/man8/votequorum_overview.8*
%{_mandir}/man8/coroipc_overview.8*
%{_mandir}/man8/sam_overview.8*

%changelog
Expand Down
8 changes: 4 additions & 4 deletions cts/agents/Makefile.am
Expand Up @@ -58,19 +58,19 @@ endif
noinst_HEADERS = common_test_agent.h

cpg_test_agent_SOURCES = cpg_test_agent.c common_test_agent.c
cpg_test_agent_LDADD = -lcpg -lcfg -lcoroipcc ../../exec/crypto.o $(LIBQB_LIBS)
cpg_test_agent_LDADD = -lcpg -lcfg ../../exec/crypto.o $(LIBQB_LIBS)
cpg_test_agent_LDFLAGS = -L../../lib -L.

confdb_test_agent_SOURCES = confdb_test_agent.c common_test_agent.c
confdb_test_agent_LDADD = -lconfdb -lcoroipcc $(LIBQB_LIBS)
confdb_test_agent_LDADD = -lconfdb $(LIBQB_LIBS)
confdb_test_agent_LDFLAGS = -L../../lib

sam_test_agent_SOURCES = sam_test_agent.c common_test_agent.c
sam_test_agent_LDADD = -lsam -lquorum -lcoroipcc -lconfdb $(LIBQB_LIBS)
sam_test_agent_LDADD = -lsam -lquorum -lconfdb $(LIBQB_LIBS)
sam_test_agent_LDFLAGS = -L../../lib

votequorum_test_agent_SOURCES = votequorum_test_agent.c common_test_agent.c
votequorum_test_agent_LDADD = -lvotequorum -lquorum -lcoroipcc $(LIBQB_LIBS)
votequorum_test_agent_LDADD = -lvotequorum -lquorum $(LIBQB_LIBS)
votequorum_test_agent_LDFLAGS = -L../../lib

if BUILD_DARWIN
Expand Down
11 changes: 4 additions & 7 deletions cts/agents/cpg_test_agent.c
Expand Up @@ -92,7 +92,7 @@ static struct list_head msg_log_head;
static pid_t my_pid;
static uint32_t my_nodeid;
static int32_t my_seq;
static int32_t use_zcb = 0;
static int32_t use_zcb = QB_FALSE;
static int32_t my_msgs_to_send;
static int32_t total_stored_msgs = 0;
static int32_t in_cnchg = 0;
Expand Down Expand Up @@ -332,8 +332,6 @@ static void send_some_more_messages_later (void)
&more_messages_timer_handle);
}



static void send_some_more_messages_zcb (void)
{
msg_t *my_msg;
Expand Down Expand Up @@ -399,7 +397,6 @@ static void send_some_more_messages_zcb (void)
cpg_zcb_free (cpg_handle, zcb_buffer);
}


#define cs_repeat(counter, max, code) do { \
code; \
if(res == CS_ERR_TRY_AGAIN) { \
Expand Down Expand Up @@ -490,7 +487,7 @@ static void send_some_more_messages_normal (void)
static void send_some_more_messages (void * unused)
{
if (use_zcb) {
send_some_more_messages_zcb ();
// send_some_more_messages_zcb ();
} else {
send_some_more_messages_normal ();
}
Expand All @@ -502,7 +499,7 @@ static void msg_blaster (int sock, char* num_to_send_str)
my_seq = 1;
my_pid = getpid();

use_zcb = 0;
use_zcb = QB_FALSE;
total_stored_msgs = 0;

cpg_local_get (cpg_handle, &my_nodeid);
Expand Down Expand Up @@ -539,7 +536,7 @@ static void msg_blaster_zcb (int sock, char* num_to_send_str)
my_seq = 1;
my_pid = getpid();

use_zcb = 1;
use_zcb = QB_TRUE;
total_stored_msgs = 0;

cpg_local_get (cpg_handle, &my_nodeid);
Expand Down
4 changes: 1 addition & 3 deletions cts/agents/syncv2.c
Expand Up @@ -53,16 +53,14 @@

#include <corosync/swab.h>
#include <corosync/corotypes.h>
#include <corosync/coroipc_types.h>
#include <qb/qbipc_common.h>
#include <corosync/corodefs.h>
#include <corosync/lcr/lcr_comp.h>
#include <corosync/mar_gen.h>
#include <corosync/engine/coroapi.h>
#include <corosync/list.h>
#include <corosync/engine/logsys.h>

#include "../exec/tlist.h"

LOGSYS_DECLARE_SUBSYS ("TST2");

/*
Expand Down
29 changes: 4 additions & 25 deletions exec/Makefile.am
Expand Up @@ -43,29 +43,25 @@ TOTEM_SRC += totemiba.c
endif

LOGSYS_SRC = wthread.c logsys.c
COROIPCS_SRC = coroipcs.c

LCRSO_SRC = objdb.c vsf_ykd.c coroparse.c vsf_quorum.c
LCRSO_OBJS = $(LCRSO_SRC:%.c=%.o)
LCRSO = $(LCRSO_SRC:%.c=%.lcrso)

lib_LIBRARIES = libtotem_pg.a liblogsys.a libcoroipcs.a
lib_LIBRARIES = libtotem_pg.a liblogsys.a
sbin_PROGRAMS = corosync

libtotem_pg_a_SOURCES = $(TOTEM_SRC)
liblogsys_a_SOURCES = $(LOGSYS_SRC)
libcoroipcs_a_SOURCES = $(COROIPCS_SRC)

corosync_SOURCES = main.c util.c sync.c apidef.c service.c \
corosync_SOURCES = main.c ipc_glue.c util.c sync.c apidef.c service.c \
timer.c totemconfig.c mainconfig.c quorum.c schedwrk.c \
../lcr/lcr_ifact.c evil.c syncv2.c
corosync_LDADD = -ltotem_pg -llogsys -lcoroipcs $(statgrab_LIBS) $(LIBQB_LIBS)
corosync_DEPENDENCIES = libtotem_pg.so.$(SONAME) liblogsys.so.$(SONAME) libcoroipcs.so.$(SONAME)
corosync_LDADD = -ltotem_pg -llogsys $(LIBQB_LIBS) $(statgrab_LIBS)
corosync_DEPENDENCIES = libtotem_pg.so.$(SONAME) liblogsys.so.$(SONAME)
corosync_LDFLAGS = $(OS_DYFLAGS) -L./

TOTEM_OBJS = $(TOTEM_SRC:%.c=%.o)
LOGSYS_OBJS = $(LOGSYS_SRC:%.c=%.o)
COROIPCS_OBJS = $(COROIPCS_SRC:%.c=%.o)

SHARED_LIBS = $(lib_LIBRARIES:%.a=%.so.$(SONAME))
SHARED_LIBS_SO = $(SHARED_LIBS:%.so.$(SONAME)=%.so)
Expand Down Expand Up @@ -93,11 +89,6 @@ liblogsys.so.$(SONAME): $(LOGSYS_OBJS)
ln -sf liblogsys.so.$(SONAME) liblogsys.so
ln -sf liblogsys.so.$(SONAME) liblogsys.so.$(SOMAJOR)

libcoroipcs.so.$(SONAME): $(COROIPCS_OBJS)
$(CC) $(LDFLAGS) $(DARWIN_OPTS) $(COROIPCS_OBJS) -o $@ -lpthread
ln -sf libcoroipcs.so.$(SONAME) libcoroipcs.so
ln -sf libcoroipcs.so.$(SONAME) libcoroipcs.so.$(SOMAJOR)

else

if BUILD_SOLARIS
Expand All @@ -114,11 +105,6 @@ liblogsys.so.$(SONAME): $(LOGSYS_OBJS)
ln -sf liblogsys.so.$(SONAME) liblogsys.so
ln -sf liblogsys.so.$(SONAME) liblogsys.so.$(SOMAJOR)

libcoroipcs.so.$(SONAME): $(COROIPCS_OBJS)
$(LD) $(LDFLAGS) -G $(COROIPCS_OBJS) -o $@ -lpthread
ln -sf libcoroipcs.so.$(SONAME) libcoroipcs.so
ln -sf libcoroipcs.so.$(SONAME) libcoroipcs.so.$(SOMAJOR)

else

%.lcrso: %.o
Expand All @@ -138,13 +124,6 @@ liblogsys.so.$(SONAME): $(LOGSYS_OBJS)
ln -sf liblogsys.so.$(SONAME) liblogsys.so
ln -sf liblogsys.so.$(SONAME) liblogsys.so.$(SOMAJOR)

libcoroipcs.so.$(SONAME): $(COROIPCS_OBJS)
$(CC) -shared -o $@ \
-Wl,-soname=libcoroipcs.so.$(SOMAJOR) \
$(LDFLAGS) $^ -lpthread
ln -sf libcoroipcs.so.$(SONAME) libcoroipcs.so
ln -sf libcoroipcs.so.$(SONAME) libcoroipcs.so.$(SOMAJOR)

endif

endif
Expand Down
17 changes: 8 additions & 9 deletions exec/apidef.c
Expand Up @@ -38,13 +38,12 @@
#include <string.h>

#include <corosync/corotypes.h>
#include <corosync/coroipc_types.h>
#include <corosync/lcr/lcr_ifact.h>
#include <corosync/totem/totempg.h>
#include <corosync/totem/totemip.h>
#include <corosync/totem/totem.h>
#include <corosync/engine/logsys.h>
#include <corosync/coroipcs.h>
#include <qb/qbipcs.h>
#include "util.h"
#include "timer.h"
#include "sync.h"
Expand Down Expand Up @@ -101,13 +100,13 @@ static struct corosync_api_v1 apidef_corosync_api_v1 = {
.timer_expire_time_get = corosync_timer_expire_time_get,
.ipc_source_set = message_source_set,
.ipc_source_is_local = message_source_is_local,
.ipc_private_data_get = coroipcs_private_data_get,
.ipc_response_iov_send = coroipcs_response_iov_send,
.ipc_response_send = coroipcs_response_send,
.ipc_dispatch_send = coroipcs_dispatch_send,
.ipc_dispatch_iov_send = coroipcs_dispatch_iov_send,
.ipc_refcnt_inc = coroipcs_refcount_inc,
.ipc_refcnt_dec = coroipcs_refcount_dec,
.ipc_private_data_get = cs_ipcs_private_data_get,
.ipc_response_iov_send = cs_ipcs_response_iov_send,
.ipc_response_send = cs_ipcs_response_send,
.ipc_dispatch_send = cs_ipcs_dispatch_send,
.ipc_dispatch_iov_send = cs_ipcs_dispatch_iov_send,
.ipc_refcnt_inc = cs_ipc_refcnt_inc,
.ipc_refcnt_dec = cs_ipc_refcnt_dec,
.totem_nodeid_get = totempg_my_nodeid_get,
.totem_family_get = totempg_my_family_get,
.totem_ring_reenable = totempg_ring_reenable,
Expand Down

0 comments on commit c6895fa

Please sign in to comment.