return 0;
}
+/*
+ this is a plain fetch procedure that all databases support
+*/
+static int ctdb_fetch_func(struct ctdb_call_info *call)
+{
+ call->reply_data = &call->record_data;
+ return 0;
+}
+
/*
return the lmaster given a key
talloc_free(ctdb_db);
return -1;
}
+
+ /*
+ all databases support the "fetch" function. we need this
+ for efficient Samba3 ctdb fetch
+ */
+ ret = ctdb_daemon_set_call(ctdb, ctdb_db->db_id, ctdb_fetch_func, CTDB_FETCH_FUNC);
+ if (ret != 0) {
+ DEBUG(0,("Failed to setup fetch function for '%s'\n", ctdb_db->db_name));
+ talloc_free(ctdb_db);
+ return -1;
+ }
/* tell all the other nodes about this database */
ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_VNN, 0,
Fetch a ctdb record from a remote node
. Underneath this will force the
dmaster for the record to be moved to the local node.
-
*/
struct ctdb_record_handle *ctdb_fetch_lock(struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx,
TDB_DATA key, TDB_DATA *data);
-
-/*
- do a fetch lock from a client to the local daemon
-*/
-#define FETCH_LOCK_SUCCESS 0
-#define FETCH_LOCK_LOCKFAILED 1
-#define FETCH_LOCK_FETCHFAILED 2
-#define FETCH_LOCK_DMASTERFAILED 3
-
-int ctdb_client_fetch_lock(struct ctdb_db_context *ctdb_db,
- TALLOC_CTX *mem_ctx,
- TDB_DATA key, TDB_DATA *data);
-
-
int ctdb_record_store(struct ctdb_record_handle *h, TDB_DATA data);
int ctdb_register_message_handler(struct ctdb_context *ctdb,
#define CTDB_DS_ALIGNMENT 8
-#define CTDB_NULL_FUNC 0xF0000001
+#define CTDB_NULL_FUNC 0xFF000001
+#define CTDB_FETCH_FUNC 0xFF000002
#define CTDB_CURRENT_NODE 0xF0000001
#define CTDB_BROADCAST_VNN 0xF0000002
" cleardb <vnn> <dbid> deletes all records in a db\n"
" getrecmode <vnn> get recovery mode\n"
" setrecmode <vnn> <mode> set recovery mode\n"
- " recover <vnn> recover the cluster\n");
+ " recover <vnn> recover the cluster\n"
+ " attach <dbname> attach a database\n");
exit(1);
}