diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index ebd448ccbfd..e801c0138ee 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -1781,21 +1781,19 @@ 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) +int ctdb_ctrl_createdb(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, + 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, + ret = ctdb_control(ctdb, destnode, 0, + persistent?CTDB_CONTROL_DB_ATTACH_PERSISTENT:CTDB_CONTROL_DB_ATTACH, + 0, data, mem_ctx, &data, &res, &timeout, NULL); if (ret != 0 || res != 0) { diff --git a/ctdb/include/ctdb_client.h b/ctdb/include/ctdb_client.h index b2ae3bf8caa..87399237013 100644 --- a/ctdb/include/ctdb_client.h +++ b/ctdb/include/ctdb_client.h @@ -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); diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index cb07339ca3f..a1513ee278d 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -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;