]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdbd does no longer take a --daemon parameter since we no longer do non-daemon mode
authorRonnie sahlberg <ronniesahlberg@gmail.com>
Thu, 19 Apr 2007 00:24:11 +0000 (10:24 +1000)
committerRonnie sahlberg <ronniesahlberg@gmail.com>
Thu, 19 Apr 2007 00:24:11 +0000 (10:24 +1000)
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)

ctdb/direct/ctdbd.sh
ctdb/direct/ctdbd_test.c

index 366226260ba0e024e729ab43a006b27944c42d8c..7224bdec6d66fdd0f474bc1bb47bfb33c983ac93 100755 (executable)
@@ -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 &
 
index d5691ff2be94cedc90e69a230bd267f6a7171d71..95b5a80d3c40456116a5494c0d513b9e05339190 100644 (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);