Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ClusterLabs/pacemaker
Browse files Browse the repository at this point in the history
  • Loading branch information
beekhof committed Nov 7, 2014
2 parents 3e076a8 + cd7c9ab commit bf22410
Show file tree
Hide file tree
Showing 8 changed files with 666 additions and 781 deletions.
1 change: 1 addition & 0 deletions lib/pengine/utils.c
Expand Up @@ -74,6 +74,7 @@ node_copy(node_t * this_node)

crm_trace("Copying %p (%s) to %p", this_node, this_node->details->uname, new_node);

new_node->rsc_discover_mode = this_node->rsc_discover_mode;
new_node->weight = this_node->weight;
new_node->fixed = this_node->fixed;
new_node->details = this_node->details;
Expand Down
23 changes: 23 additions & 0 deletions pengine/allocate.c
Expand Up @@ -948,6 +948,28 @@ probe_resources(pe_working_set_t * data_set)
return TRUE;
}

static void
rsc_discover_filter(resource_t *rsc, node_t *node)
{
GListPtr gIter = rsc->children;
resource_t *top = uber_parent(rsc);
node_t *match;

if (rsc->exclusive_discover == FALSE && top->exclusive_discover == FALSE) {
return;
}

for (; gIter != NULL; gIter = gIter->next) {
resource_t *child_rsc = (resource_t *) gIter->data;
rsc_discover_filter(child_rsc, node);
}

match = g_hash_table_lookup(rsc->allowed_nodes, node->details->id);
if (match && match->rsc_discover_mode != discover_exclusive) {
match->weight = -INFINITY;
}
}

/*
* Count how many valid nodes we have (so we know the maximum number of
* colors we can resolve).
Expand Down Expand Up @@ -986,6 +1008,7 @@ stage2(pe_working_set_t * data_set)
resource_t *rsc = (resource_t *) gIter2->data;

common_apply_stickiness(rsc, node, data_set);
rsc_discover_filter(rsc, node);
}
}

Expand Down
3 changes: 3 additions & 0 deletions pengine/native.c
Expand Up @@ -2103,6 +2103,9 @@ native_rsc_location(resource_t * rsc, rsc_to_node_t * constraint)
}

if (other_node->rsc_discover_mode < constraint->discover_mode) {
if (constraint->discover_mode == discover_exclusive) {
rsc->exclusive_discover = TRUE;
}
/* exclusive > never > always... always is default */
other_node->rsc_discover_mode = constraint->discover_mode;
}
Expand Down
184 changes: 85 additions & 99 deletions pengine/test10/resource-discovery.dot

Large diffs are not rendered by default.

766 changes: 352 additions & 414 deletions pengine/test10/resource-discovery.exp

Large diffs are not rendered by default.

186 changes: 79 additions & 107 deletions pengine/test10/resource-discovery.scores

Large diffs are not rendered by default.

134 changes: 69 additions & 65 deletions pengine/test10/resource-discovery.summary
@@ -1,124 +1,128 @@

Current cluster status:
Online: [ 18builder 18node1 18node2 18node3 18node4 ]
Online: [ 18node1 18node2 18node3 18node4 ]
RemoteOFFLINE: [ remote1 ]

shooter (stonith:fence_xvm): Started 18node1
shooter (stonith:fence_xvm): Stopped
remote1 (ocf::pacemaker:remote): Stopped
FAKE1 (ocf::heartbeat:Dummy): Stopped
FAKE2 (ocf::heartbeat:Dummy): Started 18node2
FAKE3 (ocf::heartbeat:Dummy): Started 18builder
FAKE4 (ocf::heartbeat:Dummy): Started 18node1
FAKE2 (ocf::heartbeat:Dummy): Stopped
FAKE3 (ocf::heartbeat:Dummy): Stopped
FAKE4 (ocf::heartbeat:Dummy): Stopped
FAKE5 (ocf::heartbeat:Dummy): Stopped
Clone Set: FAKECLONE1-clone [FAKECLONE1]
Stopped: [ 18builder 18node1 18node2 18node3 18node4 remote1 ]
Stopped: [ 18node1 18node2 18node3 18node4 remote1 ]
Clone Set: FAKECLONE2-clone [FAKECLONE2]
Stopped: [ 18builder 18node1 18node2 18node3 18node4 remote1 ]
Stopped: [ 18node1 18node2 18node3 18node4 remote1 ]
Resource Group: FAKEGROUP
FAKE6 (ocf::heartbeat:Dummy): Stopped
FAKE7 (ocf::heartbeat:Dummy): Stopped

Transition Summary:
* Start remote1 (18builder)
* Start FAKE1 (18node2)
* Move FAKE2 (Started 18node2 -> 18node3)
* Move FAKE3 (Started 18builder -> 18node3)
* Move FAKE4 (Started 18node1 -> 18node4)
* Start shooter (18node2)
* Start remote1 (18node1)
* Start FAKE1 (18node4)
* Start FAKE2 (18node2)
* Start FAKE3 (18node3)
* Start FAKE4 (18node4)
* Start FAKE5 (remote1)
* Start FAKECLONE1:0 (18builder)
* Start FAKECLONE1:1 (18node1)
* Start FAKECLONE1:2 (18node2)
* Start FAKECLONE1:3 (18node4)
* Start FAKECLONE1:4 (remote1)
* Start FAKECLONE1:5 (18node3)
* Start FAKECLONE2:0 (18builder)
* Start FAKECLONE1:0 (18node1)
* Start FAKECLONE1:1 (remote1)
* Start FAKECLONE2:0 (18node3)
* Start FAKECLONE2:1 (18node1)
* Start FAKECLONE2:2 (18node2)
* Start FAKECLONE2:3 (18node4)
* Start FAKECLONE2:4 (remote1)
* Start FAKECLONE2:5 (18node3)
* Start FAKE6 (18node1)
* Start FAKE7 (18node1)

Executing cluster transition:
* Resource action: shooter monitor on 18node4
* Resource action: shooter monitor on 18node3
* Resource action: shooter monitor on 18node2
* Resource action: shooter monitor on 18node1
* Resource action: remote1 monitor on 18node4
* Resource action: remote1 monitor on 18node3
* Resource action: remote1 monitor on 18node2
* Resource action: remote1 monitor on 18node1
* Resource action: FAKE1 monitor on 18node4
* Resource action: FAKE1 monitor on 18node3
* Resource action: FAKE1 monitor on 18node2
* Resource action: FAKE1 monitor on 18node1
* Resource action: FAKE1 monitor on 18builder
* Resource action: FAKE2 monitor on 18node2
* Resource action: FAKE2 monitor on 18node1
* Resource action: FAKE3 monitor on 18node3
* Resource action: FAKE4 monitor on 18node4
* Resource action: FAKE5 monitor on 18node4
* Resource action: FAKE5 monitor on 18node3
* Resource action: FAKE5 monitor on 18node2
* Resource action: FAKE5 monitor on 18node1
* Resource action: FAKE5 monitor on 18builder
* Resource action: FAKECLONE1:0 monitor on 18node1
* Pseudo action: FAKECLONE1-clone_start_0
* Resource action: FAKECLONE2:0 monitor on 18builder
* Resource action: FAKECLONE2:0 monitor on 18node3
* Resource action: FAKECLONE2:1 monitor on 18node1
* Resource action: FAKECLONE2:3 monitor on 18node4
* Resource action: FAKECLONE2:5 monitor on 18node3
* Pseudo action: FAKECLONE2-clone_start_0
* Pseudo action: FAKEGROUP_start_0
* Resource action: FAKE6 monitor on 18node2
* Resource action: FAKE6 monitor on 18node1
* Resource action: FAKE7 monitor on 18node2
* Resource action: FAKE7 monitor on 18node1
* Pseudo action: probe_nodes_complete
* Resource action: remote1 start on 18builder
* Resource action: remote1 start on 18node1
* Resource action: FAKE5 monitor on remote1
* Resource action: FAKECLONE1:4 monitor on remote1
* Resource action: FAKECLONE1:1 monitor on remote1
* Resource action: FAKECLONE2:4 monitor on remote1
* Pseudo action: probe_complete
* Resource action: remote1 monitor=60000 on 18builder
* Resource action: FAKE1 start on 18node2
* Resource action: FAKE2 stop on 18node2
* Resource action: FAKE3 stop on 18builder
* Resource action: FAKE4 stop on 18node1
* Resource action: shooter start on 18node2
* Resource action: remote1 monitor=60000 on 18node1
* Resource action: FAKE1 start on 18node4
* Resource action: FAKE2 start on 18node2
* Resource action: FAKE3 start on 18node3
* Resource action: FAKE4 start on 18node4
* Resource action: FAKE5 start on remote1
* Resource action: FAKECLONE1:0 start on 18builder
* Resource action: FAKECLONE1:1 start on 18node1
* Resource action: FAKECLONE1:2 start on 18node2
* Resource action: FAKECLONE1:3 start on 18node4
* Resource action: FAKECLONE1:4 start on remote1
* Resource action: FAKECLONE1:5 start on 18node3
* Resource action: FAKECLONE1:0 start on 18node1
* Resource action: FAKECLONE1:1 start on remote1
* Pseudo action: FAKECLONE1-clone_running_0
* Resource action: FAKECLONE2:0 start on 18builder
* Resource action: FAKECLONE2:0 start on 18node3
* Resource action: FAKECLONE2:1 start on 18node1
* Resource action: FAKECLONE2:2 start on 18node2
* Resource action: FAKECLONE2:3 start on 18node4
* Resource action: FAKECLONE2:4 start on remote1
* Resource action: FAKECLONE2:5 start on 18node3
* Pseudo action: FAKECLONE2-clone_running_0
* Pseudo action: all_stopped
* Resource action: FAKE1 monitor=60000 on 18node2
* Resource action: FAKE2 start on 18node3
* Resource action: FAKE3 start on 18node3
* Resource action: FAKE4 start on 18node4
* Resource action: FAKE6 start on 18node1
* Resource action: FAKE7 start on 18node1
* Resource action: shooter monitor=60000 on 18node2
* Resource action: FAKE1 monitor=60000 on 18node4
* Resource action: FAKE2 monitor=60000 on 18node2
* Resource action: FAKE3 monitor=60000 on 18node3
* Resource action: FAKE4 monitor=60000 on 18node4
* Resource action: FAKE5 monitor=60000 on remote1
* Resource action: FAKECLONE1:0 monitor=60000 on 18builder
* Resource action: FAKECLONE1:1 monitor=60000 on 18node1
* Resource action: FAKECLONE1:2 monitor=60000 on 18node2
* Resource action: FAKECLONE1:3 monitor=60000 on 18node4
* Resource action: FAKECLONE1:4 monitor=60000 on remote1
* Resource action: FAKECLONE1:5 monitor=60000 on 18node3
* Resource action: FAKECLONE2:0 monitor=60000 on 18builder
* Resource action: FAKECLONE1:0 monitor=60000 on 18node1
* Resource action: FAKECLONE1:1 monitor=60000 on remote1
* Resource action: FAKECLONE2:0 monitor=60000 on 18node3
* Resource action: FAKECLONE2:1 monitor=60000 on 18node1
* Resource action: FAKECLONE2:2 monitor=60000 on 18node2
* Resource action: FAKECLONE2:3 monitor=60000 on 18node4
* Resource action: FAKECLONE2:4 monitor=60000 on remote1
* Resource action: FAKECLONE2:5 monitor=60000 on 18node3
* Resource action: FAKE2 monitor=60000 on 18node3
* Resource action: FAKE3 monitor=60000 on 18node3
* Resource action: FAKE4 monitor=60000 on 18node4
* Pseudo action: FAKEGROUP_running_0
* Resource action: FAKE6 monitor=10000 on 18node1
* Resource action: FAKE7 monitor=10000 on 18node1

Revised cluster status:
Online: [ 18builder 18node1 18node2 18node3 18node4 ]
Online: [ 18node1 18node2 18node3 18node4 ]
RemoteOnline: [ remote1 ]

shooter (stonith:fence_xvm): Started 18node1
remote1 (ocf::pacemaker:remote): Started 18builder
FAKE1 (ocf::heartbeat:Dummy): Started 18node2
FAKE2 (ocf::heartbeat:Dummy): Started 18node3
shooter (stonith:fence_xvm): Started 18node2
remote1 (ocf::pacemaker:remote): Started 18node1
FAKE1 (ocf::heartbeat:Dummy): Started 18node4
FAKE2 (ocf::heartbeat:Dummy): Started 18node2
FAKE3 (ocf::heartbeat:Dummy): Started 18node3
FAKE4 (ocf::heartbeat:Dummy): Started 18node4
FAKE5 (ocf::heartbeat:Dummy): Started remote1
Clone Set: FAKECLONE1-clone [FAKECLONE1]
Started: [ 18builder 18node1 18node2 18node3 18node4 remote1 ]
Started: [ 18node1 remote1 ]
Stopped: [ 18node2 18node3 18node4 ]
Clone Set: FAKECLONE2-clone [FAKECLONE2]
Started: [ 18builder 18node1 18node2 18node3 18node4 remote1 ]
Started: [ 18node1 18node2 18node3 18node4 remote1 ]
Resource Group: FAKEGROUP
FAKE6 (ocf::heartbeat:Dummy): Started 18node1
FAKE7 (ocf::heartbeat:Dummy): Started 18node1

0 comments on commit bf22410

Please sign in to comment.