struct ctdb_node_flag_change *c = (struct ctdb_node_flag_change *)data.dptr;
if (data.dsize != sizeof(*c) || !ctdb_validate_pnn(ctdb, c->pnn)) {
- DEBUG(0,(__location__ "Invalid data in ctdb_node_flag_change\n"));
+ DEBUG(DEBUG_CRIT,(__location__ "Invalid data in ctdb_node_flag_change\n"));
return;
}
if (!ctdb_validate_pnn(ctdb, c->pnn)) {
- DEBUG(0,("Bad pnn %u in flag_change_handler\n", c->pnn));
+ DEBUG(DEBUG_CRIT,("Bad pnn %u in flag_change_handler\n", c->pnn));
return;
}
static void print_exit_message(void)
{
- DEBUG(0,("CTDB daemon shutting down\n"));
+ DEBUG(DEBUG_NOTICE,("CTDB daemon shutting down\n"));
}
{
/* start the transport running */
if (ctdb->methods->start(ctdb) != 0) {
- DEBUG(0,("transport failed to start!\n"));
+ DEBUG(DEBUG_ALERT,("transport failed to start!\n"));
ctdb_fatal(ctdb, "transport failed to start");
}
/* start the recovery daemon process */
if (ctdb_start_recoverd(ctdb) != 0) {
- DEBUG(0,("Failed to start recovery daemon\n"));
+ DEBUG(DEBUG_ALERT,("Failed to start recovery daemon\n"));
exit(11);
}
struct ctdb_client *client = ctdb_reqid_find(ctdb, client_id, struct ctdb_client);
int res;
if (client == NULL) {
- DEBUG(0,("Bad client_id in daemon_request_register_message_handler\n"));
+ DEBUG(DEBUG_ERR,("Bad client_id in daemon_request_register_message_handler\n"));
return -1;
}
res = ctdb_register_message_handler(ctdb, client, srvid, daemon_message_handler, client);
if (res != 0) {
- DEBUG(0,(__location__ " Failed to register handler %llu in daemon\n",
+ DEBUG(DEBUG_ERR,(__location__ " Failed to register handler %llu in daemon\n",
(unsigned long long)srvid));
} else {
DEBUG(DEBUG_INFO,(__location__ " Registered message handler for srvid=%llu\n",
{
struct ctdb_client *client = ctdb_reqid_find(ctdb, client_id, struct ctdb_client);
if (client == NULL) {
- DEBUG(0,("Bad client_id in daemon_request_deregister_message_handler\n"));
+ DEBUG(DEBUG_ERR,("Bad client_id in daemon_request_deregister_message_handler\n"));
return -1;
}
return ctdb_deregister_message_handler(ctdb, srvid, client);
res = ctdb_daemon_send_message(client->ctdb, c->hdr.destnode,
c->srvid, data);
if (res != 0) {
- DEBUG(0,(__location__ " Failed to send message to remote node %u\n",
+ DEBUG(DEBUG_ERR,(__location__ " Failed to send message to remote node %u\n",
c->hdr.destnode));
}
}
res = ctdb_daemon_call_recv(state, dstate->call);
if (res != 0) {
- DEBUG(0, (__location__ " ctdbd_call_recv() returned error\n"));
+ DEBUG(DEBUG_ERR, (__location__ " ctdbd_call_recv() returned error\n"));
client->ctdb->statistics.pending_calls--;
ctdb_latency(&client->ctdb->statistics.max_call_latency, dstate->start_time);
return;
r = ctdbd_allocate_pkt(client->ctdb, dstate, CTDB_REPLY_CALL,
length, struct ctdb_reply_call);
if (r == NULL) {
- DEBUG(0, (__location__ " Failed to allocate reply_call in ctdb daemon\n"));
+ DEBUG(DEBUG_ERR, (__location__ " Failed to allocate reply_call in ctdb daemon\n"));
client->ctdb->statistics.pending_calls--;
ctdb_latency(&client->ctdb->statistics.max_call_latency, dstate->start_time);
return;
res = daemon_queue_send(client, &r->hdr);
if (res != 0) {
- DEBUG(0, (__location__ " Failed to queue packet from daemon to client\n"));
+ DEBUG(DEBUG_ERR, (__location__ " Failed to queue packet from daemon to client\n"));
}
ctdb_latency(&client->ctdb->statistics.max_call_latency, dstate->start_time);
talloc_free(dstate);
struct ctdb_daemon_packet_wrap *w = talloc_get_type(p,
struct ctdb_daemon_packet_wrap);
if (w == NULL) {
- DEBUG(0,(__location__ " Bad packet type '%s'\n", talloc_get_name(p)));
+ DEBUG(DEBUG_CRIT,(__location__ " Bad packet type '%s'\n", talloc_get_name(p)));
return;
}
client = ctdb_reqid_find(w->ctdb, w->client_id, struct ctdb_client);
if (client == NULL) {
- DEBUG(0,(__location__ " Packet for disconnected client %u\n",
+ DEBUG(DEBUG_ERR,(__location__ " Packet for disconnected client %u\n",
w->client_id));
talloc_free(w);
return;
ctdb_db = find_ctdb_db(client->ctdb, c->db_id);
if (!ctdb_db) {
- DEBUG(0, (__location__ " Unknown database in request. db_id==0x%08x",
+ DEBUG(DEBUG_ERR, (__location__ " Unknown database in request. db_id==0x%08x",
c->db_id));
ctdb->statistics.pending_calls--;
return;
talloc_free(w);
if (ret != 0) {
- DEBUG(0,(__location__ " Unable to fetch record\n"));
+ DEBUG(DEBUG_ERR,(__location__ " Unable to fetch record\n"));
ctdb->statistics.pending_calls--;
return;
}
dstate = talloc(client, struct daemon_call_state);
if (dstate == NULL) {
ctdb_ltdb_unlock(ctdb_db, key);
- DEBUG(0,(__location__ " Unable to allocate dstate\n"));
+ DEBUG(DEBUG_ERR,(__location__ " Unable to allocate dstate\n"));
ctdb->statistics.pending_calls--;
return;
}
call = dstate->call = talloc_zero(dstate, struct ctdb_call);
if (call == NULL) {
ctdb_ltdb_unlock(ctdb_db, key);
- DEBUG(0,(__location__ " Unable to allocate call\n"));
+ DEBUG(DEBUG_ERR,(__location__ " Unable to allocate call\n"));
ctdb->statistics.pending_calls--;
ctdb_latency(&ctdb->statistics.max_call_latency, dstate->start_time);
return;
ctdb_ltdb_unlock(ctdb_db, key);
if (state == NULL) {
- DEBUG(0,(__location__ " Unable to setup call send\n"));
+ DEBUG(DEBUG_ERR,(__location__ " Unable to setup call send\n"));
ctdb->statistics.pending_calls--;
ctdb_latency(&ctdb->statistics.max_call_latency, dstate->start_time);
return;
break;
default:
- DEBUG(0,(__location__ " daemon: unrecognized operation %u\n",
+ DEBUG(DEBUG_CRIT,(__location__ " daemon: unrecognized operation %u\n",
hdr->operation));
}
/* AIX doesn't like this :( */
if (fchown(ctdb->daemon.sd, geteuid(), getegid()) != 0 ||
fchmod(ctdb->daemon.sd, 0700) != 0) {
- DEBUG(0,("Unable to secure ctdb socket '%s', ctdb->daemon.name\n"));
+ DEBUG(DEBUG_CRIT,("Unable to secure ctdb socket '%s', ctdb->daemon.name\n"));
goto failed;
}
#endif
strncpy(addr.sun_path, ctdb->daemon.name, sizeof(addr.sun_path));
if (bind(ctdb->daemon.sd, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
- DEBUG(0,("Unable to bind on ctdb socket '%s'\n", ctdb->daemon.name));
+ DEBUG(DEBUG_CRIT,("Unable to bind on ctdb socket '%s'\n", ctdb->daemon.name));
goto failed;
}
if (listen(ctdb->daemon.sd, 10) != 0) {
- DEBUG(0,("Unable to listen on ctdb socket '%s'\n", ctdb->daemon.name));
+ DEBUG(DEBUG_CRIT,("Unable to listen on ctdb socket '%s'\n", ctdb->daemon.name));
goto failed;
}
/* create a unix domain stream socket to listen to */
res = ux_socket_bind(ctdb);
if (res!=0) {
- DEBUG(0,(__location__ " Failed to open CTDB unix domain socket\n"));
+ DEBUG(DEBUG_ALERT,(__location__ " Failed to open CTDB unix domain socket\n"));
exit(10);
}
setsid();
close(0);
if (open("/dev/null", O_RDONLY) != 0) {
- DEBUG(0,(__location__ " Failed to setup stdin on /dev/null\n"));
+ DEBUG(DEBUG_ALERT,(__location__ " Failed to setup stdin on /dev/null\n"));
exit(11);
}
}
}
#endif
if (ret != 0) {
- DEBUG(0,("Failed to initialise transport '%s'\n", ctdb->transport));
+ DEBUG(DEBUG_ERR,("Failed to initialise transport '%s'\n", ctdb->transport));
return -1;
}
/* initialise the transport */
if (ctdb->methods->initialise(ctdb) != 0) {
- DEBUG(0,("transport failed to initialise!\n"));
ctdb_fatal(ctdb, "transport failed to initialise");
}
/* go into a wait loop to allow other nodes to complete */
event_loop_wait(ctdb->ev);
- DEBUG(0,("event_loop_wait() returned. this should not happen\n"));
+ DEBUG(DEBUG_CRIT,("event_loop_wait() returned. this should not happen\n"));
exit(1);
}
hdr = (struct ctdb_req_header *)ctdb->methods->allocate_pkt(mem_ctx, size);
if (hdr == NULL) {
- DEBUG(0,("Unable to allocate transport packet for operation %u of length %u\n",
+ DEBUG(DEBUG_ERR,("Unable to allocate transport packet for operation %u of length %u\n",
operation, (unsigned)length));
return NULL;
}
data, daemon_control_callback,
state);
if (res != 0) {
- DEBUG(0,(__location__ " Failed to send control to remote node %u\n",
+ DEBUG(DEBUG_ERR,(__location__ " Failed to send control to remote node %u\n",
c->hdr.destnode));
}
res = ctdb_dispatch_message(m->ctdb, m->srvid, m->data);
if (res != 0) {
- DEBUG(0, (__location__ " Failed to dispatch message for srvid=%llu\n",
+ DEBUG(DEBUG_ERR, (__location__ " Failed to dispatch message for srvid=%llu\n",
(unsigned long long)m->srvid));
}
talloc_free(m);