uint32_t lmaster = ctdb_lmaster(ctdb, &key);
if (ctdb->vnn == lmaster) {
c->hdr.destnode = header->dmaster;
- } else {
+ } else if ((c->hopcount % CTDB_MAX_REDIRECT_COUNT) == 0) {
c->hdr.destnode = lmaster;
+ } else {
+ c->hdr.destnode = header->dmaster;
}
+ c->hopcount++;
ctdb_queue_packet(ctdb, &c->hdr);
}
return;
}
+ if (c->hopcount > ctdb->status.max_hop_count) {
+ ctdb->status.max_hop_count = c->hopcount;
+ }
+
/* if this nodes has done enough consecutive calls on the same record
then give them the record
or if the node requested an immediate migration
state->c->flags = call->flags;
state->c->db_id = ctdb_db->db_id;
state->c->callid = call->call_id;
+ state->c->hopcount = 0;
state->c->keylen = call->key.dsize;
state->c->calldatalen = call->call_data.dsize;
memcpy(&state->c->data[0], call->key.dptr, call->key.dsize);
c->flags = call->flags;
c->db_id = ctdb_db->db_id;
c->callid = call->call_id;
+ c->hopcount = 0;
c->keylen = call->key.dsize;
c->calldatalen = call->call_data.dsize;
memcpy(&c->data[0], call->key.dptr, call->key.dsize);
CTDB_CONTROL_DB_ATTACH, CTDB_CTRL_FLAG_NOREPLY,
indata, NULL, NULL);
- DEBUG(0,("Attached to database '%s'\n", ctdb_db->db_path));
+ DEBUG(1,("Attached to database '%s'\n", ctdb_db->db_path));
/* success */
return 0;
#define CTDB_CURRENT_NODE 0xF0000001
#define CTDB_BROADCAST_VNN 0xF0000002
+#define CTDB_MAX_REDIRECT_COUNT 3
/*
an installed ctdb remote call
uint32_t lockwait_calls;
uint32_t pending_lockwait_calls;
uint32_t __last_counter; /* hack for control_status_all */
+ uint32_t max_hop_count;
double max_call_latency;
double max_lockwait_latency;
};
uint32_t flags;
uint32_t db_id;
uint32_t callid;
+ uint32_t hopcount;
uint32_t keylen;
uint32_t calldatalen;
uint8_t data[1]; /* key[] followed by calldata[] */
ctdb->address.port);
ctdb->vnn = ctdb->nodes[i]->vnn;
ctdb->nodes[i]->flags |= NODE_FLAGS_CONNECTED;
- DEBUG(0,("ctdb chose network address %s:%u vnn %u\n",
+ DEBUG(1,("ctdb chose network address %s:%u vnn %u\n",
ctdb->address.address,
ctdb->address.port,
ctdb->vnn));
printf(" pending_calls %u\n", s->pending_calls);
printf(" lockwait_calls %u\n", s->lockwait_calls);
printf(" pending_lockwait_calls %u\n", s->pending_lockwait_calls);
+ printf(" max_hop_count %u\n", s->max_hop_count);
printf(" max_call_latency %.6f sec\n", s->max_call_latency);
printf(" max_lockwait_latency %.6f sec\n", s->max_lockwait_latency);
}
for (j=0;j<num_ints;j++) {
v2[j] += v1[j];
}
+ status.max_hop_count =
+ MAX(status.max_hop_count, s1.max_hop_count);
status.max_call_latency =
MAX(status.max_call_latency, s1.max_call_latency);
status.max_lockwait_latency =