mirror of
https://github.com/samba-team/samba.git
synced 2025-03-23 06:50:21 +03:00
remove the control to bump the rsn since we dont need it anymore
(This used to be ctdb commit a646b6d77bd8adf6c986259c534a05400c4bde11)
This commit is contained in:
parent
4bacd385ef
commit
ed466e20b6
ctdb
@ -1193,31 +1193,6 @@ int ctdb_ctrl_cleardb(struct ctdb_context *ctdb, uint32_t destnode, TALLOC_CTX *
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
bump rsn on all records
|
||||
*/
|
||||
int ctdb_ctrl_bumprsn(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, uint32_t dbid)
|
||||
{
|
||||
int ret;
|
||||
TDB_DATA indata, outdata;
|
||||
int32_t res;
|
||||
|
||||
indata.dsize = sizeof(uint32_t);
|
||||
indata.dptr = (unsigned char *)talloc_array(mem_ctx, uint32_t, 1);
|
||||
|
||||
((uint32_t *)(&indata.dptr[0]))[0] = dbid;
|
||||
|
||||
ret = ctdb_control(ctdb, destnode, 0,
|
||||
CTDB_CONTROL_BUMP_RSN, 0, indata,
|
||||
mem_ctx, &outdata, &res, &timeout, NULL);
|
||||
if (ret != 0 || res != 0) {
|
||||
DEBUG(0,(__location__ " ctdb_control for bumprsn failed\n"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
ping a node, return number of clients connected
|
||||
*/
|
||||
|
@ -115,10 +115,6 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
|
||||
CHECK_CONTROL_DATA_SIZE(sizeof(uint32_t));
|
||||
return ctdb_control_clear_db(ctdb, indata);
|
||||
|
||||
case CTDB_CONTROL_BUMP_RSN:
|
||||
CHECK_CONTROL_DATA_SIZE(sizeof(uint32_t));
|
||||
return ctdb_control_bump_rsn(ctdb, indata);
|
||||
|
||||
case CTDB_CONTROL_PUSH_DB:
|
||||
return ctdb_control_push_db(ctdb, indata);
|
||||
|
||||
|
@ -445,40 +445,3 @@ int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb, TDB_DATA indata,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int traverse_bumprsn(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *p)
|
||||
{
|
||||
struct ctdb_ltdb_header *header = (struct ctdb_ltdb_header *)data.dptr;
|
||||
int ret;
|
||||
|
||||
header->rsn++;
|
||||
|
||||
ret = tdb_store(tdb, key, data, TDB_REPLACE);
|
||||
if (ret) {
|
||||
DEBUG(0,(__location__ "failed to write tdb data back ret:%d\n",ret));
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t ctdb_control_bump_rsn(struct ctdb_context *ctdb, TDB_DATA indata)
|
||||
{
|
||||
uint32_t dbid = *(uint32_t *)indata.dptr;
|
||||
struct ctdb_db_context *ctdb_db;
|
||||
|
||||
ctdb_db = find_ctdb_db(ctdb, dbid);
|
||||
if (!ctdb_db) {
|
||||
DEBUG(0,(__location__ " Unknown db 0x%08x\n",dbid));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (tdb_lockall_nonblock(ctdb_db->ltdb->tdb) != 0) {
|
||||
DEBUG(0,(__location__ " Failed to get nonblock lock on entired db - failing\n"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
tdb_traverse(ctdb_db->ltdb->tdb, traverse_bumprsn, NULL);
|
||||
|
||||
tdb_unlockall(ctdb_db->ltdb->tdb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -271,23 +271,6 @@ static int update_dmaster_on_all_databases(struct ctdb_context *ctdb, struct ctd
|
||||
}
|
||||
|
||||
|
||||
static int bump_rsn_on_all_databases(struct ctdb_context *ctdb, uint32_t vnn, struct ctdb_dbid_map *dbmap, TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
/* bump rsn for all records in all databases */
|
||||
for (i=0;i<dbmap->num;i++) {
|
||||
ret = ctdb_ctrl_bumprsn(ctdb, timeval_current_ofs(1, 0), vnn, ctdb, dbmap->dbids[i]);
|
||||
if (ret != 0) {
|
||||
DEBUG(0, (__location__ "Unable to bump rsn for db:0x%08x\n", dbmap->dbids[i]));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int push_all_local_databases(struct ctdb_context *ctdb, struct ctdb_node_map *nodemap, uint32_t vnn, struct ctdb_dbid_map *dbmap, TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
int i, j, ret;
|
||||
@ -468,15 +451,6 @@ static int do_recovery(struct ctdb_context *ctdb, struct event_context *ev,
|
||||
}
|
||||
|
||||
|
||||
/* bump the rsn number on all databases
|
||||
*/
|
||||
ret = bump_rsn_on_all_databases(ctdb, vnn, dbmap, mem_ctx);
|
||||
if (ret != 0) {
|
||||
DEBUG(0, (__location__ "Unable to bump the rsn on all databases\n"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* disable recovery mode */
|
||||
ret = set_recovery_mode(ctdb, nodemap, CTDB_RECOVERY_NORMAL);
|
||||
if (ret!=0) {
|
||||
|
@ -350,7 +350,6 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS,
|
||||
CTDB_CONTROL_GET_PID,
|
||||
CTDB_CONTROL_GET_RECMASTER,
|
||||
CTDB_CONTROL_SET_RECMASTER,
|
||||
CTDB_CONTROL_BUMP_RSN,
|
||||
CTDB_CONTROL_FREEZE,
|
||||
CTDB_CONTROL_THAW,
|
||||
};
|
||||
@ -791,7 +790,6 @@ int32_t ctdb_control_pull_db(struct ctdb_context *ctdb, TDB_DATA indata, TDB_DAT
|
||||
int32_t ctdb_control_push_db(struct ctdb_context *ctdb, TDB_DATA indata);
|
||||
int32_t ctdb_control_set_dmaster(struct ctdb_context *ctdb, TDB_DATA indata);
|
||||
int32_t ctdb_control_clear_db(struct ctdb_context *ctdb, TDB_DATA indata);
|
||||
int32_t ctdb_control_bump_rsn(struct ctdb_context *ctdb, TDB_DATA indata);
|
||||
|
||||
int32_t ctdb_control_set_recmode(struct ctdb_context *ctdb, TDB_DATA data, const char **);
|
||||
void ctdb_request_control_reply(struct ctdb_context *ctdb, struct ctdb_req_control *c,
|
||||
|
Loading…
x
Reference in New Issue
Block a user