ctdb-daemon: Remove implementation of SET/GET_DB_PRIORITY
authorAmitay Isaacs <amitay@gmail.com>
Tue, 19 Jul 2016 07:34:03 +0000 (17:34 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 25 Jul 2016 19:29:42 +0000 (21:29 +0200)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/include/ctdb_private.h
ctdb/server/ctdb_control.c
ctdb/server/ctdb_ltdb_server.c

index f2f5acf3342d4ca65822363476cfd49b093fca41..b2e52029defde5b1501ba1aa9aa825d3b085ab38 100644 (file)
@@ -806,9 +806,6 @@ int32_t ctdb_ltdb_update_seqnum(struct ctdb_context *ctdb, uint32_t db_id,
                                uint32_t srcnode);
 int32_t ctdb_ltdb_enable_seqnum(struct ctdb_context *ctdb, uint32_t db_id);
 
-int32_t ctdb_control_set_db_priority(struct ctdb_context *ctdb, TDB_DATA indata,
-                                    uint32_t client_id);
-
 int ctdb_set_db_sticky(struct ctdb_context *ctdb,
                       struct ctdb_db_context *ctdb_db);
 
index 5d924258ad898a765de1cd514946a905b13aaf39..5b3e7c2190b7fa456b879c037aa7844bdc9894bb 100644 (file)
@@ -569,19 +569,10 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
                return ctdb_control_get_ban_state(ctdb, outdata);
 
        case CTDB_CONTROL_SET_DB_PRIORITY:
-               CHECK_CONTROL_DATA_SIZE(sizeof(struct ctdb_db_priority));
-               return ctdb_control_set_db_priority(ctdb, indata, client_id);
+               return control_not_implemented("SET_DB_PRIORITY", "");
 
-       case CTDB_CONTROL_GET_DB_PRIORITY: {
-               uint32_t db_id;
-               struct ctdb_db_context *ctdb_db;
-
-               CHECK_CONTROL_DATA_SIZE(sizeof(db_id));
-               db_id = *(uint32_t *)indata.dptr;
-               ctdb_db = find_ctdb_db(ctdb, db_id);
-               if (ctdb_db == NULL) return -1;
-               return ctdb_db->priority;
-       }
+       case CTDB_CONTROL_GET_DB_PRIORITY:
+               return control_not_implemented("GET_DB_PRIORITY", "");
 
        case CTDB_CONTROL_TRANSACTION_CANCEL:
                CHECK_CONTROL_DATA_SIZE(0);
index 8724791349e4d4459671df0a9876c0d0fbb5ac32..88d0bcee23f7b1e2b579d85c3250de99ec9ff729 100644 (file)
@@ -1572,40 +1572,6 @@ int32_t ctdb_ltdb_enable_seqnum(struct ctdb_context *ctdb, uint32_t db_id)
        return 0;
 }
 
-int32_t ctdb_control_set_db_priority(struct ctdb_context *ctdb, TDB_DATA indata,
-                                    uint32_t client_id)
-{
-       struct ctdb_db_priority *db_prio = (struct ctdb_db_priority *)indata.dptr;
-       struct ctdb_db_context *ctdb_db;
-
-       ctdb_db = find_ctdb_db(ctdb, db_prio->db_id);
-       if (!ctdb_db) {
-               if (!(ctdb->nodes[ctdb->pnn]->flags & NODE_FLAGS_INACTIVE)) {
-                       DEBUG(DEBUG_ERR,("Unknown db_id 0x%x in ctdb_set_db_priority\n",
-                                        db_prio->db_id));
-               }
-               return 0;
-       }
-
-       if ((db_prio->priority<1) || (db_prio->priority>NUM_DB_PRIORITIES)) {
-               DEBUG(DEBUG_ERR,("Trying to set invalid priority : %u\n", db_prio->priority));
-               return 0;
-       }
-
-       ctdb_db->priority = db_prio->priority;
-       DEBUG(DEBUG_INFO,("Setting DB priority to %u for db 0x%08x\n", db_prio->priority, db_prio->db_id));
-
-       if (client_id != 0) {
-               /* Broadcast the update to the rest of the cluster */
-               ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_ALL, 0,
-                                        CTDB_CONTROL_SET_DB_PRIORITY, 0,
-                                        CTDB_CTRL_FLAG_NOREPLY, indata,
-                                        NULL, NULL);
-       }
-       return 0;
-}
-
-
 int ctdb_set_db_sticky(struct ctdb_context *ctdb, struct ctdb_db_context *ctdb_db)
 {
        if (ctdb_db->sticky) {