talloc_steal(tmp_ctx, hdr);
if (cnt == 0) {
- DEBUG(2,("Daemon has exited - shutting down client\n"));
+ DEBUG(DEBUG_INFO,("Daemon has exited - shutting down client\n"));
exit(0);
}
}
h->data = data;
- DEBUG(3,("ctdb_fetch_lock: key=%*.*s\n", (int)key.dsize, (int)key.dsize,
+ DEBUG(DEBUG_DEBUG,("ctdb_fetch_lock: key=%*.*s\n", (int)key.dsize, (int)key.dsize,
(const char *)key.dptr));
again:
return NULL;
}
- DEBUG(4,("ctdb_fetch_lock: got chain lock\n"));
+ DEBUG(DEBUG_DEBUG,("ctdb_fetch_lock: got chain lock\n"));
talloc_set_destructor(h, fetch_lock_destructor);
}
- DEBUG(4,("ctdb_fetch_lock: done local fetch\n"));
+ DEBUG(DEBUG_DEBUG,("ctdb_fetch_lock: done local fetch\n"));
if (ret != 0 || h->header.dmaster != ctdb_db->ctdb->pnn) {
ctdb_ltdb_unlock(ctdb_db, key);
ret = ctdb_client_force_migration(ctdb_db, key);
if (ret != 0) {
- DEBUG(4,("ctdb_fetch_lock: force_migration failed\n"));
+ DEBUG(DEBUG_DEBUG,("ctdb_fetch_lock: force_migration failed\n"));
talloc_free(h);
return NULL;
}
goto again;
}
- DEBUG(4,("ctdb_fetch_lock: we are dmaster - done\n"));
+ DEBUG(DEBUG_DEBUG,("ctdb_fetch_lock: we are dmaster - done\n"));
return h;
}
#include "system/wait.h"
#include "../include/ctdb_private.h"
-int LogLevel;
+int LogLevel = DEBUG_NOTICE;
+int this_log_level = 0;
/*
return error string for last error
*/
void ctdb_fatal(struct ctdb_context *ctdb, const char *msg)
{
- DEBUG(0,("ctdb fatal error: %s\n", msg));
+ DEBUG(DEBUG_ALERT,("ctdb fatal error: %s\n", msg));
abort();
}
DEBUG(0,("Unable to set scheduler to SCHED_FIFO (%s)\n",
strerror(errno)));
} else {
- DEBUG(0,("Set scheduler to SCHED_FIFO\n"));
+ DEBUG(DEBUG_NOTICE,("Set scheduler to SCHED_FIFO\n"));
}
#endif
}
return -1;
}
if (ARPHRD_LOOPBACK == if_hwaddr.ifr_hwaddr.sa_family) {
- DEBUG(3,("Ignoring loopback arp request\n"));
+ DEBUG(DEBUG_DEBUG,("Ignoring loopback arp request\n"));
close(s);
return 0;
}
struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
struct ibw_ctx *ictx = cn->conn->ctx;
- DEBUG(10, ("IBWC_ERROR, reconnecting...\n"));
+ DEBUG(DEBUG_DEBUG, ("IBWC_ERROR, reconnecting...\n"));
talloc_free(cn->conn); /* internal queue content is destroyed */
cn->conn = (void *)ibw_conn_new(ictx, node);
event_add_timed(node->ctdb->ev, node, timeval_current_ofs(1, 0),
{
struct ibw_ctx *ictx;
- DEBUG(10, ("ctdb_ibw_init invoked...\n"));
+ DEBUG(DEBUG_DEBUG, ("ctdb_ibw_init invoked...\n"));
ictx = ibw_init(
NULL, //struct ibw_initattr *attr, /* TODO */
0, //int nattr, /* TODO */
ctdb->methods = &ctdb_ibw_methods;
ctdb->private_data = ictx;
- DEBUG(10, ("ctdb_ibw_init succeeded.\n"));
+ DEBUG(DEBUG_DEBUG, ("ctdb_ibw_init succeeded.\n"));
return 0;
}
{
void *buf;
- DEBUG(10, ("ibw_alloc_mr(cmid=%p, n=%u)\n", pconn->cm_id, n));
+ DEBUG(DEBUG_DEBUG, ("ibw_alloc_mr(cmid=%p, n=%u)\n", pconn->cm_id, n));
buf = memalign(pctx->pagesize, n);
if (!buf) {
sprintf(ibw_lasterr, "couldn't allocate memory\n");
static void ibw_free_mr(char **ppbuf, struct ibv_mr **ppmr)
{
- DEBUG(10, ("ibw_free_mr(%p %p)\n", *ppbuf, *ppmr));
+ DEBUG(DEBUG_DEBUG, ("ibw_free_mr(%p %p)\n", *ppbuf, *ppmr));
if (*ppmr!=NULL) {
ibv_dereg_mr(*ppmr);
*ppmr = NULL;
int i;
struct ibw_wr *p;
- DEBUG(10, ("ibw_init_memory(cmid: %p)\n", pconn->cm_id));
+ DEBUG(DEBUG_DEBUG, ("ibw_init_memory(cmid: %p)\n", pconn->cm_id));
pconn->buf_send = ibw_alloc_mr(pctx, pconn,
opts->max_send_wr * opts->recv_bufsize, &pconn->mr_send);
if (!pconn->buf_send) {
static int ibw_ctx_priv_destruct(struct ibw_ctx_priv *pctx)
{
- DEBUG(10, ("ibw_ctx_priv_destruct(%p)\n", pctx));
+ DEBUG(DEBUG_DEBUG, ("ibw_ctx_priv_destruct(%p)\n", pctx));
/* destroy cm */
if (pctx->cm_channel) {
static int ibw_ctx_destruct(struct ibw_ctx *ctx)
{
- DEBUG(10, ("ibw_ctx_destruct(%p)\n", ctx));
+ DEBUG(DEBUG_DEBUG, ("ibw_ctx_destruct(%p)\n", ctx));
return 0;
}
static int ibw_conn_priv_destruct(struct ibw_conn_priv *pconn)
{
- DEBUG(10, ("ibw_conn_priv_destruct(%p, cmid: %p)\n",
+ DEBUG(DEBUG_DEBUG, ("ibw_conn_priv_destruct(%p, cmid: %p)\n",
pconn, pconn->cm_id));
/* pconn->wr_index is freed by talloc */
if (pconn->pd) {
ibv_dealloc_pd(pconn->pd);
pconn->pd = NULL;
- DEBUG(10, ("pconn=%p pd deallocated\n", pconn));
+ DEBUG(DEBUG_DEBUG, ("pconn=%p pd deallocated\n", pconn));
}
if (pconn->cm_id) {
rdma_destroy_id(pconn->cm_id);
pconn->cm_id = NULL;
- DEBUG(10, ("pconn=%p cm_id destroyed\n", pconn));
+ DEBUG(DEBUG_DEBUG, ("pconn=%p cm_id destroyed\n", pconn));
}
return 0;
static int ibw_conn_destruct(struct ibw_conn *conn)
{
- DEBUG(10, ("ibw_conn_destruct(%p)\n", conn));
+ DEBUG(DEBUG_DEBUG, ("ibw_conn_destruct(%p)\n", conn));
/* important here: ctx is a talloc _parent_ */
DLIST_REMOVE(conn->ctx->conn_list, conn);
struct ibv_qp_attr attr;
int rc;
- DEBUG(10, ("ibw_setup_cq_qp(cmid: %p)\n", pconn->cm_id));
+ DEBUG(DEBUG_DEBUG, ("ibw_setup_cq_qp(cmid: %p)\n", pconn->cm_id));
/* init verbs */
pconn->verbs_channel = ibv_create_comp_channel(pconn->cm_id->verbs);
sprintf(ibw_lasterr, "ibv_create_comp_channel failed %d\n", errno);
return -1;
}
- DEBUG(10, ("created channel %p\n", pconn->verbs_channel));
+ DEBUG(DEBUG_DEBUG, ("created channel %p\n", pconn->verbs_channel));
pconn->verbs_channel_event = event_add_fd(pctx->ectx, NULL, /* not pconn or conn */
pconn->verbs_channel->fd, EVENT_FD_READ, ibw_event_handler_verbs, conn);
sprintf(ibw_lasterr, "ibv_alloc_pd failed %d\n", errno);
return -1;
}
- DEBUG(10, ("created pd %p\n", pconn->pd));
+ DEBUG(DEBUG_DEBUG, ("created pd %p\n", pconn->pd));
/* init mr */
if (ibw_init_memory(conn))
};
struct ibv_recv_wr *bad_wr;
- DEBUG(10, ("ibw_refill_cq_recv(cmid: %p)\n", pconn->cm_id));
+ DEBUG(DEBUG_DEBUG, ("ibw_refill_cq_recv(cmid: %p)\n", pconn->cm_id));
list.addr = (uintptr_t) pconn->buf_recv + pctx->opts.recv_bufsize * pconn->recv_index;
wr.wr_id = pconn->recv_index;
};
struct ibv_recv_wr *bad_wr;
- DEBUG(10, ("ibw_fill_cq(cmid: %p)\n", pconn->cm_id));
+ DEBUG(DEBUG_DEBUG, ("ibw_fill_cq(cmid: %p)\n", pconn->cm_id));
for(i = pctx->opts.max_recv_wr; i!=0; i--) {
list.addr = (uintptr_t) pconn->buf_recv + pctx->opts.recv_bufsize * pconn->recv_index;
struct ibw_conn_priv *pconn = talloc_get_type(conn->internal, struct ibw_conn_priv);
int rc;
- DEBUG(10, ("ibw_manage_connect(cmid: %p)\n", pconn->cm_id));
+ DEBUG(DEBUG_DEBUG, ("ibw_manage_connect(cmid: %p)\n", pconn->cm_id));
if (ibw_setup_cq_qp(conn))
return -1;
}
cma_id = event->id;
- DEBUG(10, ("cma_event type %d cma_id %p (%s)\n", event->event, cma_id,
+ DEBUG(DEBUG_DEBUG, ("cma_event type %d cma_id %p (%s)\n", event->event, cma_id,
(cma_id == pctx->cm_id) ? "parent" : "child"));
switch (event->event) {
case RDMA_CM_EVENT_ADDR_RESOLVED:
- DEBUG(11, ("RDMA_CM_EVENT_ADDR_RESOLVED\n"));
+ DEBUG(DEBUG_DEBUG, ("RDMA_CM_EVENT_ADDR_RESOLVED\n"));
/* continuing from ibw_connect ... */
rc = rdma_resolve_route(cma_id, 2000);
if (rc) {
break;
case RDMA_CM_EVENT_ROUTE_RESOLVED:
- DEBUG(11, ("RDMA_CM_EVENT_ROUTE_RESOLVED\n"));
+ DEBUG(DEBUG_DEBUG, ("RDMA_CM_EVENT_ROUTE_RESOLVED\n"));
/* after RDMA_CM_EVENT_ADDR_RESOLVED: */
assert(cma_id->context!=NULL);
conn = talloc_get_type(cma_id->context, struct ibw_conn);
break;
case RDMA_CM_EVENT_CONNECT_REQUEST:
- DEBUG(11, ("RDMA_CM_EVENT_CONNECT_REQUEST\n"));
+ DEBUG(DEBUG_DEBUG, ("RDMA_CM_EVENT_CONNECT_REQUEST\n"));
ctx->state = IBWS_CONNECT_REQUEST;
conn = ibw_conn_new(ctx, ctx);
pconn = talloc_get_type(conn->internal, struct ibw_conn_priv);
pconn->cm_id = cma_id; /* !!! event will be freed but id not */
cma_id->context = (void *)conn;
- DEBUG(10, ("pconn->cm_id %p\n", pconn->cm_id));
+ DEBUG(DEBUG_DEBUG, ("pconn->cm_id %p\n", pconn->cm_id));
if (ibw_setup_cq_qp(conn))
goto error;
if (rc)
DEBUG(0, ("rdma_reject failed with rc=%d\n", rc));
talloc_free(conn);
- DEBUG(10, ("pconn->cm_id %p wasn't accepted\n", pconn->cm_id));
+ DEBUG(DEBUG_DEBUG, ("pconn->cm_id %p wasn't accepted\n", pconn->cm_id));
}
/* TODO: clarify whether if it's needed by upper layer: */
case RDMA_CM_EVENT_ESTABLISHED:
/* expected after ibw_accept and ibw_connect[not directly] */
- DEBUG(1, ("ESTABLISHED (conn: %p)\n", cma_id->context));
+ DEBUG(DEBUG_INFO, ("ESTABLISHED (conn: %p)\n", cma_id->context));
conn = talloc_get_type(cma_id->context, struct ibw_conn);
assert(conn!=NULL); /* important assumption */
- DEBUG(10, ("ibw_setup_cq_qp succeeded (cmid=%p)\n", cma_id));
+ DEBUG(DEBUG_DEBUG, ("ibw_setup_cq_qp succeeded (cmid=%p)\n", cma_id));
/* client conn is up */
conn->state = IBWC_CONNECTED;
goto error;
case RDMA_CM_EVENT_REJECTED:
sprintf(ibw_lasterr, "RDMA_CM_EVENT_REJECTED, error %d\n", event->status);
- DEBUG(1, ("cm event handler: %s", ibw_lasterr));
+ DEBUG(DEBUG_INFO, ("cm event handler: %s", ibw_lasterr));
conn = talloc_get_type(cma_id->context, struct ibw_conn);
if (conn) {
/* must be done BEFORE connstate */
break; /* this is not strictly an error */
case RDMA_CM_EVENT_DISCONNECTED:
- DEBUG(11, ("RDMA_CM_EVENT_DISCONNECTED\n"));
+ DEBUG(DEBUG_DEBUG, ("RDMA_CM_EVENT_DISCONNECTED\n"));
if ((rc=rdma_ack_cm_event(event)))
DEBUG(0, ("disc/rdma_ack_cm_event failed with %d\n", rc));
event = NULL; /* don't ack more */
struct ibv_cq *ev_cq;
void *ev_ctx;
- DEBUG(10, ("ibw_event_handler_verbs(%u)\n", (uint32_t)flags));
+ DEBUG(DEBUG_DEBUG, ("ibw_event_handler_verbs(%u)\n", (uint32_t)flags));
/* TODO: check whether if it's good to have more channels here... */
rc = ibv_get_cq_event(pconn->verbs_channel, &ev_cq, &ev_ctx);
switch(wc.opcode) {
case IBV_WC_SEND:
- DEBUG(10, ("send completion\n"));
+ DEBUG(DEBUG_DEBUG, ("send completion\n"));
if (ibw_wc_send(conn, &wc))
goto error;
break;
case IBV_WC_RDMA_WRITE:
- DEBUG(10, ("rdma write completion\n"));
+ DEBUG(DEBUG_DEBUG, ("rdma write completion\n"));
break;
case IBV_WC_RDMA_READ:
- DEBUG(10, ("rdma read completion\n"));
+ DEBUG(DEBUG_DEBUG, ("rdma read completion\n"));
break;
case IBV_WC_RECV:
- DEBUG(10, ("recv completion\n"));
+ DEBUG(DEBUG_DEBUG, ("recv completion\n"));
if (ibw_wc_recv(conn, &wc))
goto error;
break;
assert(p->queued_msg!=NULL);
assert(msg_size!=0);
- DEBUG(10, ("ibw_process_queue refcnt=%d msgsize=%u\n",
+ DEBUG(DEBUG_DEBUG, ("ibw_process_queue refcnt=%d msgsize=%u\n",
p->queued_ref_cnt, msg_size));
rc = ibw_send_packet(conn, p->queued_msg, p, msg_size);
struct ibw_wr *p;
int send_index;
- DEBUG(10, ("ibw_wc_send(cmid: %p, wr_id: %u, bl: %u)\n",
+ DEBUG(DEBUG_DEBUG, ("ibw_wc_send(cmid: %p, wr_id: %u, bl: %u)\n",
pconn->cm_id, (uint32_t)wc->wr_id, (uint32_t)wc->byte_len));
assert(pconn->cm_id->qp->qp_num==wc->qp_num);
pconn->wr_sent--;
if (send_index < pctx->opts.max_send_wr) {
- DEBUG(10, ("ibw_wc_send#1 %u\n", (int)wc->wr_id));
+ DEBUG(DEBUG_DEBUG, ("ibw_wc_send#1 %u\n", (int)wc->wr_id));
p = pconn->wr_index[send_index];
if (p->buf_large!=NULL) {
if (p->ref_cnt) {
DLIST_ADD(pconn->wr_list_avail, p);
}
} else { /* "extra" request - not optimized */
- DEBUG(10, ("ibw_wc_send#2 %u\n", (int)wc->wr_id));
+ DEBUG(DEBUG_DEBUG, ("ibw_wc_send#2 %u\n", (int)wc->wr_id));
for(p=pconn->extra_sent; p!=NULL; p=p->next)
if ((p->wr_id + pctx->opts.max_recv_wr)==(int)wc->wr_id)
break;
static int ibw_append_to_part(struct ibw_conn_priv *pconn,
struct ibw_part *part, char **pp, uint32_t add_len, int info)
{
- DEBUG(10, ("ibw_append_to_part: cmid=%p, (bs=%u, len=%u, tr=%u), al=%u, i=%u\n",
+ DEBUG(DEBUG_DEBUG, ("ibw_append_to_part: cmid=%p, (bs=%u, len=%u, tr=%u), al=%u, i=%u\n",
pconn->cm_id, part->bufsize, part->len, part->to_read, add_len, info));
/* allocate more if necessary - it's an "evergrowing" buffer... */
static int ibw_wc_mem_threshold(struct ibw_conn_priv *pconn,
struct ibw_part *part, uint32_t threshold)
{
- DEBUG(10, ("ibw_wc_mem_threshold: cmid=%p, (bs=%u, len=%u, tr=%u), thr=%u\n",
+ DEBUG(DEBUG_DEBUG, ("ibw_wc_mem_threshold: cmid=%p, (bs=%u, len=%u, tr=%u), thr=%u\n",
pconn->cm_id, part->bufsize, part->len, part->to_read, threshold));
if (part->bufsize > threshold) {
- DEBUG(3, ("ibw_wc_mem_threshold: cmid=%p, %u > %u\n",
+ DEBUG(DEBUG_DEBUG, ("ibw_wc_mem_threshold: cmid=%p, %u > %u\n",
pconn->cm_id, part->bufsize, threshold));
talloc_free(part->buf);
part->buf = talloc_size(pconn, threshold);
char *p;
uint32_t remain = wc->byte_len;
- DEBUG(10, ("ibw_wc_recv: cmid=%p, wr_id: %u, bl: %u\n",
+ DEBUG(DEBUG_DEBUG, ("ibw_wc_recv: cmid=%p, wr_id: %u, bl: %u\n",
pconn->cm_id, (uint32_t)wc->wr_id, remain));
assert(pconn->cm_id->qp->qp_num==wc->qp_num);
int i;
const char *name, *value;
- DEBUG(10, ("ibw_process_init_attrs: nattr: %d\n", nattr));
+ DEBUG(DEBUG_DEBUG, ("ibw_process_init_attrs: nattr: %d\n", nattr));
opts->max_send_wr = IBW_MAX_SEND_WR;
opts->max_recv_wr = IBW_MAX_RECV_WR;
struct ibw_ctx_priv *pctx;
int rc;
- DEBUG(10, ("ibw_init(ctx_userdata: %p, ectx: %p)\n", ctx_userdata, ectx));
+ DEBUG(DEBUG_DEBUG, ("ibw_init(ctx_userdata: %p, ectx: %p)\n", ctx_userdata, ectx));
/* initialize basic data structures */
memset(ibw_lasterr, 0, IBW_LASTERR_BUFSIZE);
sprintf(ibw_lasterr, "rdma_create_id error %d\n", rc);
goto cleanup;
}
- DEBUG(10, ("created cm_id %p\n", pctx->cm_id));
+ DEBUG(DEBUG_DEBUG, ("created cm_id %p\n", pctx->cm_id));
pctx->pagesize = sysconf(_SC_PAGESIZE);
struct ibw_ctx_priv *pctx = (struct ibw_ctx_priv *)ctx->internal;
struct ibw_conn *p;
- DEBUG(10, ("ibw_stop\n"));
+ DEBUG(DEBUG_DEBUG, ("ibw_stop\n"));
for(p=ctx->conn_list; p!=NULL; p=p->next) {
if (ctx->state==IBWC_ERROR || ctx->state==IBWC_CONNECTED) {
struct ibw_ctx_priv *pctx = (struct ibw_ctx_priv *)ctx->internal;
int rc;
- DEBUG(10, ("ibw_bind: addr=%s, port=%u\n",
+ DEBUG(DEBUG_DEBUG, ("ibw_bind: addr=%s, port=%u\n",
inet_ntoa(my_addr->sin_addr), ntohs(my_addr->sin_port)));
rc = rdma_bind_addr(pctx->cm_id, (struct sockaddr *) my_addr);
if (rc) {
DEBUG(0, (ibw_lasterr));
return rc;
}
- DEBUG(10, ("rdma_bind_addr successful\n"));
+ DEBUG(DEBUG_DEBUG, ("rdma_bind_addr successful\n"));
return 0;
}
struct ibw_ctx_priv *pctx = talloc_get_type(ctx->internal, struct ibw_ctx_priv);
int rc;
- DEBUG(10, ("ibw_listen\n"));
+ DEBUG(DEBUG_DEBUG, ("ibw_listen\n"));
rc = rdma_listen(pctx->cm_id, backlog);
if (rc) {
sprintf(ibw_lasterr, "rdma_listen failed: %d\n", rc);
struct rdma_conn_param conn_param;
int rc;
- DEBUG(10, ("ibw_accept: cmid=%p\n", pconn->cm_id));
+ DEBUG(DEBUG_DEBUG, ("ibw_accept: cmid=%p\n", pconn->cm_id));
conn->conn_userdata = conn_userdata;
memset(&conn_param, 0, sizeof(struct rdma_conn_param));
conn->conn_userdata = conn_userdata;
pconn = talloc_get_type(conn->internal, struct ibw_conn_priv);
- DEBUG(10, ("ibw_connect: addr=%s, port=%u\n", inet_ntoa(serv_addr->sin_addr),
+ DEBUG(DEBUG_DEBUG, ("ibw_connect: addr=%s, port=%u\n", inet_ntoa(serv_addr->sin_addr),
ntohs(serv_addr->sin_port)));
/* clean previous - probably half - initialization */
talloc_free(conn);
return -1;
}
- DEBUG(10, ("ibw_connect: rdma_create_id succeeded, cm_id=%p\n", pconn->cm_id));
+ DEBUG(DEBUG_DEBUG, ("ibw_connect: rdma_create_id succeeded, cm_id=%p\n", pconn->cm_id));
rc = rdma_resolve_addr(pconn->cm_id, NULL, (struct sockaddr *) serv_addr, 2000);
if (rc) {
int rc;
struct ibw_conn_priv *pconn = talloc_get_type(conn->internal, struct ibw_conn_priv);
- DEBUG(10, ("ibw_disconnect: cmid=%p\n", pconn->cm_id));
+ DEBUG(DEBUG_DEBUG, ("ibw_disconnect: cmid=%p\n", pconn->cm_id));
assert(pconn!=NULL);
}
break;
default:
- DEBUG(9, ("invalid state for disconnect: %d\n", conn->state));
+ DEBUG(DEBUG_DEBUG, ("invalid state for disconnect: %d\n", conn->state));
break;
}
struct ibw_wr *p = pconn->wr_list_avail;
if (p!=NULL) {
- DEBUG(10, ("ibw_alloc_send_buf#1: cmid=%p, len=%d\n", pconn->cm_id, len));
+ DEBUG(DEBUG_DEBUG, ("ibw_alloc_send_buf#1: cmid=%p, len=%d\n", pconn->cm_id, len));
DLIST_REMOVE(pconn->wr_list_avail, p);
DLIST_ADD(pconn->wr_list_used, p);
}
/* p->wr_id is already filled in ibw_init_memory */
} else {
- DEBUG(10, ("ibw_alloc_send_buf#2: cmid=%p, len=%d\n", pconn->cm_id, len));
+ DEBUG(DEBUG_DEBUG, ("ibw_alloc_send_buf#2: cmid=%p, len=%d\n", pconn->cm_id, len));
/* not optimized */
p = pconn->extra_avail;
if (!p) {
p->wr_id = pctx->opts.max_send_wr + pconn->extra_max;
pconn->extra_max++;
switch(pconn->extra_max) {
- case 1: DEBUG(2, ("warning: queue performed\n")); break;
+ case 1: DEBUG(DEBUG_INFO, ("warning: queue performed\n")); break;
case 10: DEBUG(0, ("warning: queue reached 10\n")); break;
case 100: DEBUG(0, ("warning: queue reached 100\n")); break;
case 1000: DEBUG(0, ("warning: queue reached 1000\n")); break;
};
if (p->buf_large==NULL) {
- DEBUG(10, ("ibw_send#normal(cmid: %p, wrid: %u, n: %d)\n",
+ DEBUG(DEBUG_DEBUG, ("ibw_send#normal(cmid: %p, wrid: %u, n: %d)\n",
pconn->cm_id, (uint32_t)wr.wr_id, len));
} else {
- DEBUG(10, ("ibw_send#large(cmid: %p, wrid: %u, n: %d)\n",
+ DEBUG(DEBUG_DEBUG, ("ibw_send#large(cmid: %p, wrid: %u, n: %d)\n",
pconn->cm_id, (uint32_t)wr.wr_id, len));
list.lkey = p->mr_large->lkey;
}
return rc;
} /* else put the request into our own queue: */
- DEBUG(10, ("ibw_send#queued(cmid: %p, len: %u)\n", pconn->cm_id, len));
+ DEBUG(DEBUG_DEBUG, ("ibw_send#queued(cmid: %p, len: %u)\n", pconn->cm_id, len));
/* TODO: clarify how to continue when state==IBWC_STOPPED */
char *packet = (char *)buf;
uint32_t recv_bufsize = pctx->opts.recv_bufsize;
- DEBUG(10, ("ibw_send#frag(cmid: %p, buf: %p, len: %u)\n",
+ DEBUG(DEBUG_DEBUG, ("ibw_send#frag(cmid: %p, buf: %p, len: %u)\n",
pconn->cm_id, buf, len));
/* single threaded => no race here: */
/* parallel case */
if (p->wr_id < pctx->opts.max_send_wr) {
- DEBUG(10, ("ibw_cancel_send_buf#1 %u", (int)p->wr_id));
+ DEBUG(DEBUG_DEBUG, ("ibw_cancel_send_buf#1 %u", (int)p->wr_id));
DLIST_REMOVE(pconn->wr_list_used, p);
DLIST_ADD(pconn->wr_list_avail, p);
} else { /* "extra" packet */
- DEBUG(10, ("ibw_cancel_send_buf#2 %u", (int)p->wr_id));
+ DEBUG(DEBUG_DEBUG, ("ibw_cancel_send_buf#2 %u", (int)p->wr_id));
DLIST_REMOVE(pconn->extra_sent, p);
DLIST_ADD(pconn->extra_avail, p);
}
return -1;
}
}
- DEBUG(10, ("sent %d connect request...\n", tcx->naddrs));
+ DEBUG(DEBUG_DEBUG, ("sent %d connect request...\n", tcx->naddrs));
return 0;
}
void *key;
uint32_t len;
- DEBUG(10, ("ibwtest_send_id\n"));
+ DEBUG(DEBUG_DEBUG, ("ibwtest_send_id\n"));
len = sizeof(uint32_t)+strlen(tcx->id)+2;
if (ibw_alloc_send_buf(conn, (void **)&buf, &key, len)) {
DEBUG(0, ("send_id: ibw_alloc_send_buf failed\n"));
switch(ctx->state) {
case IBWS_INIT:
- DEBUG(10, ("test IBWS_INIT\n"));
+ DEBUG(DEBUG_DEBUG, ("test IBWS_INIT\n"));
break;
case IBWS_READY:
- DEBUG(10, ("test IBWS_READY\n"));
+ DEBUG(DEBUG_DEBUG, ("test IBWS_READY\n"));
break;
case IBWS_CONNECT_REQUEST:
- DEBUG(10, ("test IBWS_CONNECT_REQUEST\n"));
+ DEBUG(DEBUG_DEBUG, ("test IBWS_CONNECT_REQUEST\n"));
tconn = talloc_zero(conn, struct ibwtest_conn);
if (ibw_accept(ctx, conn, tconn)) {
DEBUG(0, ("error accepting the connect request\n"));
}
break;
case IBWS_STOPPED:
- DEBUG(10, ("test IBWS_STOPPED\n"));
+ DEBUG(DEBUG_DEBUG, ("test IBWS_STOPPED\n"));
tcx->kill_me = 1; /* main loop can exit */
break;
case IBWS_ERROR:
- DEBUG(10, ("test IBWS_ERROR\n"));
+ DEBUG(DEBUG_DEBUG, ("test IBWS_ERROR\n"));
ibw_stop(tcx->ibwctx);
break;
default:
tconn = talloc_get_type(conn->conn_userdata, struct ibwtest_conn);
switch(conn->state) {
case IBWC_INIT:
- DEBUG(10, ("test IBWC_INIT\n"));
+ DEBUG(DEBUG_DEBUG, ("test IBWC_INIT\n"));
break;
case IBWC_CONNECTED:
if (gettimeofday(&tcx->start_time, NULL)) {
ibwtest_send_id(conn);
break;
case IBWC_DISCONNECTED:
- DEBUG(10, ("test IBWC_DISCONNECTED\n"));
+ DEBUG(DEBUG_DEBUG, ("test IBWC_DISCONNECTED\n"));
talloc_free(conn);
break;
case IBWC_ERROR:
- DEBUG(10, ("test IBWC_ERROR %s\n", ibw_getLastError()));
+ DEBUG(DEBUG_DEBUG, ("test IBWC_ERROR %s\n", ibw_getLastError()));
break;
default:
assert(0);
tconn->id = talloc_strdup(tconn, ((char *)buf)+sizeof(uint32_t)+1);
}
if (op==TESTOP_SEND_ID || op==TESTOP_SEND_TEXT) {
- DEBUG(11, ("[%d]msg from %s: \"%s\"(%d)\n", op,
+ DEBUG(DEBUG_DEBUG, ("[%d]msg from %s: \"%s\"(%d)\n", op,
tconn->id ? tconn->id : "NULL", ((char *)buf)+sizeof(uint32_t)+1, n));
}
unsigned char sum;
sum = ibwtest_get_sum((unsigned char *)buf + sizeof(uint32_t) + 1,
n - sizeof(uint32_t) - 2);
- DEBUG(11, ("[%d]msg varsize %u/sum %u from %s\n",
+ DEBUG(DEBUG_DEBUG, ("[%d]msg varsize %u/sum %u from %s\n",
op,
n - sizeof(uint32_t) - 2,
(uint32_t)sum,
testctx->ibwctx->state==IBWS_ERROR)
{
if (testctx->stopping) {
- DEBUG(10, ("forcing exit...\n"));
+ DEBUG(DEBUG_DEBUG, ("forcing exit...\n"));
testctx->kill_me = 1;
} else {
/* mostly expected case */
#define False 0
extern int LogLevel;
-
-#define DEBUG(lvl, x) if ((lvl) <= LogLevel) (do_debug x)
+extern int this_log_level;
+
+enum debug_level {
+ DEBUG_EMERG = -3,
+ DEBUG_ALERT = -2,
+ DEBUG_CRIT = -1,
+ DEBUG_ERR = 0,
+ DEBUG_WARNING = 1,
+ DEBUG_NOTICE = 2,
+ DEBUG_INFO = 3,
+ DEBUG_DEBUG = 4,
+};
+
+#define DEBUG(lvl, x) do { if ((lvl) <= LogLevel) { this_log_level = (lvl); do_debug x; }} while (0)
#define _PUBLIC_
struct ctdb_context *ctdb = ctdb_db->ctdb;
struct ctdb_ltdb_header header;
- DEBUG(2,("pnn %u dmaster response %08x\n", ctdb->pnn, ctdb_hash(&key)));
+ DEBUG(DEBUG_INFO,("pnn %u dmaster response %08x\n", ctdb->pnn, ctdb_hash(&key)));
ZERO_STRUCT(header);
header.rsn = rsn + 1;
return;
}
if (ret == -2) {
- DEBUG(2,(__location__ " deferring ctdb_request_dmaster\n"));
+ DEBUG(DEBUG_INFO,(__location__ " deferring ctdb_request_dmaster\n"));
return;
}
ctdb_fatal(ctdb, "ctdb_req_dmaster to non-lmaster");
}
- DEBUG(2,("pnn %u dmaster request on %08x for %u from %u\n",
+ DEBUG(DEBUG_INFO,("pnn %u dmaster request on %08x for %u from %u\n",
ctdb->pnn, ctdb_hash(&key), c->dmaster, c->hdr.srcnode));
/* its a protocol error if the sending node is not the current dmaster */
return;
}
if (ret == -2) {
- DEBUG(2,(__location__ " deferred ctdb_request_call\n"));
+ DEBUG(DEBUG_INFO,(__location__ " deferred ctdb_request_call\n"));
return;
}
((header.laccessor == c->hdr.srcnode
&& header.lacount >= ctdb->tunable.max_lacount)
|| (c->flags & CTDB_IMMEDIATE_MIGRATION)) ) {
- DEBUG(2,("pnn %u starting migration of %08x to %u\n",
+ DEBUG(DEBUG_INFO,("pnn %u starting migration of %08x to %u\n",
ctdb->pnn, ctdb_hash(&call.key), c->hdr.srcnode));
ctdb_call_send_dmaster(ctdb_db, c, &header, &call.key, &data);
talloc_free(data.dptr);
ctdb->nodes[c->pnn]->flags =
(ctdb->nodes[c->pnn]->flags&NODE_FLAGS_DISCONNECTED)
| (c->new_flags & ~NODE_FLAGS_DISCONNECTED);
- DEBUG(2,("Node flags for node %u are now 0x%x\n", c->pnn, ctdb->nodes[c->pnn]->flags));
+ DEBUG(DEBUG_INFO,("Node flags for node %u are now 0x%x\n", c->pnn, ctdb->nodes[c->pnn]->flags));
/* make sure we don't hold any IPs when we shouldn't */
if (c->pnn == ctdb->pnn &&
DEBUG(0,(__location__ " Failed to register handler %llu in daemon\n",
(unsigned long long)srvid));
} else {
- DEBUG(1,(__location__ " Registered message handler for srvid=%llu\n",
+ DEBUG(DEBUG_INFO,(__location__ " Registered message handler for srvid=%llu\n",
(unsigned long long)srvid));
}
if ((srvid & 0xFFFFFFFF) == srvid &&
kill(srvid, 0) == 0) {
client->pid = srvid;
- DEBUG(1,(__location__ " Registered PID %u for client %u\n",
+ DEBUG(DEBUG_INFO,(__location__ " Registered PID %u for client %u\n",
(unsigned)client->pid, client_id));
}
return res;
return;
}
- DEBUG(3,(__location__ " client request %u of type %u length %u from "
+ DEBUG(DEBUG_DEBUG,(__location__ " client request %u of type %u length %u from "
"node %u to %u\n", hdr->reqid, hdr->operation, hdr->length,
hdr->srcnode, hdr->destnode));
}
if (node->tx_cnt == 0) {
- DEBUG(5,("sending keepalive to %u\n", node->pnn));
+ DEBUG(DEBUG_DEBUG,("sending keepalive to %u\n", node->pnn));
ctdb_send_keepalive(ctdb, node->pnn);
}
*/
static void ctdb_syslog_log(const char *format, va_list ap)
{
- vsyslog(LOG_NOTICE, format, ap);
+ int level = LOG_DEBUG;
+ switch (this_log_level) {
+ case DEBUG_EMERG:
+ level = LOG_EMERG;
+ break;
+ case DEBUG_ALERT:
+ level = LOG_ALERT;
+ break;
+ case DEBUG_CRIT:
+ level = LOG_CRIT;
+ break;
+ case DEBUG_ERR:
+ level = LOG_ERR;
+ break;
+ case DEBUG_WARNING:
+ level = LOG_WARNING;
+ break;
+ case DEBUG_NOTICE:
+ level = LOG_NOTICE;
+ break;
+ case DEBUG_INFO:
+ level = LOG_INFO;
+ break;
+ default:
+ level = LOG_DEBUG;
+ break;
+ }
+ vsyslog(level, format, ap);
}
return;
}
state->recv_pkt(state->recv_context, state->hdr);
- DEBUG(2,(__location__ " PACKET REQUEUED\n"));
+ DEBUG(DEBUG_INFO,(__location__ " PACKET REQUEUED\n"));
}
return -1;
}
- DEBUG(1,("Attached to database '%s'\n", ctdb_db->db_path));
+ DEBUG(DEBUG_INFO,("Attached to database '%s'\n", ctdb_db->db_path));
/* success */
return 0;
node->flags |= NODE_FLAGS_UNHEALTHY;
ctdb->monitor->next_interval = 1;
} else if (status == 0 && (node->flags & NODE_FLAGS_UNHEALTHY)) {
- DEBUG(0,("monitor event OK - node re-enabled\n"));
+ DEBUG(DEBUG_NOTICE,("monitor event OK - node re-enabled\n"));
node->flags &= ~NODE_FLAGS_UNHEALTHY;
ctdb->monitor->next_interval = 1;
}
void ctdb_disable_monitoring(struct ctdb_context *ctdb)
{
ctdb->monitor->monitoring_mode = CTDB_MONITORING_DISABLED;
- DEBUG(2,("Monitoring has been disabled\n"));
+ DEBUG(DEBUG_INFO,("Monitoring has been disabled\n"));
}
/*
{
ctdb->monitor->monitoring_mode = CTDB_MONITORING_ACTIVE;
ctdb->monitor->next_interval = 1;
- DEBUG(2,("Monitoring has been enabled\n"));
+ DEBUG(DEBUG_INFO,("Monitoring has been enabled\n"));
}
/* stop any monitoring
node->flags &= ~m->clear;
if (node->flags == old_flags) {
- DEBUG(2, ("Control modflags on node %u - Unchanged - flags 0x%x\n", ctdb->pnn, node->flags));
+ DEBUG(DEBUG_INFO, ("Control modflags on node %u - Unchanged - flags 0x%x\n", ctdb->pnn, node->flags));
return 0;
}
rec = (struct ctdb_rec_data *)&reply->data[0];
- DEBUG(1,("starting push of %u records for dbid 0x%x\n",
+ DEBUG(DEBUG_INFO,("starting push of %u records for dbid 0x%x\n",
reply->count, reply->db_id));
for (i=0;i<reply->count;i++) {
rec = (struct ctdb_rec_data *)(rec->length + (uint8_t *)rec);
}
- DEBUG(3,("finished push of %u records for dbid 0x%x\n",
+ DEBUG(DEBUG_DEBUG,("finished push of %u records for dbid 0x%x\n",
reply->count, reply->db_id));
ctdb_lock_all_databases_unmark(ctdb);
data.dptr = &rec->data[rec->keylen];
if (ctdb_lmaster(ctdb, &key) == ctdb->pnn) {
- DEBUG(2,(__location__ " Called delete on record where we are lmaster\n"));
+ DEBUG(DEBUG_INFO,(__location__ " Called delete on record where we are lmaster\n"));
return -1;
}
if (hdr2->rsn > hdr->rsn) {
tdb_chainunlock(ctdb_db->ltdb->tdb, key);
- DEBUG(2,(__location__ " Skipping record with rsn=%llu - called with rsn=%llu\n",
+ DEBUG(DEBUG_INFO,(__location__ " Skipping record with rsn=%llu - called with rsn=%llu\n",
(unsigned long long)hdr2->rsn, (unsigned long long)hdr->rsn));
free(data.dptr);
return -1;
if (hdr2->dmaster == ctdb->pnn) {
tdb_chainunlock(ctdb_db->ltdb->tdb, key);
- DEBUG(2,(__location__ " Attempted delete record where we are the dmaster\n"));
+ DEBUG(DEBUG_INFO,(__location__ " Attempted delete record where we are the dmaster\n"));
free(data.dptr);
return -1;
}
if (tdb_delete(ctdb_db->ltdb->tdb, key) != 0) {
tdb_unlock(ctdb_db->ltdb->tdb, -1, F_WRLCK);
tdb_chainunlock(ctdb_db->ltdb->tdb, key);
- DEBUG(2,(__location__ " Failed to delete record\n"));
+ DEBUG(DEBUG_INFO,(__location__ " Failed to delete record\n"));
free(data.dptr);
return -1;
}
if (rec->last_culprit != culprit ||
timeval_elapsed(&rec->first_recover_time) > ctdb->tunable.recovery_grace_period) {
- DEBUG(0,("New recovery culprit %u\n", culprit));
+ DEBUG(DEBUG_NOTICE,("New recovery culprit %u\n", culprit));
/* either a new node is the culprit, or we've decided to forgive them */
rec->last_culprit = culprit;
rec->first_recover_time = timeval_current();
return -1;
}
- DEBUG(0, (__location__ " Recovery - pushed remote database 0x%x of size %u\n",
+ DEBUG(DEBUG_NOTICE, (__location__ " Recovery - pushed remote database 0x%x of size %u\n",
dbid, recdata->count));
talloc_free(recdata);
return -1;
}
- DEBUG(0, (__location__ " Recovery - pulled remote database 0x%x\n", dbid));
+ DEBUG(DEBUG_NOTICE, (__location__ " Recovery - pulled remote database 0x%x\n", dbid));
/* wipe all the remote databases. This is safe as we are in a transaction */
w.db_id = dbid;
struct ctdb_dbid_map *dbmap;
TDB_DATA data;
- DEBUG(0, (__location__ " Starting do_recovery\n"));
+ DEBUG(DEBUG_NOTICE, (__location__ " Starting do_recovery\n"));
/* if recovery fails, force it again */
rec->need_recovery = true;
return -1;
}
- DEBUG(0, (__location__ " Recovery initiated due to problem with node %u\n", culprit));
+ DEBUG(DEBUG_NOTICE, (__location__ " Recovery initiated due to problem with node %u\n", culprit));
/* get a list of all databases */
ret = ctdb_ctrl_getdbmap(ctdb, CONTROL_TIMEOUT(), pnn, mem_ctx, &dbmap);
return -1;
}
- DEBUG(0, (__location__ " Recovery - created remote databases\n"));
+ DEBUG(DEBUG_NOTICE, (__location__ " Recovery - created remote databases\n"));
/* set recovery mode to active on all nodes */
return -1;
}
- DEBUG(0,(__location__ " started transactions on all nodes\n"));
+ DEBUG(DEBUG_NOTICE,(__location__ " started transactions on all nodes\n"));
for (i=0;i<dbmap->num;i++) {
if (recover_database(rec, mem_ctx, dbmap->dbs[i].dbid, pnn, nodemap, generation) != 0) {
}
}
- DEBUG(0, (__location__ " Recovery - starting database commits\n"));
+ DEBUG(DEBUG_NOTICE, (__location__ " Recovery - starting database commits\n"));
/* commit all the changes */
if (ctdb_client_async_control(ctdb, CTDB_CONTROL_TRANSACTION_COMMIT,
return -1;
}
- DEBUG(0, (__location__ " Recovery - committed databases\n"));
+ DEBUG(DEBUG_NOTICE, (__location__ " Recovery - committed databases\n"));
/* build a new vnn map with all the currently active and
return -1;
}
- DEBUG(0, (__location__ " Recovery - updated vnnmap\n"));
+ DEBUG(DEBUG_NOTICE, (__location__ " Recovery - updated vnnmap\n"));
/* update recmaster to point to us for all nodes */
ret = set_recovery_master(ctdb, nodemap, pnn);
return -1;
}
- DEBUG(0, (__location__ " Recovery - updated recmaster\n"));
+ DEBUG(DEBUG_NOTICE, (__location__ " Recovery - updated recmaster\n"));
/*
update all nodes to have the same flags that we have
return -1;
}
- DEBUG(0, (__location__ " Recovery - updated flags\n"));
+ DEBUG(DEBUG_NOTICE, (__location__ " Recovery - updated flags\n"));
/*
if enabled, tell nodes to takeover their public IPs
DEBUG(0, (__location__ " Unable to setup public takeover addresses\n"));
return -1;
}
- DEBUG(1, (__location__ " Recovery - done takeover\n"));
+ DEBUG(DEBUG_INFO, (__location__ " Recovery - done takeover\n"));
}
/* execute the "recovered" event script on all nodes */
has been reconfigured */
ctdb_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_RECONFIGURE, tdb_null);
- DEBUG(0, (__location__ " Recovery complete\n"));
+ DEBUG(DEBUG_NOTICE, (__location__ " Recovery complete\n"));
rec->need_recovery = false;
We now wait for rerecovery_timeout before we allow
another recovery to take place.
*/
- DEBUG(0, (__location__ " New recoveries supressed for the rerecovery timeout\n"));
+ DEBUG(DEBUG_NOTICE, (__location__ " New recoveries supressed for the rerecovery timeout\n"));
ctdb_wait_timeout(ctdb, ctdb->tunable.rerecovery_timeout);
- DEBUG(0, (__location__ " Rerecovery timeout elapsed. Recovery reactivated.\n"));
+ DEBUG(DEBUG_NOTICE, (__location__ " Rerecovery timeout elapsed. Recovery reactivated.\n"));
return 0;
}
tmp_ctx = talloc_new(ctdb);
talloc_steal(tmp_ctx, hdr);
- DEBUG(3,(__location__ " ctdb request %u of type %u length %u from "
+ DEBUG(DEBUG_DEBUG,(__location__ " ctdb request %u of type %u length %u from "
"node %u to %u\n", hdr->reqid, hdr->operation, hdr->length,
hdr->srcnode, hdr->destnode));
void ctdb_node_dead(struct ctdb_node *node)
{
if (node->flags & NODE_FLAGS_DISCONNECTED) {
- DEBUG(1,("%s: node %s is already marked disconnected: %u connected\n",
+ DEBUG(DEBUG_INFO,("%s: node %s is already marked disconnected: %u connected\n",
node->ctdb->name, node->name,
node->ctdb->num_connected));
return;
void ctdb_node_connected(struct ctdb_node *node)
{
if (!(node->flags & NODE_FLAGS_DISCONNECTED)) {
- DEBUG(1,("%s: node %s is already marked connected: %u connected\n",
+ DEBUG(DEBUG_INFO,("%s: node %s is already marked connected: %u connected\n",
node->ctdb->name, node->name,
node->ctdb->num_connected));
return;
node->dead_count = 0;
node->flags &= ~NODE_FLAGS_DISCONNECTED;
node->flags |= NODE_FLAGS_UNHEALTHY;
- DEBUG(1,("%s: connected to %s - %u connected\n",
+ DEBUG(DEBUG_INFO,("%s: connected to %s - %u connected\n",
node->ctdb->name, node->name, node->ctdb->num_connected));
}
tcparray = arp->tcparray;
if (tcparray) {
for (i=0;i<tcparray->num;i++) {
- DEBUG(2,("sending tcp tickle ack for %u->%s:%u\n",
+ DEBUG(DEBUG_INFO,("sending tcp tickle ack for %u->%s:%u\n",
(unsigned)ntohs(tcparray->connections[i].daddr.sin_port),
inet_ntoa(tcparray->connections[i].saddr.sin_addr),
(unsigned)ntohs(tcparray->connections[i].saddr.sin_port)));
{
struct ctdb_client_ip *ip;
- DEBUG(1,("release_kill_clients for ip %s\n", inet_ntoa(in.sin_addr)));
+ DEBUG(DEBUG_INFO,("release_kill_clients for ip %s\n", inet_ntoa(in.sin_addr)));
for (ip=ctdb->client_ip_list; ip; ip=ip->next) {
- DEBUG(2,("checking for client %u with IP %s\n",
+ DEBUG(DEBUG_INFO,("checking for client %u with IP %s\n",
ip->client_id, inet_ntoa(ip->ip.sin_addr)));
if (ctdb_same_ip(&ip->ip, &in)) {
struct ctdb_client *client = ctdb_reqid_find(ctdb,
ip->client_id,
struct ctdb_client);
- DEBUG(1,("matched client %u with IP %s and pid %u\n",
+ DEBUG(DEBUG_INFO,("matched client %u with IP %s and pid %u\n",
ip->client_id, inet_ntoa(ip->ip.sin_addr), client->pid));
if (client->pid != 0) {
DEBUG(0,(__location__ " Killing client pid %u for IP %s on client_id %u\n",
vnn->takeover_ctx = NULL;
if (!ctdb_sys_have_ip(pip->sin)) {
- DEBUG(2,("Redundant release of IP %s/%u on interface %s (ip not held)\n",
+ DEBUG(DEBUG_INFO,("Redundant release of IP %s/%u on interface %s (ip not held)\n",
inet_ntoa(pip->sin.sin_addr), vnn->public_netmask_bits,
vnn->iface));
return 0;
*/
static int ctdb_client_ip_destructor(struct ctdb_client_ip *ip)
{
- DEBUG(3,("destroying client tcp for %s:%u (client_id %u)\n",
+ DEBUG(DEBUG_DEBUG,("destroying client tcp for %s:%u (client_id %u)\n",
inet_ntoa(ip->ip.sin_addr), ntohs(ip->ip.sin_port), ip->client_id));
DLIST_REMOVE(ip->ctdb->client_ip_list, ip);
return 0;
data.dptr = (uint8_t *)&t;
data.dsize = sizeof(t);
- DEBUG(1,("registered tcp client for %u->%s:%u (client_id %u pid %u)\n",
+ DEBUG(DEBUG_INFO,("registered tcp client for %u->%s:%u (client_id %u pid %u)\n",
(unsigned)ntohs(p->dest.sin_port),
inet_ntoa(p->src.sin_addr),
(unsigned)ntohs(p->src.sin_port), client_id, client->pid));
tcp.saddr = p->src;
tcp.daddr = p->dest;
if (ctdb_tcp_find(vnn->tcp_array, &tcp) != NULL) {
- DEBUG(4,("Already had tickle info for %s:%u for vnn:%u\n",
+ DEBUG(DEBUG_DEBUG,("Already had tickle info for %s:%u for vnn:%u\n",
inet_ntoa(tcp.daddr.sin_addr),
ntohs(tcp.daddr.sin_port),
vnn->pnn));
tcparray->connections[tcparray->num].daddr = p->dest;
tcparray->num++;
- DEBUG(2,("Added tickle info for %s:%u from vnn %u\n",
+ DEBUG(DEBUG_INFO,("Added tickle info for %s:%u from vnn %u\n",
inet_ntoa(tcp.daddr.sin_addr),
ntohs(tcp.daddr.sin_port),
vnn->pnn));
and we dont need to do anything
*/
if (vnn->tcp_array == NULL) {
- DEBUG(2,("Trying to remove tickle that doesnt exist (array is empty) %s:%u\n",
+ DEBUG(DEBUG_INFO,("Trying to remove tickle that doesnt exist (array is empty) %s:%u\n",
inet_ntoa(conn->daddr.sin_addr),
ntohs(conn->daddr.sin_port)));
return;
*/
tcpp = ctdb_tcp_find(vnn->tcp_array, conn);
if (tcpp == NULL) {
- DEBUG(2,("Trying to remove tickle that doesnt exist %s:%u\n",
+ DEBUG(DEBUG_INFO,("Trying to remove tickle that doesnt exist %s:%u\n",
inet_ntoa(conn->daddr.sin_addr),
ntohs(conn->daddr.sin_port)));
return;
vnn->tcp_update_needed = true;
- DEBUG(2,("Removed tickle info for %s:%u\n",
+ DEBUG(DEBUG_INFO,("Removed tickle info for %s:%u\n",
inet_ntoa(conn->saddr.sin_addr),
ntohs(conn->saddr.sin_port)));
}
/* This one has been tickled !
now reset him and remove him from the list.
*/
- DEBUG(1, ("sending a tcp reset to kill connection :%d -> %s:%d\n", ntohs(con->dst.sin_port), inet_ntoa(con->src.sin_addr), ntohs(con->src.sin_port)));
+ DEBUG(DEBUG_INFO, ("sending a tcp reset to kill connection :%d -> %s:%d\n", ntohs(con->dst.sin_port), inet_ntoa(con->src.sin_addr), ntohs(con->src.sin_port)));
ctdb_sys_send_tcp(killtcp->sending_fd, &con->dst,
&con->src, ack_seq, seq, 1);
script, options);
CTDB_NO_MEMORY(ctdb, cmdstr);
- DEBUG(1,("Executing event script %s\n",cmdstr));
+ DEBUG(DEBUG_INFO,("Executing event script %s\n",cmdstr));
child_state.start = timeval_current();
child_state.script_running = cmdstr;
ctdb->address.port);
ctdb->pnn = ctdb->nodes[i]->pnn;
ctdb->nodes[i]->flags &= ~NODE_FLAGS_DISCONNECTED;
- DEBUG(1,("ctdb chose network address %s:%u pnn %u\n",
+ DEBUG(DEBUG_INFO,("ctdb chose network address %s:%u pnn %u\n",
ctdb->address.address,
ctdb->address.port,
ctdb->pnn));