mirror of
https://github.com/samba-team/samba.git
synced 2025-01-05 09:18:06 +03:00
ctdb-protocol: Add CTDB_SRVID_LEADER
CTDB_SRVID_LEADER will be regularly broadcast to all connected nodes by the leader. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
parent
c2cfd9c21a
commit
3d3767a259
@ -128,6 +128,9 @@ struct ctdb_call {
|
|||||||
/* SRVID to inform of election data */
|
/* SRVID to inform of election data */
|
||||||
#define CTDB_SRVID_ELECTION 0xF100000000000000LL
|
#define CTDB_SRVID_ELECTION 0xF100000000000000LL
|
||||||
|
|
||||||
|
/* SRVID for broadcasting leader */
|
||||||
|
#define CTDB_SRVID_LEADER 0xF101000000000000LL
|
||||||
|
|
||||||
/* SRVID to inform clients that the cluster has been reconfigured */
|
/* SRVID to inform clients that the cluster has been reconfigured */
|
||||||
#define CTDB_SRVID_RECONFIGURE 0xF200000000000000LL
|
#define CTDB_SRVID_RECONFIGURE 0xF200000000000000LL
|
||||||
|
|
||||||
@ -998,7 +1001,7 @@ union ctdb_message_data {
|
|||||||
uint32_t db_id;
|
uint32_t db_id;
|
||||||
/* SRVID_MEM_DUMP, SRVID_TAKEOVER_RUN */
|
/* SRVID_MEM_DUMP, SRVID_TAKEOVER_RUN */
|
||||||
struct ctdb_srvid_message *msg;
|
struct ctdb_srvid_message *msg;
|
||||||
/* SRVID_BANNING, SRVID_REBALANCE_NODE */
|
/* SRVID_BANNING, SRVID_REBALANCE_NODE, SRVID_LEADER */
|
||||||
uint32_t pnn;
|
uint32_t pnn;
|
||||||
/* SRVID_DISABLE_TAKEOVER_RUNS, SRVID_DISABLE_RECOVERIES */
|
/* SRVID_DISABLE_TAKEOVER_RUNS, SRVID_DISABLE_RECOVERIES */
|
||||||
struct ctdb_disable_message *disable;
|
struct ctdb_disable_message *disable;
|
||||||
|
@ -42,6 +42,10 @@ static size_t ctdb_message_data_len(union ctdb_message_data *mdata,
|
|||||||
len = ctdb_election_message_len(mdata->election);
|
len = ctdb_election_message_len(mdata->election);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CTDB_SRVID_LEADER:
|
||||||
|
len = ctdb_uint32_len(&mdata->pnn);
|
||||||
|
break;
|
||||||
|
|
||||||
case CTDB_SRVID_RECONFIGURE:
|
case CTDB_SRVID_RECONFIGURE:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -129,6 +133,10 @@ static void ctdb_message_data_push(union ctdb_message_data *mdata,
|
|||||||
ctdb_election_message_push(mdata->election, buf, &np);
|
ctdb_election_message_push(mdata->election, buf, &np);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CTDB_SRVID_LEADER:
|
||||||
|
ctdb_uint32_push(&mdata->pnn, buf, &np);
|
||||||
|
break;
|
||||||
|
|
||||||
case CTDB_SRVID_RECONFIGURE:
|
case CTDB_SRVID_RECONFIGURE:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -219,6 +227,10 @@ static int ctdb_message_data_pull(uint8_t *buf, size_t buflen,
|
|||||||
&mdata->election, &np);
|
&mdata->election, &np);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CTDB_SRVID_LEADER:
|
||||||
|
ret = ctdb_uint32_pull(buf, buflen, &mdata->pnn, &np);
|
||||||
|
break;
|
||||||
|
|
||||||
case CTDB_SRVID_RECONFIGURE:
|
case CTDB_SRVID_RECONFIGURE:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ generate_control_output ()
|
|||||||
srvid_list="\
|
srvid_list="\
|
||||||
f002000000000000 \
|
f002000000000000 \
|
||||||
f100000000000000 \
|
f100000000000000 \
|
||||||
|
f101000000000000 \
|
||||||
f200000000000000 \
|
f200000000000000 \
|
||||||
f300000000000000 \
|
f300000000000000 \
|
||||||
f301000000000000 \
|
f301000000000000 \
|
||||||
|
@ -1818,6 +1818,7 @@ void fill_ctdb_message_data(TALLOC_CTX *mem_ctx, union ctdb_message_data *md,
|
|||||||
fill_ctdb_srvid_message(md->msg, md->msg);
|
fill_ctdb_srvid_message(md->msg, md->msg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CTDB_SRVID_LEADER:
|
||||||
case CTDB_SRVID_BANNING:
|
case CTDB_SRVID_BANNING:
|
||||||
case CTDB_SRVID_REBALANCE_NODE:
|
case CTDB_SRVID_REBALANCE_NODE:
|
||||||
md->pnn = rand32();
|
md->pnn = rand32();
|
||||||
@ -1881,6 +1882,7 @@ void verify_ctdb_message_data(union ctdb_message_data *md,
|
|||||||
verify_ctdb_srvid_message(md->msg, md2->msg);
|
verify_ctdb_srvid_message(md->msg, md2->msg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CTDB_SRVID_LEADER:
|
||||||
case CTDB_SRVID_BANNING:
|
case CTDB_SRVID_BANNING:
|
||||||
case CTDB_SRVID_REBALANCE_NODE:
|
case CTDB_SRVID_REBALANCE_NODE:
|
||||||
assert(md->pnn == md2->pnn);
|
assert(md->pnn == md2->pnn);
|
||||||
|
@ -1218,6 +1218,7 @@ int main(int argc, char *argv[])
|
|||||||
uint64_t test_srvid[] = {
|
uint64_t test_srvid[] = {
|
||||||
CTDB_SRVID_BANNING,
|
CTDB_SRVID_BANNING,
|
||||||
CTDB_SRVID_ELECTION,
|
CTDB_SRVID_ELECTION,
|
||||||
|
CTDB_SRVID_LEADER,
|
||||||
CTDB_SRVID_RECONFIGURE,
|
CTDB_SRVID_RECONFIGURE,
|
||||||
CTDB_SRVID_RELEASE_IP,
|
CTDB_SRVID_RELEASE_IP,
|
||||||
CTDB_SRVID_TAKE_IP,
|
CTDB_SRVID_TAKE_IP,
|
||||||
|
@ -310,6 +310,7 @@ int main(int argc, char *argv[])
|
|||||||
uint64_t test_srvid[] = {
|
uint64_t test_srvid[] = {
|
||||||
CTDB_SRVID_BANNING,
|
CTDB_SRVID_BANNING,
|
||||||
CTDB_SRVID_ELECTION,
|
CTDB_SRVID_ELECTION,
|
||||||
|
CTDB_SRVID_LEADER,
|
||||||
CTDB_SRVID_RECONFIGURE,
|
CTDB_SRVID_RECONFIGURE,
|
||||||
CTDB_SRVID_RELEASE_IP,
|
CTDB_SRVID_RELEASE_IP,
|
||||||
CTDB_SRVID_TAKE_IP,
|
CTDB_SRVID_TAKE_IP,
|
||||||
|
Loading…
Reference in New Issue
Block a user