The branch, master has been updated
       via  4892222ffb255dccd8ced1cb047f199386bb3e98 (commit)
       via  8ab1349feb64a91cb500c130ea299e2182491f06 (commit)
       via  a6fbc65aca35c41c428a82d7402e43c6eaac1d6e (commit)
       via  363e7e939ad46b3f75c83c30d4163d63876c2456 (commit)
      from  0c9b0466fd87b3f1e5d53f867c863217802ac43b (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 4892222ffb255dccd8ced1cb047f199386bb3e98
Author: Ronnie Sahlberg <[email protected]>
Date:   Thu Oct 29 13:49:27 2009 +1100

    new version 1.0.102

commit 8ab1349feb64a91cb500c130ea299e2182491f06
Author: Wolfgang Mueller-Friedt <[email protected]>
Date:   Wed Oct 28 14:54:29 2009 +0300

    ensure tdb names end with .tdb. and any number of digits

commit a6fbc65aca35c41c428a82d7402e43c6eaac1d6e
Author: Wolfgang Mueller-Friedt <[email protected]>
Date:   Wed Oct 28 13:01:27 2009 +0300

    vacuuming needed additional check before getting rid of the record; there 
is a gap between selecting the records and deleting them, therefore we have to 
check if the records still can be deleted when we actually are about to delete 
them

commit 363e7e939ad46b3f75c83c30d4163d63876c2456
Author: Ronnie Sahlberg <[email protected]>
Date:   Thu Oct 29 13:44:12 2009 +1100

    Revert "From Wolfgang M."
    
    This reverts commit 5b70fa8cfd5916d3c212823ad5cc1b251ae175ed.

-----------------------------------------------------------------------

Summary of changes:
 packaging/RPM/ctdb.spec   |   10 +++++++++-
 server/ctdb_call.c        |   11 ++++-------
 server/ctdb_ltdb_server.c |   21 +++++++++++++--------
 server/ctdb_vacuum.c      |   14 ++++++++++++--
 4 files changed, 38 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/packaging/RPM/ctdb.spec b/packaging/RPM/ctdb.spec
index 009f15d..85c916f 100644
--- a/packaging/RPM/ctdb.spec
+++ b/packaging/RPM/ctdb.spec
@@ -4,7 +4,7 @@ Summary: Clustered TDB
 Vendor: Samba Team
 Packager: Samba Team <[email protected]>
 Name: ctdb
-Version: 1.0.101
+Version: 1.0.102
 Release: 1
 Epoch: 0
 License: GNU GPL version 3
@@ -127,6 +127,14 @@ exit 0
 %{_libdir}/pkgconfig/ctdb.pc
 
 %changelog
+* Thu Oct 29 2009 : Version 1.0.102
+ - Wolfgang: fix for the vacuuming code
+ - Wolfgang: stronger tests for persistent database filename tests
+ - Improve the log message when we refuse to startup since wbinfo -t fails
+   to make it easier to spot in the log.
+ - Update the uptime command output and the man page to indicate that
+   "time since last ..." if from either the last recovery OR the last failover
+ - Michael A: transaction updates
 * Wed Oct 28 2009 : Version 1.0.101
  - create a separate context for non-monitoring events so they dont interfere 
with the monitor event
  - make sure to return status 0 in teh callback when we abort an event
diff --git a/server/ctdb_call.c b/server/ctdb_call.c
index 1dac919..cd52867 100644
--- a/server/ctdb_call.c
+++ b/server/ctdb_call.c
@@ -342,13 +342,10 @@ void ctdb_request_dmaster(struct ctdb_context *ctdb, 
struct ctdb_req_header *hdr
                         ctdb_db->db_id, hdr->generation, 
ctdb->vnn_map->generation,
                         (unsigned long long)c->rsn, (unsigned long 
long)header.rsn, c->hdr.reqid,
                         (key.dsize >= 4)?(*(uint32_t *)key.dptr):0));
-               /*
-                * with the new vacuuming code there are conditions where a 
node has outdated
-                * information about the real dmaster
-                * since here we are lmaster and always know who is the real 
dmaster
-                * we don't need to exit with a fatal error and we even don't 
have
-                * to initiate a recovery
-                */
+               if (header.rsn != 0 || header.dmaster != ctdb->pnn) {
+                       ctdb_fatal(ctdb, "ctdb_req_dmaster from non-master");
+                       return;
+               }
        }
 
        if (header.rsn > c->rsn) {
diff --git a/server/ctdb_ltdb_server.c b/server/ctdb_ltdb_server.c
index 54b4f5e..09e40c7 100644
--- a/server/ctdb_ltdb_server.c
+++ b/server/ctdb_ltdb_server.c
@@ -26,6 +26,7 @@
 #include "../include/ctdb_private.h"
 #include "db_wrap.h"
 #include "lib/util/dlinklist.h"
+#include <ctype.h>
 
 /*
   this is the dummy null procedure that all databases support
@@ -389,26 +390,30 @@ int ctdb_attach_persistent(struct ctdb_context *ctdb)
        }
 
        while ((de=readdir(d))) {
-               char *p, *s;
+               char *p, *s, *q;
                size_t len = strlen(de->d_name);
                uint32_t node;
+               int invalid_name = 0;
                
                s = talloc_strdup(ctdb, de->d_name);
                CTDB_NO_MEMORY(ctdb, s);
 
-               /* ignore names ending in .bak */
-               p = strstr(s, ".bak");
-               if (p != NULL) {
-                       continue;
-               }
-
                /* only accept names ending in .tdb */
                p = strstr(s, ".tdb.");
                if (len < 7 || p == NULL) {
                        talloc_free(s);
                        continue;
                }
-               if (sscanf(p+5, "%u", &node) != 1 || node != ctdb->pnn) {
+
+               /* only accept names ending with .tdb. and any number of digits 
*/
+               q = p+5;
+               while (*q != 0 && invalid_name == 0) {
+                       if (!isdigit(*q++)) {
+                               invalid_name = 1;
+                       }
+               }
+               if (invalid_name == 1 || sscanf(p+5, "%u", &node) != 1 || node 
!= ctdb->pnn) {
+                       DEBUG(DEBUG_ERR,("Ignoring persistent database '%s'\n", 
de->d_name));
                        talloc_free(s);
                        continue;
                }
diff --git a/server/ctdb_vacuum.c b/server/ctdb_vacuum.c
index 0b5bc1c..80e5dbd 100644
--- a/server/ctdb_vacuum.c
+++ b/server/ctdb_vacuum.c
@@ -401,8 +401,18 @@ static int repack_traverse(struct tdb_context *tdb, 
TDB_DATA key, TDB_DATA data,
                 * there might be hash collisions so we have to compare the 
keys here to be sure
                 */
                if (kd && kd->key.dsize == key.dsize && memcmp(kd->key.dptr, 
key.dptr, key.dsize) == 0) {
-                       vdata->vacuumed++;
-                       return 0;
+                       struct ctdb_ltdb_header *hdr = (struct ctdb_ltdb_header 
*)data.dptr;
+                       /*
+                        * we have to check if the record hasn't changed in the 
meantime in order to
+                        * savely remove it from the database
+                        */
+                       if (data.dsize == sizeof(struct ctdb_ltdb_header) &&
+                               hdr->dmaster == kd->ctdb->pnn &&
+                               ctdb_lmaster(kd->ctdb, &(kd->key)) == 
kd->ctdb->pnn &&
+                               kd->hdr.rsn == hdr->rsn) {
+                               vdata->vacuumed++;
+                               return 0;
+                       }
                }
        }
        if (tdb_store(vdata->dest_db, key, data, TDB_INSERT) != 0) {


-- 
CTDB repository

Reply via email to