mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
change ctdb->vnn to ctdb->pnn
(This used to be ctdb commit 8c776e5707e503ec6586aae39ac6b3ea5a2fd2bc)
This commit is contained in:
parent
12ebb74838
commit
eb4cf6a686
@ -55,7 +55,7 @@ struct ctdb_req_header *_ctdbd_allocate_pkt(struct ctdb_context *ctdb,
|
||||
hdr->operation = operation;
|
||||
hdr->ctdb_magic = CTDB_MAGIC;
|
||||
hdr->ctdb_version = CTDB_VERSION;
|
||||
hdr->srcnode = ctdb->vnn;
|
||||
hdr->srcnode = ctdb->pnn;
|
||||
if (ctdb->vnn_map) {
|
||||
hdr->generation = ctdb->vnn_map->generation;
|
||||
}
|
||||
@ -109,7 +109,7 @@ int ctdb_call_local(struct ctdb_db_context *ctdb_db, struct ctdb_call *call,
|
||||
|
||||
/* we need to force the record to be written out if this was a remote access,
|
||||
so that the lacount is updated */
|
||||
if (c->new_data == NULL && header->laccessor != ctdb->vnn) {
|
||||
if (c->new_data == NULL && header->laccessor != ctdb->pnn) {
|
||||
c->new_data = &c->record_data;
|
||||
}
|
||||
|
||||
@ -365,7 +365,7 @@ static struct ctdb_client_call_state *ctdb_client_call_local_send(struct ctdb_db
|
||||
state->call = *call;
|
||||
state->ctdb_db = ctdb_db;
|
||||
|
||||
ret = ctdb_call_local(ctdb_db, &state->call, header, state, data, ctdb->vnn);
|
||||
ret = ctdb_call_local(ctdb_db, &state->call, header, state, data, ctdb->pnn);
|
||||
|
||||
return state;
|
||||
}
|
||||
@ -400,7 +400,7 @@ struct ctdb_client_call_state *ctdb_call_send(struct ctdb_db_context *ctdb_db,
|
||||
|
||||
ret = ctdb_ltdb_fetch(ctdb_db, call->key, &header, ctdb_db, &data);
|
||||
|
||||
if (ret == 0 && header.dmaster == ctdb->vnn) {
|
||||
if (ret == 0 && header.dmaster == ctdb->pnn) {
|
||||
state = ctdb_client_call_local_send(ctdb_db, call, &header, &data);
|
||||
talloc_free(data.dptr);
|
||||
ctdb_ltdb_unlock(ctdb_db, call->key);
|
||||
@ -618,7 +618,7 @@ again:
|
||||
|
||||
DEBUG(4,("ctdb_fetch_lock: done local fetch\n"));
|
||||
|
||||
if (ret != 0 || h->header.dmaster != ctdb_db->ctdb->vnn) {
|
||||
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) {
|
||||
@ -2478,6 +2478,6 @@ int ctdb_set_socketname(struct ctdb_context *ctdb, const char *socketname)
|
||||
*/
|
||||
uint32_t ctdb_get_vnn(struct ctdb_context *ctdb)
|
||||
{
|
||||
return ctdb->vnn;
|
||||
return ctdb->pnn;
|
||||
}
|
||||
|
||||
|
@ -124,10 +124,10 @@ struct ctdb_context *ctdb_cmdline_client(struct event_context *ev)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* get our vnn */
|
||||
ctdb->vnn = ctdb_ctrl_getvnn(ctdb, timeval_current_ofs(3, 0), CTDB_CURRENT_NODE);
|
||||
if (ctdb->vnn == (uint32_t)-1) {
|
||||
DEBUG(0,(__location__ " Failed to get ctdb vnn\n"));
|
||||
/* get our pnn */
|
||||
ctdb->pnn = ctdb_ctrl_getvnn(ctdb, timeval_current_ofs(3, 0), CTDB_CURRENT_NODE);
|
||||
if (ctdb->pnn == (uint32_t)-1) {
|
||||
DEBUG(0,(__location__ " Failed to get ctdb pnn\n"));
|
||||
talloc_free(ctdb);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ struct ctdb_context {
|
||||
char *node_list_file;
|
||||
char *recovery_lock_file;
|
||||
int recovery_lock_fd;
|
||||
uint32_t vnn; /* our own vnn */
|
||||
uint32_t pnn; /* our own pnn */
|
||||
uint32_t num_nodes;
|
||||
uint32_t num_connected;
|
||||
unsigned flags;
|
||||
|
@ -104,7 +104,7 @@ static void ctdb_call_send_redirect(struct ctdb_context *ctdb,
|
||||
{
|
||||
|
||||
uint32_t lmaster = ctdb_lmaster(ctdb, &key);
|
||||
if (ctdb->vnn == lmaster) {
|
||||
if (ctdb->pnn == lmaster) {
|
||||
c->hdr.destnode = header->dmaster;
|
||||
} else if ((c->hopcount % ctdb->tunable.max_redirect_count) == 0) {
|
||||
c->hdr.destnode = lmaster;
|
||||
@ -133,7 +133,7 @@ static void ctdb_send_dmaster_reply(struct ctdb_db_context *ctdb_db,
|
||||
int ret, len;
|
||||
TALLOC_CTX *tmp_ctx;
|
||||
|
||||
if (ctdb->vnn != ctdb_lmaster(ctdb, &key)) {
|
||||
if (ctdb->pnn != ctdb_lmaster(ctdb, &key)) {
|
||||
DEBUG(0,(__location__ " Caller is not lmaster!\n"));
|
||||
return;
|
||||
}
|
||||
@ -186,7 +186,7 @@ static void ctdb_call_send_dmaster(struct ctdb_db_context *ctdb_db,
|
||||
int len;
|
||||
uint32_t lmaster = ctdb_lmaster(ctdb, key);
|
||||
|
||||
if (lmaster == ctdb->vnn) {
|
||||
if (lmaster == ctdb->pnn) {
|
||||
ctdb_send_dmaster_reply(ctdb_db, header, *key, *data,
|
||||
c->hdr.srcnode, c->hdr.reqid);
|
||||
return;
|
||||
@ -231,11 +231,11 @@ static void ctdb_become_dmaster(struct ctdb_db_context *ctdb_db,
|
||||
struct ctdb_context *ctdb = ctdb_db->ctdb;
|
||||
struct ctdb_ltdb_header header;
|
||||
|
||||
DEBUG(2,("vnn %u dmaster response %08x\n", ctdb->vnn, ctdb_hash(&key)));
|
||||
DEBUG(2,("vnn %u dmaster response %08x\n", ctdb->pnn, ctdb_hash(&key)));
|
||||
|
||||
ZERO_STRUCT(header);
|
||||
header.rsn = rsn + 1;
|
||||
header.dmaster = ctdb->vnn;
|
||||
header.dmaster = ctdb->pnn;
|
||||
|
||||
if (ctdb_ltdb_store(ctdb_db, key, &header, data) != 0) {
|
||||
ctdb_fatal(ctdb, "ctdb_reply_dmaster store failed\n");
|
||||
@ -246,8 +246,8 @@ static void ctdb_become_dmaster(struct ctdb_db_context *ctdb_db,
|
||||
state = ctdb_reqid_find(ctdb, hdr->reqid, struct ctdb_call_state);
|
||||
|
||||
if (state == NULL) {
|
||||
DEBUG(0,("vnn %u Invalid reqid %u in ctdb_become_dmaster from node %u\n",
|
||||
ctdb->vnn, hdr->reqid, hdr->srcnode));
|
||||
DEBUG(0,("pnn %u Invalid reqid %u in ctdb_become_dmaster from node %u\n",
|
||||
ctdb->pnn, hdr->reqid, hdr->srcnode));
|
||||
ctdb_ltdb_unlock(ctdb_db, key);
|
||||
return;
|
||||
}
|
||||
@ -259,7 +259,7 @@ static void ctdb_become_dmaster(struct ctdb_db_context *ctdb_db,
|
||||
return;
|
||||
}
|
||||
|
||||
ctdb_call_local(ctdb_db, &state->call, &header, state, &data, ctdb->vnn);
|
||||
ctdb_call_local(ctdb_db, &state->call, &header, state, &data, ctdb->pnn);
|
||||
|
||||
ctdb_ltdb_unlock(ctdb_db, state->call.key);
|
||||
|
||||
@ -310,20 +310,20 @@ void ctdb_request_dmaster(struct ctdb_context *ctdb, struct ctdb_req_header *hdr
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctdb_lmaster(ctdb, &key) != ctdb->vnn) {
|
||||
DEBUG(0,("vnn %u dmaster request to non-lmaster lmaster=%u gen=%u curgen=%u\n",
|
||||
ctdb->vnn, ctdb_lmaster(ctdb, &key),
|
||||
if (ctdb_lmaster(ctdb, &key) != ctdb->pnn) {
|
||||
DEBUG(0,("pnn %u dmaster request to non-lmaster lmaster=%u gen=%u curgen=%u\n",
|
||||
ctdb->pnn, ctdb_lmaster(ctdb, &key),
|
||||
hdr->generation, ctdb->vnn_map->generation));
|
||||
ctdb_fatal(ctdb, "ctdb_req_dmaster to non-lmaster");
|
||||
}
|
||||
|
||||
DEBUG(2,("vnn %u dmaster request on %08x for %u from %u\n",
|
||||
ctdb->vnn, ctdb_hash(&key), c->dmaster, c->hdr.srcnode));
|
||||
DEBUG(2,("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 */
|
||||
if (header.dmaster != hdr->srcnode) {
|
||||
DEBUG(0,("vnn %u dmaster request non-master %u dmaster=%u key %08x dbid 0x%08x gen=%u curgen=%u\n",
|
||||
ctdb->vnn, hdr->srcnode, header.dmaster, ctdb_hash(&key),
|
||||
DEBUG(0,("pnn %u dmaster request non-master %u dmaster=%u key %08x dbid 0x%08x gen=%u curgen=%u\n",
|
||||
ctdb->pnn, hdr->srcnode, header.dmaster, ctdb_hash(&key),
|
||||
ctdb_db->db_id, hdr->generation, ctdb->vnn_map->generation));
|
||||
ctdb_fatal(ctdb, "ctdb_req_dmaster from non-master");
|
||||
return;
|
||||
@ -334,7 +334,7 @@ void ctdb_request_dmaster(struct ctdb_context *ctdb, struct ctdb_req_header *hdr
|
||||
|
||||
/* check if the new dmaster is the lmaster, in which case we
|
||||
skip the dmaster reply */
|
||||
if (c->dmaster == ctdb->vnn) {
|
||||
if (c->dmaster == ctdb->pnn) {
|
||||
ctdb_become_dmaster(ctdb_db, hdr, key, data, c->rsn);
|
||||
} else {
|
||||
ctdb_send_dmaster_reply(ctdb_db, &header, key, data, c->dmaster, hdr->reqid);
|
||||
@ -387,7 +387,7 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
|
||||
|
||||
/* if we are not the dmaster, then send a redirect to the
|
||||
requesting node */
|
||||
if (header.dmaster != ctdb->vnn) {
|
||||
if (header.dmaster != ctdb->pnn) {
|
||||
talloc_free(data.dptr);
|
||||
ctdb_call_send_redirect(ctdb, call.key, c, &header);
|
||||
ctdb_ltdb_unlock(ctdb_db, call.key);
|
||||
@ -402,12 +402,12 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
|
||||
then give them the record
|
||||
or if the node requested an immediate migration
|
||||
*/
|
||||
if ( c->hdr.srcnode != ctdb->vnn &&
|
||||
if ( c->hdr.srcnode != ctdb->pnn &&
|
||||
((header.laccessor == c->hdr.srcnode
|
||||
&& header.lacount >= ctdb->tunable.max_lacount)
|
||||
|| (c->flags & CTDB_IMMEDIATE_MIGRATION)) ) {
|
||||
DEBUG(2,("vnn %u starting migration of %08x to %u\n",
|
||||
ctdb->vnn, ctdb_hash(&call.key), c->hdr.srcnode));
|
||||
DEBUG(2,("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_ltdb_unlock(ctdb_db, call.key);
|
||||
@ -520,8 +520,8 @@ void ctdb_reply_error(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
|
||||
|
||||
state = ctdb_reqid_find(ctdb, hdr->reqid, struct ctdb_call_state);
|
||||
if (state == NULL) {
|
||||
DEBUG(0,("vnn %u Invalid reqid %u in ctdb_reply_error\n",
|
||||
ctdb->vnn, hdr->reqid));
|
||||
DEBUG(0,("pnn %u Invalid reqid %u in ctdb_reply_error\n",
|
||||
ctdb->pnn, hdr->reqid));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -570,7 +570,7 @@ static void ctdb_call_resend(struct ctdb_call_state *state)
|
||||
state->c->hdr.generation = state->generation;
|
||||
|
||||
/* send the packet to ourselves, it will be redirected appropriately */
|
||||
state->c->hdr.destnode = ctdb->vnn;
|
||||
state->c->hdr.destnode = ctdb->pnn;
|
||||
|
||||
ctdb_queue_packet(ctdb, &state->c->hdr);
|
||||
DEBUG(0,("resent ctdb_call\n"));
|
||||
@ -625,7 +625,7 @@ struct ctdb_call_state *ctdb_call_local_send(struct ctdb_db_context *ctdb_db,
|
||||
state->call = *call;
|
||||
state->ctdb_db = ctdb_db;
|
||||
|
||||
ret = ctdb_call_local(ctdb_db, &state->call, header, state, data, ctdb->vnn);
|
||||
ret = ctdb_call_local(ctdb_db, &state->call, header, state, data, ctdb->pnn);
|
||||
|
||||
event_add_timed(ctdb->ev, state, timeval_zero(), call_local_trigger, state);
|
||||
|
||||
|
@ -142,7 +142,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
|
||||
return getpid();
|
||||
|
||||
case CTDB_CONTROL_GET_VNN:
|
||||
return ctdb->vnn;
|
||||
return ctdb->pnn;
|
||||
|
||||
case CTDB_CONTROL_PING:
|
||||
CHECK_CONTROL_DATA_SIZE(0);
|
||||
@ -394,7 +394,7 @@ void ctdb_reply_control(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
|
||||
state = ctdb_reqid_find(ctdb, hdr->reqid, struct ctdb_control_state);
|
||||
if (state == NULL) {
|
||||
DEBUG(0,("vnn %u Invalid reqid %u in ctdb_reply_control\n",
|
||||
ctdb->vnn, hdr->reqid));
|
||||
ctdb->pnn, hdr->reqid));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ static void flag_change_handler(struct ctdb_context *ctdb, uint64_t srvid,
|
||||
DEBUG(2,("Node flags for node %u are now 0x%x\n", c->vnn, ctdb->nodes[c->vnn]->flags));
|
||||
|
||||
/* make sure we don't hold any IPs when we shouldn't */
|
||||
if (c->vnn == ctdb->vnn &&
|
||||
if (c->vnn == ctdb->pnn &&
|
||||
(ctdb->nodes[c->vnn]->flags & (NODE_FLAGS_INACTIVE|NODE_FLAGS_BANNED))) {
|
||||
ctdb_release_all_ips(ctdb);
|
||||
}
|
||||
@ -407,7 +407,7 @@ static void daemon_request_call_from_client(struct ctdb_client *client,
|
||||
call->call_data.dsize = c->calldatalen;
|
||||
call->flags = c->flags;
|
||||
|
||||
if (header.dmaster == ctdb->vnn) {
|
||||
if (header.dmaster == ctdb->pnn) {
|
||||
state = ctdb_call_local_send(ctdb_db, call, &header, &data);
|
||||
} else {
|
||||
state = ctdb_daemon_call_send_remote(ctdb_db, call, &header);
|
||||
@ -712,7 +712,7 @@ struct ctdb_req_header *_ctdb_transport_allocate(struct ctdb_context *ctdb,
|
||||
hdr->ctdb_magic = CTDB_MAGIC;
|
||||
hdr->ctdb_version = CTDB_VERSION;
|
||||
hdr->generation = ctdb->vnn_map->generation;
|
||||
hdr->srcnode = ctdb->vnn;
|
||||
hdr->srcnode = ctdb->pnn;
|
||||
|
||||
return hdr;
|
||||
}
|
||||
@ -800,7 +800,7 @@ static void daemon_request_control_from_client(struct ctdb_client *client,
|
||||
TALLOC_CTX *tmp_ctx = talloc_new(client);
|
||||
|
||||
if (c->hdr.destnode == CTDB_CURRENT_NODE) {
|
||||
c->hdr.destnode = client->ctdb->vnn;
|
||||
c->hdr.destnode = client->ctdb->pnn;
|
||||
}
|
||||
|
||||
state = talloc(client, struct daemon_control_state);
|
||||
@ -917,7 +917,7 @@ int ctdb_daemon_send_message(struct ctdb_context *ctdb, uint32_t vnn,
|
||||
int len;
|
||||
|
||||
/* see if this is a message to ourselves */
|
||||
if (vnn == ctdb->vnn) {
|
||||
if (vnn == ctdb->pnn) {
|
||||
return ctdb_local_message(ctdb, srvid, data);
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
|
||||
{
|
||||
const char *db_name = (const char *)indata.dptr;
|
||||
struct ctdb_db_context *ctdb_db, *tmp_db;
|
||||
struct ctdb_node *node = ctdb->nodes[ctdb->vnn];
|
||||
struct ctdb_node *node = ctdb->nodes[ctdb->pnn];
|
||||
int ret;
|
||||
|
||||
/* If the node is inactive it is not part of the cluster
|
||||
@ -254,7 +254,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
|
||||
/* open the database */
|
||||
ctdb_db->db_path = talloc_asprintf(ctdb_db, "%s/%s.%u",
|
||||
ctdb->db_directory,
|
||||
db_name, ctdb->vnn);
|
||||
db_name, ctdb->pnn);
|
||||
|
||||
ctdb_db->ltdb = tdb_wrap_open(ctdb, ctdb_db->db_path,
|
||||
ctdb->tunable.database_hash_size,
|
||||
@ -308,7 +308,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
|
||||
int32_t ctdb_ltdb_update_seqnum(struct ctdb_context *ctdb, uint32_t db_id, uint32_t srcnode)
|
||||
{
|
||||
struct ctdb_db_context *ctdb_db;
|
||||
if (srcnode == ctdb->vnn) {
|
||||
if (srcnode == ctdb->pnn) {
|
||||
/* don't update ourselves! */
|
||||
return 0;
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ static void ctdb_check_for_dead_nodes(struct event_context *ev, struct timed_eve
|
||||
/* send a keepalive to all other nodes, unless */
|
||||
for (i=0;i<ctdb->num_nodes;i++) {
|
||||
struct ctdb_node *node = ctdb->nodes[i];
|
||||
if (node->pnn == ctdb->vnn) {
|
||||
if (node->pnn == ctdb->pnn) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ static void ctdb_check_health(struct event_context *ev, struct timed_event *te,
|
||||
*/
|
||||
static void ctdb_health_callback(struct ctdb_context *ctdb, int status, void *p)
|
||||
{
|
||||
struct ctdb_node *node = ctdb->nodes[ctdb->vnn];
|
||||
struct ctdb_node *node = ctdb->nodes[ctdb->pnn];
|
||||
TDB_DATA data;
|
||||
struct ctdb_node_flag_change c;
|
||||
|
||||
@ -103,7 +103,7 @@ static void ctdb_health_callback(struct ctdb_context *ctdb, int status, void *p)
|
||||
timeval_current_ofs(ctdb->tunable.monitor_interval, 0),
|
||||
ctdb_check_health, ctdb);
|
||||
|
||||
c.vnn = ctdb->vnn;
|
||||
c.vnn = ctdb->pnn;
|
||||
c.old_flags = node->flags;
|
||||
|
||||
if (status != 0 && !(node->flags & NODE_FLAGS_UNHEALTHY)) {
|
||||
@ -111,7 +111,7 @@ static void ctdb_health_callback(struct ctdb_context *ctdb, int status, void *p)
|
||||
node->flags |= NODE_FLAGS_UNHEALTHY;
|
||||
} else if (status == 0 && (node->flags & NODE_FLAGS_UNHEALTHY)) {
|
||||
DEBUG(0,("monitor event OK - node re-enabled\n"));
|
||||
ctdb->nodes[ctdb->vnn]->flags &= ~NODE_FLAGS_UNHEALTHY;
|
||||
ctdb->nodes[ctdb->pnn]->flags &= ~NODE_FLAGS_UNHEALTHY;
|
||||
} else {
|
||||
/* no change */
|
||||
return;
|
||||
@ -193,7 +193,7 @@ int32_t ctdb_control_modflags(struct ctdb_context *ctdb, TDB_DATA indata)
|
||||
struct ctdb_node_modflags *m = (struct ctdb_node_modflags *)indata.dptr;
|
||||
TDB_DATA data;
|
||||
struct ctdb_node_flag_change c;
|
||||
struct ctdb_node *node = ctdb->nodes[ctdb->vnn];
|
||||
struct ctdb_node *node = ctdb->nodes[ctdb->pnn];
|
||||
uint32_t old_flags = node->flags;
|
||||
|
||||
node->flags |= m->set;
|
||||
@ -204,10 +204,10 @@ int32_t ctdb_control_modflags(struct ctdb_context *ctdb, TDB_DATA indata)
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEBUG(0, ("Control modflags on node %u - flags now 0x%x\n", ctdb->vnn, node->flags));
|
||||
DEBUG(0, ("Control modflags on node %u - flags now 0x%x\n", ctdb->pnn, node->flags));
|
||||
|
||||
/* if we have been banned, go into recovery mode */
|
||||
c.vnn = ctdb->vnn;
|
||||
c.vnn = ctdb->pnn;
|
||||
c.old_flags = old_flags;
|
||||
c.new_flags = node->flags;
|
||||
|
||||
|
@ -330,7 +330,7 @@ int32_t ctdb_control_push_db(struct ctdb_context *ctdb, TDB_DATA indata)
|
||||
/* The check for dmaster gives priority to the dmaster
|
||||
if the rsn values are equal */
|
||||
if (header.rsn < hdr->rsn ||
|
||||
(header.dmaster != ctdb->vnn && header.rsn == hdr->rsn)) {
|
||||
(header.dmaster != ctdb->pnn && header.rsn == hdr->rsn)) {
|
||||
ret = ctdb_ltdb_store(ctdb_db, key, hdr, data);
|
||||
if (ret != 0) {
|
||||
DEBUG(0, (__location__ " Unable to store record\n"));
|
||||
|
@ -95,7 +95,7 @@ static void ctdb_ban_node(struct ctdb_recoverd *rec, uint32_t vnn, uint32_t ban_
|
||||
return;
|
||||
}
|
||||
|
||||
if (vnn == ctdb->vnn) {
|
||||
if (vnn == ctdb->pnn) {
|
||||
DEBUG(0,("self ban - lowering our election priority\n"));
|
||||
/* banning ourselves - lower our election priority */
|
||||
rec->priority_time = timeval_current();
|
||||
@ -626,7 +626,7 @@ static void ban_handler(struct ctdb_context *ctdb, uint64_t srvid,
|
||||
return;
|
||||
}
|
||||
|
||||
if (recmaster != ctdb->vnn) {
|
||||
if (recmaster != ctdb->pnn) {
|
||||
DEBUG(0,("We are not the recmaster - ignoring ban request\n"));
|
||||
talloc_free(mem_ctx);
|
||||
return;
|
||||
@ -664,7 +664,7 @@ static void unban_handler(struct ctdb_context *ctdb, uint64_t srvid,
|
||||
return;
|
||||
}
|
||||
|
||||
if (recmaster != ctdb->vnn) {
|
||||
if (recmaster != ctdb->pnn) {
|
||||
DEBUG(0,("We are not the recmaster - ignoring unban request\n"));
|
||||
talloc_free(mem_ctx);
|
||||
return;
|
||||
@ -959,7 +959,7 @@ static void ctdb_election_data(struct ctdb_recoverd *rec, struct election_messag
|
||||
|
||||
ZERO_STRUCTP(em);
|
||||
|
||||
em->vnn = rec->ctdb->vnn;
|
||||
em->vnn = rec->ctdb->pnn;
|
||||
em->priority_time = rec->priority_time;
|
||||
|
||||
ret = ctdb_ctrl_getnodemap(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, rec, &nodemap);
|
||||
@ -1088,7 +1088,7 @@ static void election_handler(struct ctdb_context *ctdb, uint64_t srvid,
|
||||
}
|
||||
|
||||
/* release the recmaster lock */
|
||||
if (em->vnn != ctdb->vnn &&
|
||||
if (em->vnn != ctdb->pnn &&
|
||||
ctdb->recovery_lock_fd != -1) {
|
||||
close(ctdb->recovery_lock_fd);
|
||||
ctdb->recovery_lock_fd = -1;
|
||||
@ -1201,7 +1201,7 @@ static void monitor_handler(struct ctdb_context *ctdb, uint64_t srvid,
|
||||
}
|
||||
|
||||
if (ret == 0 &&
|
||||
ctdb->recovery_master == ctdb->vnn &&
|
||||
ctdb->recovery_master == ctdb->pnn &&
|
||||
ctdb->recovery_mode == CTDB_RECOVERY_NORMAL &&
|
||||
ctdb->vnn_list) {
|
||||
/* Only do the takeover run if the perm disabled or unhealthy
|
||||
@ -1645,7 +1645,7 @@ again:
|
||||
if (vnnmap->size != num_active) {
|
||||
DEBUG(0, (__location__ " The vnnmap count is different from the number of active nodes. %u vs %u\n",
|
||||
vnnmap->size, num_active));
|
||||
do_recovery(rec, mem_ctx, vnn, num_active, nodemap, vnnmap, ctdb->vnn);
|
||||
do_recovery(rec, mem_ctx, vnn, num_active, nodemap, vnnmap, ctdb->pnn);
|
||||
goto again;
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ static int ctdb_add_node(struct ctdb_context *ctdb, char *nstr)
|
||||
|
||||
if (ctdb->address.address &&
|
||||
ctdb_same_address(&ctdb->address, &node->address)) {
|
||||
ctdb->vnn = node->pnn;
|
||||
ctdb->pnn = node->pnn;
|
||||
node->flags &= ~NODE_FLAGS_DISCONNECTED;
|
||||
}
|
||||
|
||||
@ -226,7 +226,7 @@ void ctdb_input_pkt(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
|
||||
case CTDB_REQ_DMASTER:
|
||||
case CTDB_REPLY_DMASTER:
|
||||
/* we dont allow these calls when banned */
|
||||
if (ctdb->nodes[ctdb->vnn]->flags & NODE_FLAGS_BANNED) {
|
||||
if (ctdb->nodes[ctdb->pnn]->flags & NODE_FLAGS_BANNED) {
|
||||
DEBUG(0,(__location__ " ctdb operation %u"
|
||||
" request %u"
|
||||
" length %u from node %u to %u while node"
|
||||
@ -463,7 +463,7 @@ void ctdb_queue_packet(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
|
||||
|
||||
node = ctdb->nodes[hdr->destnode];
|
||||
|
||||
if (hdr->destnode == ctdb->vnn) {
|
||||
if (hdr->destnode == ctdb->pnn) {
|
||||
ctdb_defer_packet(ctdb, hdr);
|
||||
} else {
|
||||
node->tx_cnt++;
|
||||
|
@ -302,7 +302,7 @@ static void release_ip_callback(struct ctdb_context *ctdb, int status,
|
||||
data.dptr = (uint8_t *)ip;
|
||||
data.dsize = strlen(ip)+1;
|
||||
|
||||
ctdb_daemon_send_message(ctdb, ctdb->vnn, CTDB_SRVID_RELEASE_IP, data);
|
||||
ctdb_daemon_send_message(ctdb, ctdb->pnn, CTDB_SRVID_RELEASE_IP, data);
|
||||
|
||||
/* kill clients that have registered with this IP */
|
||||
release_kill_clients(ctdb, state->sin->sin_addr);
|
||||
@ -1513,7 +1513,7 @@ static void ctdb_update_tcp_tickles(struct event_context *ev,
|
||||
/* we only send out updates for public addresses that
|
||||
we have taken over
|
||||
*/
|
||||
if (ctdb->vnn != vnn->pnn) {
|
||||
if (ctdb->pnn != vnn->pnn) {
|
||||
continue;
|
||||
}
|
||||
/* We only send out the updates if we need to */
|
||||
|
@ -91,7 +91,7 @@ static int ctdb_traverse_local_fn(struct tdb_context *tdb, TDB_DATA key, TDB_DAT
|
||||
/* filter out non-authoritative and zero-length records */
|
||||
hdr = (struct ctdb_ltdb_header *)data.dptr;
|
||||
if (data.dsize <= sizeof(struct ctdb_ltdb_header) ||
|
||||
hdr->dmaster != h->ctdb_db->ctdb->vnn) {
|
||||
hdr->dmaster != h->ctdb_db->ctdb->pnn) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ static struct ctdb_traverse_all_handle *ctdb_daemon_traverse_all(struct ctdb_db_
|
||||
|
||||
r.db_id = ctdb_db->db_id;
|
||||
r.reqid = state->reqid;
|
||||
r.vnn = ctdb->vnn;
|
||||
r.vnn = ctdb->pnn;
|
||||
|
||||
data.dptr = (uint8_t *)&r;
|
||||
data.dsize = sizeof(r);
|
||||
|
@ -214,8 +214,8 @@ int main(int argc, const char *argv[])
|
||||
|
||||
/* useful default logfile */
|
||||
if (ctdb->logfile == NULL) {
|
||||
char *name = talloc_asprintf(ctdb, "%s/log.ctdb.vnn%u",
|
||||
VARDIR, ctdb->vnn);
|
||||
char *name = talloc_asprintf(ctdb, "%s/log.ctdb.pnn%u",
|
||||
VARDIR, ctdb->pnn);
|
||||
ctdb_set_logfile(ctdb, name);
|
||||
talloc_free(name);
|
||||
}
|
||||
|
@ -286,12 +286,12 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb)
|
||||
ctdb->name = talloc_asprintf(ctdb, "%s:%u",
|
||||
ctdb->address.address,
|
||||
ctdb->address.port);
|
||||
ctdb->vnn = ctdb->nodes[i]->pnn;
|
||||
ctdb->pnn = ctdb->nodes[i]->pnn;
|
||||
ctdb->nodes[i]->flags &= ~NODE_FLAGS_DISCONNECTED;
|
||||
DEBUG(1,("ctdb chose network address %s:%u vnn %u\n",
|
||||
DEBUG(1,("ctdb chose network address %s:%u pnn %u\n",
|
||||
ctdb->address.address,
|
||||
ctdb->address.port,
|
||||
ctdb->vnn));
|
||||
ctdb->pnn));
|
||||
|
||||
if (listen(ctcp->listen_fd, 10) == -1) {
|
||||
goto failed;
|
||||
|
Loading…
x
Reference in New Issue
Block a user