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);
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);
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) {