------------------------------------------------------------
revno: 272
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell <[EMAIL PROTECTED]>
branch nick: tridge
timestamp: Thu 2007-05-10 13:15:58 +1000
message:
  merge from ronnie
modified:
  direct/ctdb_recoverd.c         recoverd.c-20070503213540-bvxuyd9jm1f7ig90-1
  include/ctdb_private.h         
ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
  tools/ctdb_control.c           
ctdb_control.c-20070426122705-9ehj1l5lu2gn9kuj-1
    ------------------------------------------------------------
    revno: 197.1.97
    merged: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Ronnie Sahlberg <[EMAIL PROTECTED]>
    branch nick: ctdb
    timestamp: Thu 2007-05-10 10:10:58 +1000
    message:
      create a correct vnnmap structure to prevent a segv
    ------------------------------------------------------------
    revno: 197.1.96
    merged: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Ronnie Sahlberg <[EMAIL PROTECTED]>
    branch nick: ctdb
    timestamp: Thu 2007-05-10 10:03:21 +1000
    message:
      update ctdb_control to create a correct ctdb_vnn_map->map array
    ------------------------------------------------------------
    revno: 197.1.95
    merged: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Ronnie Sahlberg <[EMAIL PROTECTED]>
    branch nick: ctdb
    timestamp: Thu 2007-05-10 09:48:14 +1000
    message:
      when starting a new election, also force all nodes into recovery mode so 
      there is no internode traffic to interfere with our election
    ------------------------------------------------------------
    revno: 197.1.94
    merged: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Ronnie Sahlberg <[EMAIL PROTECTED]>
    branch nick: ctdb
    timestamp: Thu 2007-05-10 09:46:10 +1000
    message:
      when starting recovery repoint dmaster to an invalid node and not the 
      current vnn
    ------------------------------------------------------------
    revno: 197.1.93
    merged: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Ronnie Sahlberg <[EMAIL PROTECTED]>
    branch nick: ctdb
    timestamp: Thu 2007-05-10 09:44:28 +1000
    message:
      merge from tridge
    ------------------------------------------------------------
    revno: 197.1.92
    merged: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Ronnie Sahlberg <[EMAIL PROTECTED]>
    branch nick: ctdb
    timestamp: Thu 2007-05-10 09:43:01 +1000
    message:
      actually check the remote nodes and not just the local node
    ------------------------------------------------------------
    revno: 197.1.91
    merged: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    parent: [EMAIL PROTECTED]
    committer: Ronnie Sahlberg <[EMAIL PROTECTED]>
    branch nick: ctdb
    timestamp: Thu 2007-05-10 06:55:28 +1000
    message:
      merge from tridge
=== modified file 'direct/ctdb_recoverd.c'
--- a/direct/ctdb_recoverd.c    2007-05-10 03:10:23 +0000
+++ b/direct/ctdb_recoverd.c    2007-05-10 03:15:58 +0000
@@ -381,7 +381,7 @@
        /* repoint all local and remote database records to an invalid
           node as being dmaster to stop the shortcut from working
         */
-       ret = update_dmaster_on_all_databases(ctdb, nodemap, vnn, dbmap, 
mem_ctx);
+       ret = update_dmaster_on_all_databases(ctdb, nodemap, 0xffffffff, dbmap, 
mem_ctx);
        if (ret != 0) {
                DEBUG(0, (__location__ "Unable to update dmaster on all 
databases\n"));
                return -1;
@@ -546,6 +546,13 @@
 static void force_election(struct ctdb_context *ctdb, TALLOC_CTX *mem_ctx, 
uint32_t vnn, struct ctdb_node_map *nodemap)
 {
        int ret;
+
+       /* set all nodes to recovery mode to stop all internode traffic */
+       ret = set_recovery_mode(ctdb, nodemap, CTDB_RECOVERY_ACTIVE);
+       if (ret!=0) {
+               DEBUG(0, (__location__ "Unable to set recovery mode to active 
on cluster\n"));
+               return;
+       }
        
        ret = send_election_request(ctdb, mem_ctx, vnn);
        if (ret!=0) {
@@ -657,7 +664,7 @@
                        continue;
                }
 
-               ret = ctdb_ctrl_getrecmaster(ctdb, timeval_current_ofs(1, 0), 
vnn, &recmaster);
+               ret = ctdb_ctrl_getrecmaster(ctdb, timeval_current_ofs(1, 0), 
nodemap->nodes[j].vnn, &recmaster);
                if (ret != 0) {
                        DEBUG(0, (__location__ "Unable to get recmaster from 
node %u\n", vnn));
                        goto again;
@@ -679,7 +686,7 @@
                        continue;
                }
 
-               ret = ctdb_ctrl_getrecmode(ctdb, timeval_current_ofs(1, 0), 
vnn, &recmode);
+               ret = ctdb_ctrl_getrecmode(ctdb, timeval_current_ofs(1, 0), 
nodemap->nodes[j].vnn, &recmode);
                if (ret != 0) {
                        DEBUG(0, ("Unable to get recmode from node %u\n", vnn));
                        goto again;

=== modified file 'include/ctdb_private.h'
--- a/include/ctdb_private.h    2007-05-09 22:13:19 +0000
+++ b/include/ctdb_private.h    2007-05-10 03:15:58 +0000
@@ -260,18 +260,22 @@
 
 
 #define CTDB_NO_MEMORY(ctdb, p) do { if (!(p)) { \
+          DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
           ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
          return -1; }} while (0)
 
 #define CTDB_NO_MEMORY_VOID(ctdb, p) do { if (!(p)) { \
+          DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
           ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
          }} while (0)
 
 #define CTDB_NO_MEMORY_NULL(ctdb, p) do { if (!(p)) { \
+          DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
           ctdb_set_error(ctdb, "Out of memory at %s:%d", __FILE__, __LINE__); \
          return NULL; }} while (0)
 
 #define CTDB_NO_MEMORY_FATAL(ctdb, p) do { if (!(p)) { \
+          DEBUG(0,("Out of memory for %s at %s\n", #p, __location__)); \
           ctdb_fatal(ctdb, "Out of memory in " __location__ ); \
          }} while (0)
 

=== modified file 'tools/ctdb_control.c'
--- a/tools/ctdb_control.c      2007-05-09 22:49:57 +0000
+++ b/tools/ctdb_control.c      2007-05-10 03:15:58 +0000
@@ -604,13 +604,14 @@
        generation = strtoul(argv[1], NULL, 0);
        num_nodes  = strtoul(argv[2], NULL, 0);
 
-       vnnmap = talloc_zero_size(ctdb, offsetof(struct ctdb_vnn_map, map) + 
4*num_nodes);
-       if (vnnmap == NULL) {
-               DEBUG(0,(__location__ " Unable to allocate vnn_map 
structure\n"));
-               exit(1);
-       }
+       vnnmap = talloc(ctdb, struct ctdb_vnn_map);
+       CTDB_NO_MEMORY(ctdb, vnnmap);
+
        vnnmap->generation = generation;
        vnnmap->size       = num_nodes;
+       vnnmap->map        = talloc_array(vnnmap, uint32_t, vnnmap->size);
+       CTDB_NO_MEMORY(ctdb, vnnmap->map);
+
        for (i=0;i<vnnmap->size;i++) {
                vnnmap->map[i] = strtoul(argv[3+i], NULL, 0);
        }

Reply via email to