~jheiss/galera/galera

« back to all changes in this revision

Viewing changes to gcs/src/gcs_group.c

  • Committer: Alex Yurchenko
  • Date: 2011-08-20 23:37:05 UTC
  • Revision ID: ayurchen@void-20110820233705-532t7g9ip8ss24sv
References lp:828648 - synced with SVN branch 0.8 r2321

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Copyright (C) 2008 Codership Oy <info@codership.com>
3
3
 *
4
 
 * $Id: gcs_group.c 2238 2011-07-10 13:36:59Z alex $
 
4
 * $Id: gcs_group.c 2302 2011-08-12 17:13:13Z alex $
5
5
 */
6
6
 
7
7
#include <errno.h>
282
282
        }
283
283
 
284
284
        group->prim_seqno = group->conf_id;
285
 
    if (quorum->repl_proto_ver > 0) { /* compatibility with 0.8.0, see #486 */
286
285
        group->prim_num   = 0;
 
286
 
287
287
        for (i = 0; i < group->num; i++) {
288
288
            group->prim_num += gcs_node_is_joined (group->nodes[i].status);
289
289
        }
 
290
 
290
291
        assert (group->prim_num > 0);
291
292
    }
292
 
    else { /* compatibility with 0.8.0, #486 */
293
 
        group->prim_num   = group->num; // REMOVE in next release
294
 
    }
295
 
    }
296
293
    else {
297
294
        // non-primary configuration
298
295
        group_go_non_primary (group);
639
636
            gu_warn ("%ld (%s): State transfer %s %ld (%s) failed: %d (%s)",
640
637
                     sender_idx, sender->name, st_dir, peer_idx, peer_name,
641
638
                     (int)seqno, strerror((int)-seqno));
 
639
// REMOVE
 
640
         gu_info("from_donor: %d, peer_idx: %ld, my_idx: %ld, peer state: %d",
 
641
                 from_donor, peer_idx, group->my_idx, group->nodes[peer_idx].status);
642
642
 
643
643
            if (from_donor && peer_idx == group->my_idx &&
644
644
                GCS_NODE_STATE_JOINER == group->nodes[peer_idx].status) {
736
736
 
737
737
    for (idx = 0; idx < group->num; idx++) {
738
738
        gcs_node_t* node = &group->nodes[idx];
739
 
        if (status == node->status) return idx;
 
739
        if (status == node->status &&
 
740
            strcmp (node->name, GCS_ARBITRATOR_NAME)) // avoid arbitrator
 
741
            return idx;
740
742
    }
741
743
 
742
744
    return -EAGAIN;