Skip to content

Commit

Permalink
ctdb-recoverd: No need for database detach handler
Browse files Browse the repository at this point in the history
The only reason for recoverd attaching to databases was to migrate
records to the local node as part of vacuuming.  Recovery daemon does
not take part in database vacuuming any more.

The actual database recovery is handled via the recovery_helper and
recovery daemon should not need to attach to the databases any more.

Signed-off-by: Amitay Isaacs <[email protected]>
Reviewed-by: Martin Schwenke <[email protected]>
  • Loading branch information
amitay authored and Amitay Isaacs committed Oct 24, 2019
1 parent fc81729 commit c6427dd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
8 changes: 0 additions & 8 deletions ctdb/server/ctdb_ltdb_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1266,14 +1266,6 @@ int32_t ctdb_control_db_detach(struct ctdb_context *ctdb, TDB_DATA indata,
return -1;
}

/* Detach database from recoverd */
if (ctdb_daemon_send_message(ctdb, ctdb->pnn,
CTDB_SRVID_DETACH_DATABASE,
indata) != 0) {
DEBUG(DEBUG_ERR, ("Unable to detach DB from recoverd\n"));
return -1;
}

/* Disable vacuuming and drop all vacuuming data */
talloc_free(ctdb_db->vacuum_handle);
talloc_free(ctdb_db->delete_queue);
Expand Down
35 changes: 0 additions & 35 deletions ctdb/server/ctdb_recoverd.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,36 +574,6 @@ static int update_flags_on_all_nodes(struct ctdb_context *ctdb, struct ctdb_node
return 0;
}

/*
* handler for database detach
*/
static void detach_database_handler(uint64_t srvid, TDB_DATA data,
void *private_data)
{
struct ctdb_recoverd *rec = talloc_get_type(
private_data, struct ctdb_recoverd);
struct ctdb_context *ctdb = rec->ctdb;
uint32_t db_id;
struct ctdb_db_context *ctdb_db;

if (data.dsize != sizeof(db_id)) {
return;
}
db_id = *(uint32_t *)data.dptr;

ctdb_db = find_ctdb_db(ctdb, db_id);
if (ctdb_db == NULL) {
/* database is not attached */
return;
}

DLIST_REMOVE(ctdb->db_list, ctdb_db);

DEBUG(DEBUG_NOTICE, ("Detached from database '%s'\n",
ctdb_db->db_name));
talloc_free(ctdb_db);
}

/*
called when ctdb_wait_timeout should finish
*/
Expand Down Expand Up @@ -3143,11 +3113,6 @@ static void monitor_cluster(struct ctdb_context *ctdb)
CTDB_SRVID_DISABLE_RECOVERIES,
disable_recoveries_handler, rec);

/* register a message port for detaching database */
ctdb_client_set_message_handler(ctdb,
CTDB_SRVID_DETACH_DATABASE,
detach_database_handler, rec);

for (;;) {
TALLOC_CTX *mem_ctx = talloc_new(ctdb);
struct timeval start;
Expand Down

0 comments on commit c6427dd

Please sign in to comment.