Revert "Revert "Revert "- accept an optional set of tdb_flags from clients on open...
authorRonnie Sahlberg <sahlberg@samba.org>
Thu, 10 Apr 2008 05:59:51 +0000 (15:59 +1000)
committerRonnie Sahlberg <sahlberg@samba.org>
Thu, 10 Apr 2008 05:59:51 +0000 (15:59 +1000)
remove the transaction stuff and push   so that the git tree will work

This reverts commit 539bbdd9b0d0346b42e66ef2fcfb16f39bbe098b.

common/ctdb_ltdb.c
include/ctdb_private.h
server/ctdb_control.c
server/ctdb_ltdb_server.c

index d9e4f2ab74ebd5499f0fdffc9faa9dda8c88e75e..e8a334afecafad5a591fe91b5d5962041ad94235 100644 (file)
@@ -150,25 +150,7 @@ int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, TDB_DATA key,
        memcpy(rec.dptr, header, sizeof(*header));
        memcpy(rec.dptr + sizeof(*header), data.dptr, data.dsize);
 
-       /* if this is a persistent database without NOSYNC then we
-          will do this via a transaction */
-       if (ctdb_db->persistent && !(ctdb_db->client_tdb_flags & TDB_NOSYNC)) {
-               ret = tdb_transaction_start(ctdb_db->ltdb->tdb);
-               if (ret != 0) {
-                       DEBUG(DEBUG_CRIT, ("Failed to start local transaction\n"));
-                       goto failed;
-               }
-               ret = tdb_store(ctdb_db->ltdb->tdb, key, rec, TDB_REPLACE);
-               if (ret != 0) {
-                       tdb_transaction_cancel(ctdb_db->ltdb->tdb);
-                       goto failed;
-               }
-               ret = tdb_transaction_commit(ctdb_db->ltdb->tdb);
-       } else {
-               ret = tdb_store(ctdb_db->ltdb->tdb, key, rec, TDB_REPLACE);
-       }
-
-failed:
+       ret = tdb_store(ctdb_db->ltdb->tdb, key, rec, TDB_REPLACE);
        talloc_free(rec.dptr);
 
        return ret;
index d51e2f7f48f1fc0b84521ae9fd212603a1f312df..2435b0f4a95fdb8d64f8ecac2e5fff298ee26f60 100644 (file)
@@ -400,7 +400,6 @@ struct ctdb_db_context {
        struct ctdb_registered_call *calls; /* list of registered calls */
        uint32_t seqnum;
        struct timed_event *te;
-       uint32_t client_tdb_flags;
 };
 
 
@@ -911,7 +910,7 @@ int ctdb_daemon_send_control(struct ctdb_context *ctdb, uint32_t destnode,
                             void *private_data);
 
 int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata, 
-                              TDB_DATA *outdata, uint64_t tdb_flags, bool persistent);
+                              TDB_DATA *outdata, bool persistent);
 
 int ctdb_daemon_set_call(struct ctdb_context *ctdb, uint32_t db_id,
                         ctdb_fn_t fn, int id);
index 4de27305da21a713faf98e4482de29f95b00008c..9097854e36cd602b3b6c21a1dbfc0f52ee147d9e 100644 (file)
@@ -206,10 +206,10 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
        }
 
        case CTDB_CONTROL_DB_ATTACH:
-               return ctdb_control_db_attach(ctdb, indata, outdata, srvid, false);
+               return ctdb_control_db_attach(ctdb, indata, outdata, false);
 
        case CTDB_CONTROL_DB_ATTACH_PERSISTENT:
-               return ctdb_control_db_attach(ctdb, indata, outdata, srvid, true);
+               return ctdb_control_db_attach(ctdb, indata, outdata, true);
 
        case CTDB_CONTROL_SET_CALL: {
                struct ctdb_control_set_call *sc = 
index 5146ed86dae60bef1b20ebd56e63e01e917752da..e900f7b9ca8c80b839e4498263864e62569b191f 100644 (file)
@@ -296,19 +296,12 @@ static int ctdb_local_attach(struct ctdb_context *ctdb, const char *db_name, boo
   a client has asked to attach a new database
  */
 int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
-                              TDB_DATA *outdata, uint64_t tdb_flags, 
-                              bool persistent)
+                              TDB_DATA *outdata, bool persistent)
 {
        const char *db_name = (const char *)indata.dptr;
        struct ctdb_db_context *db;
        struct ctdb_node *node = ctdb->nodes[ctdb->pnn];
 
-       /* the client can optionally pass additional tdb flags, but we
-          only allow a subset of those on the database in ctdb. Note
-          that tdb_flags is passed in via the (otherwise unused)
-          srvid to the attach control */
-       tdb_flags &= TDB_NOSYNC;
-
        /* If the node is inactive it is not part of the cluster
           and we should not allow clients to attach to any
           databases
@@ -324,7 +317,6 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
        if (db) {
                outdata->dptr  = (uint8_t *)&db->db_id;
                outdata->dsize = sizeof(db->db_id);
-               db->client_tdb_flags |= tdb_flags;
                return 0;
        }
 
@@ -338,9 +330,6 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
                return -1;
        }
 
-       /* remember the flags the client has specified */
-       db->client_tdb_flags = tdb_flags;
-
        outdata->dptr  = (uint8_t *)&db->db_id;
        outdata->dsize = sizeof(db->db_id);