1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

Revert "recoverd: Use correct tdb flags when creating missing databases"

This reverts commit 10a057d8e15c8c18e540598a940d3548c731b0b4.

This approach would not work when creating local databases since currently
there is no control to receive TDB flags for remote databases.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>

(This used to be ctdb commit ca61eb776ab862bd269e45ee0f9f96e7e1e0e001)
This commit is contained in:
Amitay Isaacs 2013-08-13 13:55:47 +10:00
parent d349b56e2d
commit de6b97ce4f
3 changed files with 8 additions and 10 deletions

View File

@ -1782,20 +1782,18 @@ int ctdb_ctrl_getdbhealth(struct ctdb_context *ctdb,
create a database
*/
int ctdb_ctrl_createdb(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode,
TALLOC_CTX *mem_ctx, const char *name, uint32_t tdb_flags)
TALLOC_CTX *mem_ctx, const char *name, bool persistent)
{
int ret;
int32_t res;
TDB_DATA data;
bool persistent;
data.dptr = discard_const(name);
data.dsize = strlen(name)+1;
persistent = (tdb_flags & CTDB_DB_FLAGS_PERSISTENT);
ret = ctdb_control(ctdb, destnode, 0,
persistent?CTDB_CONTROL_DB_ATTACH_PERSISTENT:CTDB_CONTROL_DB_ATTACH,
tdb_flags, data,
0, data,
mem_ctx, &data, &res, &timeout, NULL);
if (ret != 0 || res != 0) {

View File

@ -289,7 +289,7 @@ int ctdb_ctrl_getdbhealth(struct ctdb_context *ctdb,
uint32_t destnode,
uint32_t dbid, TALLOC_CTX *mem_ctx,
const char **reason);
int ctdb_ctrl_createdb(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, const char *name, uint32_t tdb_flags);
int ctdb_ctrl_createdb(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, TALLOC_CTX *mem_ctx, const char *name, bool persistent);
int ctdb_ctrl_process_exists(struct ctdb_context *ctdb, uint32_t destnode, pid_t pid);

View File

@ -468,7 +468,7 @@ static int create_missing_remote_databases(struct ctdb_context *ctdb, struct ctd
}
ctdb_ctrl_createdb(ctdb, CONTROL_TIMEOUT(), nodemap->nodes[j].pnn,
mem_ctx, name,
dbmap->dbs[db].flags);
dbmap->dbs[db].flags & CTDB_DB_FLAGS_PERSISTENT);
if (ret != 0) {
DEBUG(DEBUG_ERR, (__location__ " Unable to create remote db:%s\n", name));
return -1;
@ -531,7 +531,7 @@ static int create_missing_local_databases(struct ctdb_context *ctdb, struct ctdb
return -1;
}
ctdb_ctrl_createdb(ctdb, CONTROL_TIMEOUT(), pnn, mem_ctx, name,
remote_dbmap->dbs[db].flags);
remote_dbmap->dbs[db].flags & CTDB_DB_FLAGS_PERSISTENT);
if (ret != 0) {
DEBUG(DEBUG_ERR, (__location__ " Unable to create local db:%s\n", name));
return -1;