*/
int ctdb_ctrl_getnodemap(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
- TALLOC_CTX *mem_ctx, struct ctdb_node_map **nodemap)
+ TALLOC_CTX *mem_ctx, struct ctdb_node_map_old **nodemap)
{
int ret;
TDB_DATA outdata;
return -1;
}
- *nodemap = (struct ctdb_node_map *)talloc_memdup(mem_ctx, outdata.dptr, outdata.dsize);
+ *nodemap = (struct ctdb_node_map_old *)talloc_memdup(mem_ctx, outdata.dptr, outdata.dsize);
talloc_free(outdata.dptr);
return 0;
}
*/
int ctdb_ctrl_getnodesfile(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
- TALLOC_CTX *mem_ctx, struct ctdb_node_map **nodemap)
+ TALLOC_CTX *mem_ctx, struct ctdb_node_map_old **nodemap)
{
int ret;
TDB_DATA outdata;
return -1;
}
- *nodemap = (struct ctdb_node_map *)talloc_memdup(mem_ctx, outdata.dptr, outdata.dsize);
+ *nodemap = (struct ctdb_node_map_old *)talloc_memdup(mem_ctx, outdata.dptr, outdata.dsize);
talloc_free(outdata.dptr);
return 0;
TALLOC_CTX *mem_ctx,
uint32_t *num_nodes)
{
- struct ctdb_node_map *map=NULL;
+ struct ctdb_node_map_old *map=NULL;
int ret, i;
uint32_t *nodes;
{
int ret;
TDB_DATA data;
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
struct ctdb_node_flag_change c;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
uint32_t recmaster;
* If exclude_pnn is not -1 then exclude that pnn from the list.
*/
uint32_t *list_of_nodes(struct ctdb_context *ctdb,
- struct ctdb_node_map *node_map,
+ struct ctdb_node_map_old *node_map,
TALLOC_CTX *mem_ctx,
uint32_t mask,
int exclude_pnn)
}
uint32_t *list_of_active_nodes(struct ctdb_context *ctdb,
- struct ctdb_node_map *node_map,
+ struct ctdb_node_map_old *node_map,
TALLOC_CTX *mem_ctx,
bool include_self)
{
}
uint32_t *list_of_connected_nodes(struct ctdb_context *ctdb,
- struct ctdb_node_map *node_map,
+ struct ctdb_node_map_old *node_map,
TALLOC_CTX *mem_ctx,
bool include_self)
{
ctdb_get_capabilities(struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx,
struct timeval timeout,
- struct ctdb_node_map *nodemap)
+ struct ctdb_node_map_old *nodemap)
{
uint32_t *nodes;
uint32_t i, res;
unsigned ctdb_addr_to_port(ctdb_sock_addr *addr);
-struct ctdb_node_map *ctdb_read_nodes_file(TALLOC_CTX *mem_ctx,
- const char *nlist);
+struct ctdb_node_map_old *ctdb_read_nodes_file(TALLOC_CTX *mem_ctx,
+ const char *nlist);
-struct ctdb_node_map *ctdb_node_list_to_map(struct ctdb_node **nodes,
- uint32_t num_nodes,
- TALLOC_CTX *mem_ctx);
+struct ctdb_node_map_old *ctdb_node_list_to_map(struct ctdb_node **nodes,
+ uint32_t num_nodes,
+ TALLOC_CTX *mem_ctx);
const char *runstate_to_string(enum ctdb_runstate runstate);
/* Add a node to a node map with given address and flags */
static bool node_map_add(TALLOC_CTX *mem_ctx,
const char *nstr, uint32_t flags,
- struct ctdb_node_map **node_map)
+ struct ctdb_node_map_old **node_map)
{
ctdb_sock_addr addr;
uint32_t num;
}
num = (*node_map)->num + 1;
- s = offsetof(struct ctdb_node_map, nodes) +
+ s = offsetof(struct ctdb_node_map_old, nodes) +
num * sizeof(struct ctdb_node_and_flags);
*node_map = talloc_realloc_size(mem_ctx, *node_map, s);
if (*node_map == NULL) {
}
/* Read a nodes file into a node map */
-struct ctdb_node_map *ctdb_read_nodes_file(TALLOC_CTX *mem_ctx,
+struct ctdb_node_map_old *ctdb_read_nodes_file(TALLOC_CTX *mem_ctx,
const char *nlist)
{
char **lines;
int nlines;
int i;
- struct ctdb_node_map *ret;
+ struct ctdb_node_map_old *ret;
/* Allocate node map header */
- ret = talloc_zero_size(mem_ctx, offsetof(struct ctdb_node_map, nodes));
+ ret = talloc_zero_size(mem_ctx, offsetof(struct ctdb_node_map_old, nodes));
if (ret == NULL) {
DEBUG(DEBUG_ERR, (__location__ " Out of memory\n"));
return false;
return ret;
}
-struct ctdb_node_map *
+struct ctdb_node_map_old *
ctdb_node_list_to_map(struct ctdb_node **nodes, uint32_t num_nodes,
TALLOC_CTX *mem_ctx)
{
uint32_t i;
size_t size;
- struct ctdb_node_map *node_map;
+ struct ctdb_node_map_old *node_map;
- size = offsetof(struct ctdb_node_map, nodes) +
+ size = offsetof(struct ctdb_node_map_old, nodes) +
num_nodes * sizeof(struct ctdb_node_and_flags);
- node_map = (struct ctdb_node_map *)talloc_zero_size(mem_ctx, size);
+ node_map = (struct ctdb_node_map_old *)talloc_zero_size(mem_ctx, size);
if (node_map == NULL) {
DEBUG(DEBUG_ERR,
(__location__ " Failed to allocate nodemap array\n"));
int ctdb_ctrl_getnodemap(struct ctdb_context *ctdb, struct timeval timeout,
uint32_t destnode, TALLOC_CTX *mem_ctx,
- struct ctdb_node_map **nodemap);
+ struct ctdb_node_map_old **nodemap);
int ctdb_ctrl_getnodesfile(struct ctdb_context *ctdb, struct timeval timeout,
uint32_t destnode, TALLOC_CTX *mem_ctx,
- struct ctdb_node_map **nodemap);
+ struct ctdb_node_map_old **nodemap);
int ctdb_ctrl_reload_nodes_file(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode);
TALLOC_CTX *mem_ctx, bool include_self);
uint32_t *list_of_nodes(struct ctdb_context *ctdb,
- struct ctdb_node_map *node_map,
+ struct ctdb_node_map_old *node_map,
TALLOC_CTX *mem_ctx, uint32_t mask, int exclude_pnn);
uint32_t *list_of_active_nodes(struct ctdb_context *ctdb,
- struct ctdb_node_map *node_map,
+ struct ctdb_node_map_old *node_map,
TALLOC_CTX *mem_ctx, bool include_self);
uint32_t *list_of_connected_nodes(struct ctdb_context *ctdb,
- struct ctdb_node_map *node_map,
+ struct ctdb_node_map_old *node_map,
TALLOC_CTX *mem_ctx, bool include_self);
int ctdb_read_pnn_lock(int fd, int32_t pnn);
struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx,
struct timeval timeout,
- struct ctdb_node_map *nodemap);
+ struct ctdb_node_map_old *nodemap);
/* Get capabilities for specified node, NULL if not found */
uint32_t *ctdb_get_node_capabilities(struct ctdb_node_capabilities *caps,
int ctdb_set_single_public_ip(struct ctdb_context *ctdb, const char *iface,
const char *ip);
-int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap,
+int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodemap,
uint32_t *force_rebalance_nodes,
client_async_callback fail_callback, void *callback_data);
The nodemap is the structure containing a list of all nodes
known to the cluster and their associated flags.
*/
-struct ctdb_node_map {
+struct ctdb_node_map_old {
uint32_t num;
struct ctdb_node_and_flags nodes[1];
};
int ctdb_control_getnodesfile(struct ctdb_context *ctdb, uint32_t opcode, TDB_DATA indata, TDB_DATA *outdata)
{
- struct ctdb_node_map *node_map = NULL;
+ struct ctdb_node_map_old *node_map = NULL;
CHECK_CONTROL_DATA_SIZE(0);
struct ctdb_context *ctdb;
uint32_t recmaster;
uint32_t last_culprit_node;
- struct ctdb_node_map *nodemap;
+ struct ctdb_node_map_old *nodemap;
struct timeval priority_time;
bool need_takeover_run;
bool need_recovery;
/*
run the "recovered" eventscript on all nodes
*/
-static int run_recovered_eventscript(struct ctdb_recoverd *rec, struct ctdb_node_map *nodemap, const char *caller)
+static int run_recovered_eventscript(struct ctdb_recoverd *rec, struct ctdb_node_map_old *nodemap, const char *caller)
{
TALLOC_CTX *tmp_ctx;
uint32_t *nodes;
/*
run the "startrecovery" eventscript on all nodes
*/
-static int run_startrecovery_eventscript(struct ctdb_recoverd *rec, struct ctdb_node_map *nodemap)
+static int run_startrecovery_eventscript(struct ctdb_recoverd *rec, struct ctdb_node_map_old *nodemap)
{
TALLOC_CTX *tmp_ctx;
uint32_t *nodes;
update the node capabilities for all connected nodes
*/
static int update_capabilities(struct ctdb_recoverd *rec,
- struct ctdb_node_map *nodemap)
+ struct ctdb_node_map_old *nodemap)
{
uint32_t *capp;
TALLOC_CTX *tmp_ctx;
*/
static int set_recovery_mode(struct ctdb_context *ctdb,
struct ctdb_recoverd *rec,
- struct ctdb_node_map *nodemap,
+ struct ctdb_node_map_old *nodemap,
uint32_t rec_mode, bool freeze)
{
TDB_DATA data;
/*
change recovery master on all node
*/
-static int set_recovery_master(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap, uint32_t pnn)
+static int set_recovery_master(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodemap, uint32_t pnn)
{
TDB_DATA data;
TALLOC_CTX *tmp_ctx;
a recovery if this call fails.
*/
static int update_db_priority_on_remote_nodes(struct ctdb_context *ctdb,
- struct ctdb_node_map *nodemap,
+ struct ctdb_node_map_old *nodemap,
uint32_t pnn, struct ctdb_dbid_map *dbmap, TALLOC_CTX *mem_ctx)
{
int db;
/*
ensure all other nodes have attached to any databases that we have
*/
-static int create_missing_remote_databases(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap,
+static int create_missing_remote_databases(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodemap,
uint32_t pnn, struct ctdb_dbid_map *dbmap, TALLOC_CTX *mem_ctx)
{
int i, j, db, ret;
/*
ensure we are attached to any databases that anyone else is attached to
*/
-static int create_missing_local_databases(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap,
+static int create_missing_local_databases(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodemap,
uint32_t pnn, struct ctdb_dbid_map **dbmap, TALLOC_CTX *mem_ctx)
{
int i, j, db, ret;
static int pull_highest_seqnum_pdb(struct ctdb_context *ctdb,
struct ctdb_recoverd *rec,
- struct ctdb_node_map *nodemap,
+ struct ctdb_node_map_old *nodemap,
struct tdb_wrap *recdb, uint32_t dbid)
{
TALLOC_CTX *tmp_ctx = talloc_new(NULL);
*/
static int pull_remote_database(struct ctdb_context *ctdb,
struct ctdb_recoverd *rec,
- struct ctdb_node_map *nodemap,
+ struct ctdb_node_map_old *nodemap,
struct tdb_wrap *recdb, uint32_t dbid,
bool persistent)
{
/*
update flags on all active nodes
*/
-static int update_flags_on_all_nodes(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap, uint32_t pnn, uint32_t flags)
+static int update_flags_on_all_nodes(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodemap, uint32_t pnn, uint32_t flags)
{
int ret;
/*
ensure all nodes have the same vnnmap we do
*/
-static int update_vnnmap_on_all_nodes(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap,
+static int update_vnnmap_on_all_nodes(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodemap,
uint32_t pnn, struct ctdb_vnn_map *vnnmap, TALLOC_CTX *mem_ctx)
{
int j, ret;
Update our local flags from all remote connected nodes.
This is only run when we are or we belive we are the recovery master
*/
-static int update_local_flags(struct ctdb_recoverd *rec, struct ctdb_node_map *nodemap)
+static int update_local_flags(struct ctdb_recoverd *rec, struct ctdb_node_map_old *nodemap)
{
int j;
struct ctdb_context *ctdb = rec->ctdb;
they are the same as for this node
*/
for (j=0; j<nodemap->num; j++) {
- struct ctdb_node_map *remote_nodemap=NULL;
+ struct ctdb_node_map_old *remote_nodemap=NULL;
int ret;
if (nodemap->nodes[j].flags & NODE_FLAGS_DISCONNECTED) {
*/
static int push_recdb_database(struct ctdb_context *ctdb, uint32_t dbid,
bool persistent,
- struct tdb_wrap *recdb, struct ctdb_node_map *nodemap)
+ struct tdb_wrap *recdb, struct ctdb_node_map_old *nodemap)
{
struct recdb_data params;
struct ctdb_marshall_buffer *recdata;
uint32_t dbid,
bool persistent,
uint32_t pnn,
- struct ctdb_node_map *nodemap,
+ struct ctdb_node_map_old *nodemap,
uint32_t transaction_id)
{
struct tdb_wrap *recdb;
static int ctdb_reload_remote_public_ips(struct ctdb_context *ctdb,
struct ctdb_recoverd *rec,
- struct ctdb_node_map *nodemap,
+ struct ctdb_node_map_old *nodemap,
uint32_t *culprit)
{
int j;
}
static bool do_takeover_run(struct ctdb_recoverd *rec,
- struct ctdb_node_map *nodemap,
+ struct ctdb_node_map_old *nodemap,
bool banning_credits_on_fail)
{
uint32_t *nodes = NULL;
}
static int db_recovery_serial(struct ctdb_recoverd *rec, TALLOC_CTX *mem_ctx,
- uint32_t pnn, struct ctdb_node_map *nodemap,
+ uint32_t pnn, struct ctdb_node_map_old *nodemap,
struct ctdb_vnn_map *vnnmap,
struct ctdb_dbid_map *dbmap)
{
*/
static int do_recovery(struct ctdb_recoverd *rec,
TALLOC_CTX *mem_ctx, uint32_t pnn,
- struct ctdb_node_map *nodemap, struct ctdb_vnn_map *vnnmap)
+ struct ctdb_node_map_old *nodemap, struct ctdb_vnn_map *vnnmap)
{
struct ctdb_context *ctdb = rec->ctdb;
int i, ret;
static void ctdb_election_data(struct ctdb_recoverd *rec, struct election_message *em)
{
int ret, i;
- struct ctdb_node_map *nodemap;
+ struct ctdb_node_map_old *nodemap;
struct ctdb_context *ctdb = rec->ctdb;
ZERO_STRUCTP(em);
static void unban_all_nodes(struct ctdb_context *ctdb)
{
int ret, i;
- struct ctdb_node_map *nodemap;
+ struct ctdb_node_map_old *nodemap;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
ret = ctdb_ctrl_getnodemap(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, tmp_ctx, &nodemap);
force the start of the election process
*/
static void force_election(struct ctdb_recoverd *rec, uint32_t pnn,
- struct ctdb_node_map *nodemap)
+ struct ctdb_node_map_old *nodemap)
{
int ret;
struct ctdb_context *ctdb = rec->ctdb;
struct ctdb_context *ctdb = rec->ctdb;
int ret;
struct ctdb_node_flag_change *c = (struct ctdb_node_flag_change *)data.dptr;
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
TALLOC_CTX *tmp_ctx;
int i;
int disabled_flag_changed;
struct ctdb_context *ctdb = rec->ctdb;
int ret;
struct ctdb_node_flag_change *c = (struct ctdb_node_flag_change *)data.dptr;
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
uint32_t recmaster;
uint32_t *nodes;
/* verify that all nodes are in normal recovery mode */
-static enum monitor_result verify_recmode(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap)
+static enum monitor_result verify_recmode(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodemap)
{
struct verify_recmode_normal_data *rmdata;
TALLOC_CTX *mem_ctx = talloc_new(ctdb);
/* verify that all nodes agree that we are the recmaster */
-static enum monitor_result verify_recmaster(struct ctdb_recoverd *rec, struct ctdb_node_map *nodemap, uint32_t pnn)
+static enum monitor_result verify_recmaster(struct ctdb_recoverd *rec, struct ctdb_node_map_old *nodemap, uint32_t pnn)
{
struct ctdb_context *ctdb = rec->ctdb;
struct verify_recmaster_data *rmdata;
/* called to check that the local allocation of public ip addresses is ok.
*/
-static int verify_local_ip_allocation(struct ctdb_context *ctdb, struct ctdb_recoverd *rec, uint32_t pnn, struct ctdb_node_map *nodemap)
+static int verify_local_ip_allocation(struct ctdb_context *ctdb, struct ctdb_recoverd *rec, uint32_t pnn, struct ctdb_node_map_old *nodemap)
{
TALLOC_CTX *mem_ctx = talloc_new(NULL);
struct ctdb_uptime *uptime1 = NULL;
static void async_getnodemap_callback(struct ctdb_context *ctdb, uint32_t node_pnn, int32_t res, TDB_DATA outdata, void *callback_data)
{
- struct ctdb_node_map **remote_nodemaps = callback_data;
+ struct ctdb_node_map_old **remote_nodemaps = callback_data;
if (node_pnn >= ctdb->num_nodes) {
DEBUG(DEBUG_ERR,(__location__ " pnn from invalid node\n"));
return;
}
- remote_nodemaps[node_pnn] = (struct ctdb_node_map *)talloc_steal(remote_nodemaps, outdata.dptr);
+ remote_nodemaps[node_pnn] = (struct ctdb_node_map_old *)talloc_steal(remote_nodemaps, outdata.dptr);
}
static int get_remote_nodemaps(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx,
- struct ctdb_node_map *nodemap,
- struct ctdb_node_map **remote_nodemaps)
+ struct ctdb_node_map_old *nodemap,
+ struct ctdb_node_map_old **remote_nodemaps)
{
uint32_t *nodes;
TALLOC_CTX *mem_ctx)
{
uint32_t pnn;
- struct ctdb_node_map *nodemap=NULL;
- struct ctdb_node_map *recmaster_nodemap=NULL;
- struct ctdb_node_map **remote_nodemaps=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
+ struct ctdb_node_map_old *recmaster_nodemap=NULL;
+ struct ctdb_node_map_old **remote_nodemaps=NULL;
struct ctdb_vnn_map *vnnmap=NULL;
struct ctdb_vnn_map *remote_vnnmap=NULL;
uint32_t num_lmasters;
/* get the nodemap for all active remote nodes
*/
- remote_nodemaps = talloc_array(mem_ctx, struct ctdb_node_map *, nodemap->num);
+ remote_nodemaps = talloc_array(mem_ctx, struct ctdb_node_map_old *, nodemap->num);
if (remote_nodemaps == NULL) {
DEBUG(DEBUG_ERR, (__location__ " failed to allocate remote nodemap array\n"));
return;
/* Load a nodes list file into a nodes array */
static int convert_node_map_to_list(struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx,
- struct ctdb_node_map *node_map,
+ struct ctdb_node_map_old *node_map,
struct ctdb_node ***nodes,
uint32_t *num_nodes)
{
/* Load the nodes list from a file */
void ctdb_load_nodes_file(struct ctdb_context *ctdb)
{
- struct ctdb_node_map *node_map;
+ struct ctdb_node_map_old *node_map;
int ret;
node_map = ctdb_read_nodes_file(ctdb, ctdb->nodes_file);
talloc_free(tmp_ctx);
}
-static bool all_nodes_are_disabled(struct ctdb_node_map *nodemap)
+static bool all_nodes_are_disabled(struct ctdb_node_map_old *nodemap)
{
int i;
static uint32_t *get_tunable_from_nodes(struct ctdb_context *ctdb,
TALLOC_CTX *tmp_ctx,
- struct ctdb_node_map *nodemap,
+ struct ctdb_node_map_old *nodemap,
const char *tunable,
uint32_t default_value)
{
static enum ctdb_runstate * get_runstate_from_nodes(struct ctdb_context *ctdb,
TALLOC_CTX *tmp_ctx,
- struct ctdb_node_map *nodemap,
+ struct ctdb_node_map_old *nodemap,
enum ctdb_runstate default_value)
{
uint32_t *nodes;
static struct ctdb_ipflags *
set_ipflags_internal(struct ctdb_context *ctdb,
TALLOC_CTX *tmp_ctx,
- struct ctdb_node_map *nodemap,
+ struct ctdb_node_map_old *nodemap,
uint32_t *tval_noiptakeover,
uint32_t *tval_noiphostonalldisabled,
enum ctdb_runstate *runstate)
static struct ctdb_ipflags *set_ipflags(struct ctdb_context *ctdb,
TALLOC_CTX *tmp_ctx,
- struct ctdb_node_map *nodemap)
+ struct ctdb_node_map_old *nodemap)
{
uint32_t *tval_noiptakeover;
uint32_t *tval_noiphostonalldisabled;
int retry_count;
client_async_callback fail_callback;
void *fail_callback_data;
- struct ctdb_node_map *nodemap;
+ struct ctdb_node_map_old *nodemap;
};
static void iprealloc_fail_callback(struct ctdb_context *ctdb, uint32_t pnn,
bool *node_failed;
client_async_callback fail_callback;
void *fail_callback_data;
- struct ctdb_node_map *nodemap;
+ struct ctdb_node_map_old *nodemap;
};
static void takeover_run_fail_callback(struct ctdb_context *ctdb,
/*
make any IP alias changes for public addresses that are necessary
*/
-int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap,
+int ctdb_takeover_run(struct ctdb_context *ctdb, struct ctdb_node_map_old *nodemap,
uint32_t *force_rebalance_nodes,
client_async_callback fail_callback, void *callback_data)
{
struct ctdb_context *ctdb = ctdb_db->ctdb;
struct delete_records_list *recs;
TDB_DATA indata;
- struct ctdb_node_map *nodemap;
+ struct ctdb_node_map_old *nodemap;
uint32_t *active_nodes;
int num_active_nodes;
TALLOC_CTX *tmp_ctx;
int i, numnodes;
uint32_t nodeflags[CTDB_TEST_MAX_NODES];
char *tok, *ns, *t;
- struct ctdb_node_map *nodemap;
+ struct ctdb_node_map_old *nodemap;
uint32_t *tval_noiptakeover;
uint32_t *tval_noiptakeoverondisabled;
enum ctdb_runstate *runstate;
runstate = get_runstate(*ctdb, numnodes);
- nodemap = talloc_array(*ctdb, struct ctdb_node_map, numnodes);
+ nodemap = talloc_array(*ctdb, struct ctdb_node_map_old, numnodes);
nodemap->num = numnodes;
if (!read_ips_for_multiple_nodes) {
int ctdb_ctrl_getnodemap(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
- TALLOC_CTX *mem_ctx, struct ctdb_node_map **nodemap);
+ TALLOC_CTX *mem_ctx, struct ctdb_node_map_old **nodemap);
int ctdb_ctrl_getnodesfile(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
TALLOC_CTX *mem_ctx,
- struct ctdb_node_map **nodemap);
+ struct ctdb_node_map_old **nodemap);
int ctdb_ctrl_get_ifaces(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
TALLOC_CTX *mem_ctx,
ctdb_get_capabilities(struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx,
struct timeval timeout,
- struct ctdb_node_map *nodemap);
+ struct ctdb_node_map_old *nodemap);
#undef TIMELIMIT
ctdb_ctrl_getnodemap_stub(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
TALLOC_CTX *mem_ctx,
- struct ctdb_node_map **nodemap)
+ struct ctdb_node_map_old **nodemap)
{
assert_nodes_set(ctdb);
int
ctdb_ctrl_getnodesfile_stub(struct ctdb_context *ctdb,
struct timeval timeout, uint32_t destnode,
- TALLOC_CTX *mem_ctx, struct ctdb_node_map **nodemap)
+ TALLOC_CTX *mem_ctx, struct ctdb_node_map_old **nodemap)
{
char *v, *f;
res = 0;
break;
case CTDB_CONTROL_GET_NODES_FILE: {
- struct ctdb_node_map *nodemap;
+ struct ctdb_node_map_old *nodemap;
res = ctdb_ctrl_getnodesfile_stub(ctdb, timeout, pnn,
tmp_ctx, &nodemap);
if (res == 0) {
ctdb_get_capabilities_stub(struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx,
struct timeval timeout,
- struct ctdb_node_map *nodemap)
+ struct ctdb_node_map_old *nodemap)
{
return global_caps;
}
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
int n;
uint32_t i;
- struct ctdb_node_map *nodemap;
+ struct ctdb_node_map_old *nodemap;
int ret;
*nodes = NULL;
}
-static struct ctdb_node_map *read_nodes_file(TALLOC_CTX *mem_ctx)
+static struct ctdb_node_map_old *read_nodes_file(TALLOC_CTX *mem_ctx)
{
const char *nodes_list;
static int find_node_xpnn(void)
{
TALLOC_CTX *mem_ctx = talloc_new(NULL);
- struct ctdb_node_map *node_map;
+ struct ctdb_node_map_old *node_map;
int i, pnn;
node_map = read_nodes_file(mem_ctx);
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
int i;
struct ctdb_vnn_map *vnnmap=NULL;
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
uint32_t recmode, recmaster, mypnn;
int num_deleted_nodes = 0;
int ret;
{
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
int i, ret;
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
uint32_t * nodes;
uint32_t pnn_mode, mypnn;
return ret;
}
-static struct ctdb_node_map *read_natgw_nodes_file(struct ctdb_context *ctdb,
+static struct ctdb_node_map_old *read_natgw_nodes_file(struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx)
{
const char *natgw_list;
- struct ctdb_node_map *natgw_nodes = NULL;
+ struct ctdb_node_map_old *natgw_nodes = NULL;
natgw_list = getenv("CTDB_NATGW_NODES");
if (natgw_list == NULL) {
/* talloc off the existing nodemap... */
-static struct ctdb_node_map *talloc_nodemap(struct ctdb_node_map *nodemap)
+static struct ctdb_node_map_old *talloc_nodemap(struct ctdb_node_map_old *nodemap)
{
return talloc_zero_size(nodemap,
- offsetof(struct ctdb_node_map, nodes) +
+ offsetof(struct ctdb_node_map_old, nodes) +
nodemap->num * sizeof(struct ctdb_node_and_flags));
}
-static struct ctdb_node_map *
+static struct ctdb_node_map_old *
filter_nodemap_by_addrs(struct ctdb_context *ctdb,
- struct ctdb_node_map *nodemap,
- struct ctdb_node_map *natgw_nodes)
+ struct ctdb_node_map_old *nodemap,
+ struct ctdb_node_map_old *natgw_nodes)
{
int i, j;
- struct ctdb_node_map *ret;
+ struct ctdb_node_map_old *ret;
ret = talloc_nodemap(nodemap);
CTDB_NO_MEMORY_NULL(ctdb, ret);
return ret;
}
-static struct ctdb_node_map *
+static struct ctdb_node_map_old *
filter_nodemap_by_capabilities(struct ctdb_context *ctdb,
- struct ctdb_node_map *nodemap,
+ struct ctdb_node_map_old *nodemap,
uint32_t required_capabilities,
bool first_only)
{
int i;
uint32_t capabilities;
- struct ctdb_node_map *ret;
+ struct ctdb_node_map_old *ret;
ret = talloc_nodemap(nodemap);
CTDB_NO_MEMORY_NULL(ctdb, ret);
return ret;
}
-static struct ctdb_node_map *
+static struct ctdb_node_map_old *
filter_nodemap_by_flags(struct ctdb_context *ctdb,
- struct ctdb_node_map *nodemap,
+ struct ctdb_node_map_old *nodemap,
uint32_t flags_mask)
{
int i;
- struct ctdb_node_map *ret;
+ struct ctdb_node_map_old *ret;
ret = talloc_nodemap(nodemap);
CTDB_NO_MEMORY_NULL(ctdb, ret);
{
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
int i, ret;
- struct ctdb_node_map *natgw_nodes = NULL;
- struct ctdb_node_map *orig_nodemap=NULL;
- struct ctdb_node_map *nodemap;
+ struct ctdb_node_map_old *natgw_nodes = NULL;
+ struct ctdb_node_map_old *orig_nodemap=NULL;
+ struct ctdb_node_map_old *nodemap;
uint32_t mypnn, pnn;
const char *ip;
for (i = 0; exclude_flags[i] != 0; i++) {
/* ... get a nodemap that excludes nodes with with
* masked flags... */
- struct ctdb_node_map *t =
+ struct ctdb_node_map_old *t =
filter_nodemap_by_flags(ctdb, nodemap,
exclude_flags[i]);
if (t == NULL) {
if (t->num > 0) {
/* ... and find the first node with the NATGW
* capability */
- struct ctdb_node_map *n;
+ struct ctdb_node_map_old *n;
n = filter_nodemap_by_capabilities(ctdb, t,
CTDB_CAP_NATGW,
true);
uint32_t *nodes;
uint32_t disable_time;
TDB_DATA data;
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
disable_time = 30;
{
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
struct ctdb_all_public_ips *ips;
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
int i, j, ret;
int pnn;
uint32_t *nodes;
uint32_t disable_time;
TDB_DATA data;
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
disable_time = 30;
control_get_all_public_ips(struct ctdb_context *ctdb, TALLOC_CTX *tmp_ctx, struct ctdb_all_public_ips **ips)
{
struct ctdb_all_public_ips *tmp_ips;
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
trbt_tree_t *ip_tree;
int i, j, len, ret;
uint32_t count;
reply_data.done = false;
if (wait_for_all) {
- struct ctdb_node_map *nodemap;
+ struct ctdb_node_map_old *nodemap;
ret = ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(),
CTDB_CURRENT_NODE, ctdb, &nodemap);
static int control_delip_all(struct ctdb_context *ctdb, int argc, const char **argv, ctdb_sock_addr *addr)
{
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
struct ctdb_all_public_ips *ips;
int ret, i, j;
const char *desc,
bool set_flag)
{
- struct ctdb_node_map *nodemap = NULL;
+ struct ctdb_node_map_old *nodemap = NULL;
bool flag_is_set;
int ret;
static int control_showban(struct ctdb_context *ctdb, int argc, const char **argv)
{
int ret;
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
struct ctdb_ban_time *bantime;
/* verify the node exists */
static int control_lvs(struct ctdb_context *ctdb, int argc, const char **argv)
{
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
- struct ctdb_node_map *orig_nodemap=NULL;
- struct ctdb_node_map *nodemap;
+ struct ctdb_node_map_old *orig_nodemap=NULL;
+ struct ctdb_node_map_old *nodemap;
int i, ret;
ret = ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(), options.pnn,
ret = 0;
for (i = 0; lvs_exclude_flags[i] != 0; i++) {
- struct ctdb_node_map *t =
+ struct ctdb_node_map_old *t =
filter_nodemap_by_flags(ctdb, nodemap,
lvs_exclude_flags[i]);
if (t == NULL) {
static int control_lvsmaster(struct ctdb_context *ctdb, int argc, const char **argv)
{
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
int i, ret;
ret = ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(), options.pnn,
}
for (i = 0; lvs_exclude_flags[i] != 0; i++) {
- struct ctdb_node_map *t =
+ struct ctdb_node_map_old *t =
filter_nodemap_by_flags(ctdb, nodemap,
lvs_exclude_flags[i]);
if (t == NULL) {
goto done;
}
if (t->num > 0) {
- struct ctdb_node_map *n;
+ struct ctdb_node_map_old *n;
n = filter_nodemap_by_capabilities(ctdb,
t,
CTDB_CAP_LVS,
uint32_t db_id;
uint8_t flags;
int ret, i, status = 0;
- struct ctdb_node_map *nodemap = NULL;
+ struct ctdb_node_map_old *nodemap = NULL;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
uint32_t recmode;
TDB_DATA data;
struct db_file_header dbhdr;
struct ctdb_db_context *ctdb_db;
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
struct ctdb_vnn_map *vnnmap=NULL;
int i, fh;
struct ctdb_control_transdb w;
TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
TDB_DATA data;
struct ctdb_db_context *ctdb_db;
- struct ctdb_node_map *nodemap = NULL;
+ struct ctdb_node_map_old *nodemap = NULL;
struct ctdb_vnn_map *vnnmap = NULL;
int i;
struct ctdb_control_transdb w;
static int control_listnodes(struct ctdb_context *ctdb, int argc, const char **argv)
{
TALLOC_CTX *mem_ctx = talloc_new(NULL);
- struct ctdb_node_map *node_map;
+ struct ctdb_node_map_old *node_map;
int i;
assert_single_node_only();
uint32_t node_pnn, int32_t res,
TDB_DATA outdata, void *callback_data)
{
- struct ctdb_node_map **maps =
- talloc_get_type(callback_data, struct ctdb_node_map *);
+ struct ctdb_node_map_old **maps =
+ talloc_get_type(callback_data, struct ctdb_node_map_old *);
- if (outdata.dsize < offsetof(struct ctdb_node_map, nodes) ||
+ if (outdata.dsize < offsetof(struct ctdb_node_map_old, nodes) ||
outdata.dptr == NULL) {
DEBUG(DEBUG_ERR,
(__location__ " Invalid return data: %u %p\n",
("ERROR: Failed to get nodes file from node %u\n", node_pnn));
}
-static struct ctdb_node_map **
+static struct ctdb_node_map_old **
ctdb_get_nodes_files(struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx,
struct timeval timeout,
- struct ctdb_node_map *nodemap)
+ struct ctdb_node_map_old *nodemap)
{
uint32_t *nodes;
int ret;
- struct ctdb_node_map **maps;
+ struct ctdb_node_map_old **maps;
- maps = talloc_zero_array(mem_ctx, struct ctdb_node_map *, nodemap->num);
+ maps = talloc_zero_array(mem_ctx, struct ctdb_node_map_old *, nodemap->num);
CTDB_NO_MEMORY_NULL(ctdb, maps);
nodes = list_of_connected_nodes(ctdb, nodemap, mem_ctx, true);
return maps;
}
-static bool node_files_are_identical(struct ctdb_node_map *nm1,
- struct ctdb_node_map *nm2)
+static bool node_files_are_identical(struct ctdb_node_map_old *nm1,
+ struct ctdb_node_map_old *nm2)
{
int i;
static bool check_all_node_files_are_identical(struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx,
struct timeval timeout,
- struct ctdb_node_map *nodemap,
- struct ctdb_node_map *file_nodemap)
+ struct ctdb_node_map_old *nodemap,
+ struct ctdb_node_map_old *file_nodemap)
{
- static struct ctdb_node_map **maps;
+ static struct ctdb_node_map_old **maps;
int i;
bool ret = true;
reload the nodes file on the local node
*/
static bool sanity_check_nodes_file_changes(TALLOC_CTX *mem_ctx,
- struct ctdb_node_map *nodemap,
- struct ctdb_node_map *file_nodemap)
+ struct ctdb_node_map_old *nodemap,
+ struct ctdb_node_map_old *file_nodemap)
{
int i;
bool should_abort = false;
static int control_reload_nodes_file(struct ctdb_context *ctdb, int argc, const char **argv)
{
int i, ret;
- struct ctdb_node_map *nodemap=NULL;
+ struct ctdb_node_map_old *nodemap=NULL;
TALLOC_CTX *tmp_ctx = talloc_new(NULL);
- struct ctdb_node_map *file_nodemap;
+ struct ctdb_node_map_old *file_nodemap;
uint32_t *conn;
uint32_t timeout;
{
int32_t cstatus=-1;
TDB_DATA outdata;
- struct ctdb_node_map *m;
+ struct ctdb_node_map_old *m;
uint32_t failure_flags;
bool ok = false;
int i, ret;
return false;
}
- m = (struct ctdb_node_map *)outdata.dptr;
+ m = (struct ctdb_node_map_old *)outdata.dptr;
for (i=0; i<m->num; i++) {
if (vnn == m->nodes[i].pnn) {