1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-19 18:50:24 +03:00

ctdbd does no longer take a --daemon parameter since we no longer do non-daemon mode

remove the parameter from the ctdbd script

remove the store_unlock from ctdbd_test since there is no and will be no pdu for this
CTDB_REPLY_FETCH_LOCK no longer return the data for the record since the client is assumed to read this itself from the local tdb. remove some variables that no longer exists.

(This used to be ctdb commit 77c43479e1932b27387fc2f85a3cb6538633b481)
This commit is contained in:
Ronnie sahlberg 2007-04-19 10:24:11 +10:00
parent 1812d787ac
commit 697126e61f
2 changed files with 8 additions and 25 deletions

View File

@ -3,6 +3,6 @@
killall -q ctdbd
echo "Starting 2 ctdb daemons"
bin/ctdbd --nlist direct/nodes.txt --listen 127.0.0.2:9001 --daemon &
bin/ctdbd --nlist direct/nodes.txt --listen 127.0.0.1:9001 --daemon &
bin/ctdbd --nlist direct/nodes.txt --listen 127.0.0.2:9001 &
bin/ctdbd --nlist direct/nodes.txt --listen 127.0.0.1:9001 &

View File

@ -184,6 +184,10 @@ uint32_t ctdb_hash(const TDB_DATA *key)
return (1103515243 * value + 12345);
}
/* ask the daemon to migrate a record over so that the local node is the dmaster the client must not have the record locked when performing this call.
see ctdb_client.c/ctdb_fetch_lock() for the full procedure
*/
void fetch_lock(int fd, uint32_t db_id, TDB_DATA key)
{
struct ctdb_req_fetch_lock *req;
@ -227,19 +231,7 @@ void fetch_lock(int fd, uint32_t db_id, TDB_DATA key)
cnt+=numread;
}
}
printf("fetch lock reply: state:%d datalen:%d\n",rep->state,rep->datalen);
if(!rep->datalen){
printf("no data\n");
} else {
printf("data:[%s]\n",rep->data);
}
}
void store_unlock(int fd, uint32_t db_id, TDB_DATA key, TDB_DATA data)
{
/*XXX write the tdb record and drop the chainlock*/
printf("store_unlock example not implemented\n");
printf("fetch lock reply: state:%d\n",rep->state);
}
int main(int argc, const char *argv[])
@ -249,8 +241,7 @@ int main(int argc, const char *argv[])
struct ctdb_req_message *reply;
TDB_DATA dbname;
uint32_t db_id;
TDB_DATA key, data;
char str[256];
TDB_DATA key;
/* open the socket to talk to the local ctdb daemon */
fd=ux_socket_connect(CTDB_SOCKET);
@ -304,14 +295,6 @@ int main(int argc, const char *argv[])
printf("\n");
/* send a store unlock */
sprintf(str,"TestData_%d",getpid());
data.dptr=discard_const(str);
data.dsize=strlen((const char *)(data.dptr));
printf("store new data==[%s] for this record\n",data.dptr);
store_unlock(fd, db_id, key, data);
printf("\n");
/* send a fetch lock */
printf("fetch the test key:[%s]\n",key.dptr);
fetch_lock(fd, db_id, key);