]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
- merge from ronnie
authorAndrew Tridgell <tridge@samba.org>
Fri, 11 May 2007 00:33:43 +0000 (10:33 +1000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 11 May 2007 00:33:43 +0000 (10:33 +1000)
- increment rsn only in become_dmaster
- add torture check for rsn regression in ctdb_ltdb_store

(This used to be ctdb commit 8047506a08bb53ee01aa64f25c9f72839e1e2d68)

1  2 
ctdb/common/ctdb_call.c
ctdb/common/ctdb_ltdb.c

index 8dd03449a8ff2f670704c9c806951245c0ed6162,76bc570c536efa765f75c35c8bf7b045e6143b2e..a8e470126de4d9aa16701630fc0ee453fbb82550
@@@ -295,7 -295,7 +295,7 @@@ static void ctdb_become_dmaster(struct 
        DEBUG(2,("vnn %u dmaster response %08x\n", ctdb->vnn, ctdb_hash(&key)));
  
        ZERO_STRUCT(header);
--      header.rsn = rsn;
++      header.rsn = rsn + 1;
        header.dmaster = ctdb->vnn;
  
        if (ctdb_ltdb_store(ctdb_db, key, &header, data) != 0) {
index 35099f2e2994d46862578d8e1fd89cb0ee113ff7,35099f2e2994d46862578d8e1fd89cb0ee113ff7..77ce0e80cb1438f68cdc8f26f246a88e5e36c9c4
@@@ -145,6 -145,6 +145,17 @@@ int ctdb_ltdb_store(struct ctdb_db_cont
        TDB_DATA rec;
        int ret;
  
++      if (ctdb->flags & CTDB_FLAG_TORTURE) {
++              struct ctdb_ltdb_header *h2;
++              rec = tdb_fetch(ctdb_db->ltdb->tdb, key);
++              h2 = (struct ctdb_ltdb_header *)rec.dptr;
++              if (rec.dptr && rec.dsize >= sizeof(h2) && h2->rsn > header->rsn) {
++                      DEBUG(0,("RSN regression! %llu %llu\n",
++                               (unsigned long long)h2->rsn, (unsigned long long)header->rsn));
++              }
++              if (rec.dptr) free(rec.dptr);
++      }
++
        rec.dsize = sizeof(*header) + data.dsize;
        rec.dptr = talloc_size(ctdb, rec.dsize);
        CTDB_NO_MEMORY(ctdb, rec.dptr);