Dont return error if trying to set db priority on a db that does not yet exist.
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 24 Feb 2011 23:06:08 +0000 (10:06 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 24 Feb 2011 23:06:08 +0000 (10:06 +1100)
Just treat as a nop.

When the database is created later it will get its priority set properly.

server/ctdb_ltdb_server.c

index 3e90b2d04687d66d68cd4e87d340cbd7d69362fa..07fdec0d4459b3434ff6da4e8c313138550f4ba0 100644 (file)
@@ -1195,12 +1195,12 @@ int32_t ctdb_control_set_db_priority(struct ctdb_context *ctdb, TDB_DATA indata)
        ctdb_db = find_ctdb_db(ctdb, db_prio->db_id);
        if (!ctdb_db) {
                DEBUG(DEBUG_ERR,("Unknown db_id 0x%x in ctdb_set_db_priority\n", db_prio->db_id));
-               return -1;
+               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 -1;
+               return 0;
        }
 
        ctdb_db->priority = db_prio->priority;