Skip to content

Commit bf22410

Browse files
committed
Merge branch 'master' of github.com:ClusterLabs/pacemaker
2 parents 3e076a8 + cd7c9ab commit bf22410

File tree

8 files changed

+666
-781
lines changed

8 files changed

+666
-781
lines changed

lib/pengine/utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ node_copy(node_t * this_node)
7474

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

77+
new_node->rsc_discover_mode = this_node->rsc_discover_mode;
7778
new_node->weight = this_node->weight;
7879
new_node->fixed = this_node->fixed;
7980
new_node->details = this_node->details;

pengine/allocate.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,28 @@ probe_resources(pe_working_set_t * data_set)
948948
return TRUE;
949949
}
950950

951+
static void
952+
rsc_discover_filter(resource_t *rsc, node_t *node)
953+
{
954+
GListPtr gIter = rsc->children;
955+
resource_t *top = uber_parent(rsc);
956+
node_t *match;
957+
958+
if (rsc->exclusive_discover == FALSE && top->exclusive_discover == FALSE) {
959+
return;
960+
}
961+
962+
for (; gIter != NULL; gIter = gIter->next) {
963+
resource_t *child_rsc = (resource_t *) gIter->data;
964+
rsc_discover_filter(child_rsc, node);
965+
}
966+
967+
match = g_hash_table_lookup(rsc->allowed_nodes, node->details->id);
968+
if (match && match->rsc_discover_mode != discover_exclusive) {
969+
match->weight = -INFINITY;
970+
}
971+
}
972+
951973
/*
952974
* Count how many valid nodes we have (so we know the maximum number of
953975
* colors we can resolve).
@@ -986,6 +1008,7 @@ stage2(pe_working_set_t * data_set)
9861008
resource_t *rsc = (resource_t *) gIter2->data;
9871009

9881010
common_apply_stickiness(rsc, node, data_set);
1011+
rsc_discover_filter(rsc, node);
9891012
}
9901013
}
9911014

pengine/native.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,6 +2103,9 @@ native_rsc_location(resource_t * rsc, rsc_to_node_t * constraint)
21032103
}
21042104

21052105
if (other_node->rsc_discover_mode < constraint->discover_mode) {
2106+
if (constraint->discover_mode == discover_exclusive) {
2107+
rsc->exclusive_discover = TRUE;
2108+
}
21062109
/* exclusive > never > always... always is default */
21072110
other_node->rsc_discover_mode = constraint->discover_mode;
21082111
}

pengine/test10/resource-discovery.dot

Lines changed: 85 additions & 99 deletions
Large diffs are not rendered by default.

pengine/test10/resource-discovery.exp

Lines changed: 352 additions & 414 deletions
Large diffs are not rendered by default.

pengine/test10/resource-discovery.scores

Lines changed: 79 additions & 107 deletions
Large diffs are not rendered by default.
Lines changed: 69 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +1,128 @@
11

22
Current cluster status:
3-
Online: [ 18builder 18node1 18node2 18node3 18node4 ]
3+
Online: [ 18node1 18node2 18node3 18node4 ]
44
RemoteOFFLINE: [ remote1 ]
55

6-
shooter (stonith:fence_xvm): Started 18node1
6+
shooter (stonith:fence_xvm): Stopped
77
remote1 (ocf::pacemaker:remote): Stopped
88
FAKE1 (ocf::heartbeat:Dummy): Stopped
9-
FAKE2 (ocf::heartbeat:Dummy): Started 18node2
10-
FAKE3 (ocf::heartbeat:Dummy): Started 18builder
11-
FAKE4 (ocf::heartbeat:Dummy): Started 18node1
9+
FAKE2 (ocf::heartbeat:Dummy): Stopped
10+
FAKE3 (ocf::heartbeat:Dummy): Stopped
11+
FAKE4 (ocf::heartbeat:Dummy): Stopped
1212
FAKE5 (ocf::heartbeat:Dummy): Stopped
1313
Clone Set: FAKECLONE1-clone [FAKECLONE1]
14-
Stopped: [ 18builder 18node1 18node2 18node3 18node4 remote1 ]
14+
Stopped: [ 18node1 18node2 18node3 18node4 remote1 ]
1515
Clone Set: FAKECLONE2-clone [FAKECLONE2]
16-
Stopped: [ 18builder 18node1 18node2 18node3 18node4 remote1 ]
16+
Stopped: [ 18node1 18node2 18node3 18node4 remote1 ]
17+
Resource Group: FAKEGROUP
18+
FAKE6 (ocf::heartbeat:Dummy): Stopped
19+
FAKE7 (ocf::heartbeat:Dummy): Stopped
1720

1821
Transition Summary:
19-
* Start remote1 (18builder)
20-
* Start FAKE1 (18node2)
21-
* Move FAKE2 (Started 18node2 -> 18node3)
22-
* Move FAKE3 (Started 18builder -> 18node3)
23-
* Move FAKE4 (Started 18node1 -> 18node4)
22+
* Start shooter (18node2)
23+
* Start remote1 (18node1)
24+
* Start FAKE1 (18node4)
25+
* Start FAKE2 (18node2)
26+
* Start FAKE3 (18node3)
27+
* Start FAKE4 (18node4)
2428
* Start FAKE5 (remote1)
25-
* Start FAKECLONE1:0 (18builder)
26-
* Start FAKECLONE1:1 (18node1)
27-
* Start FAKECLONE1:2 (18node2)
28-
* Start FAKECLONE1:3 (18node4)
29-
* Start FAKECLONE1:4 (remote1)
30-
* Start FAKECLONE1:5 (18node3)
31-
* Start FAKECLONE2:0 (18builder)
29+
* Start FAKECLONE1:0 (18node1)
30+
* Start FAKECLONE1:1 (remote1)
31+
* Start FAKECLONE2:0 (18node3)
3232
* Start FAKECLONE2:1 (18node1)
3333
* Start FAKECLONE2:2 (18node2)
3434
* Start FAKECLONE2:3 (18node4)
3535
* Start FAKECLONE2:4 (remote1)
36-
* Start FAKECLONE2:5 (18node3)
36+
* Start FAKE6 (18node1)
37+
* Start FAKE7 (18node1)
3738

3839
Executing cluster transition:
3940
* Resource action: shooter monitor on 18node4
4041
* Resource action: shooter monitor on 18node3
42+
* Resource action: shooter monitor on 18node2
43+
* Resource action: shooter monitor on 18node1
4144
* Resource action: remote1 monitor on 18node4
4245
* Resource action: remote1 monitor on 18node3
46+
* Resource action: remote1 monitor on 18node2
47+
* Resource action: remote1 monitor on 18node1
4348
* Resource action: FAKE1 monitor on 18node4
44-
* Resource action: FAKE1 monitor on 18node3
45-
* Resource action: FAKE1 monitor on 18node2
46-
* Resource action: FAKE1 monitor on 18node1
47-
* Resource action: FAKE1 monitor on 18builder
49+
* Resource action: FAKE2 monitor on 18node2
50+
* Resource action: FAKE2 monitor on 18node1
4851
* Resource action: FAKE3 monitor on 18node3
4952
* Resource action: FAKE4 monitor on 18node4
5053
* Resource action: FAKE5 monitor on 18node4
5154
* Resource action: FAKE5 monitor on 18node3
5255
* Resource action: FAKE5 monitor on 18node2
5356
* Resource action: FAKE5 monitor on 18node1
54-
* Resource action: FAKE5 monitor on 18builder
57+
* Resource action: FAKECLONE1:0 monitor on 18node1
5558
* Pseudo action: FAKECLONE1-clone_start_0
56-
* Resource action: FAKECLONE2:0 monitor on 18builder
59+
* Resource action: FAKECLONE2:0 monitor on 18node3
5760
* Resource action: FAKECLONE2:1 monitor on 18node1
5861
* Resource action: FAKECLONE2:3 monitor on 18node4
59-
* Resource action: FAKECLONE2:5 monitor on 18node3
6062
* Pseudo action: FAKECLONE2-clone_start_0
63+
* Pseudo action: FAKEGROUP_start_0
64+
* Resource action: FAKE6 monitor on 18node2
65+
* Resource action: FAKE6 monitor on 18node1
66+
* Resource action: FAKE7 monitor on 18node2
67+
* Resource action: FAKE7 monitor on 18node1
6168
* Pseudo action: probe_nodes_complete
62-
* Resource action: remote1 start on 18builder
69+
* Resource action: remote1 start on 18node1
6370
* Resource action: FAKE5 monitor on remote1
64-
* Resource action: FAKECLONE1:4 monitor on remote1
71+
* Resource action: FAKECLONE1:1 monitor on remote1
6572
* Resource action: FAKECLONE2:4 monitor on remote1
6673
* Pseudo action: probe_complete
67-
* Resource action: remote1 monitor=60000 on 18builder
68-
* Resource action: FAKE1 start on 18node2
69-
* Resource action: FAKE2 stop on 18node2
70-
* Resource action: FAKE3 stop on 18builder
71-
* Resource action: FAKE4 stop on 18node1
74+
* Resource action: shooter start on 18node2
75+
* Resource action: remote1 monitor=60000 on 18node1
76+
* Resource action: FAKE1 start on 18node4
77+
* Resource action: FAKE2 start on 18node2
78+
* Resource action: FAKE3 start on 18node3
79+
* Resource action: FAKE4 start on 18node4
7280
* Resource action: FAKE5 start on remote1
73-
* Resource action: FAKECLONE1:0 start on 18builder
74-
* Resource action: FAKECLONE1:1 start on 18node1
75-
* Resource action: FAKECLONE1:2 start on 18node2
76-
* Resource action: FAKECLONE1:3 start on 18node4
77-
* Resource action: FAKECLONE1:4 start on remote1
78-
* Resource action: FAKECLONE1:5 start on 18node3
81+
* Resource action: FAKECLONE1:0 start on 18node1
82+
* Resource action: FAKECLONE1:1 start on remote1
7983
* Pseudo action: FAKECLONE1-clone_running_0
80-
* Resource action: FAKECLONE2:0 start on 18builder
84+
* Resource action: FAKECLONE2:0 start on 18node3
8185
* Resource action: FAKECLONE2:1 start on 18node1
8286
* Resource action: FAKECLONE2:2 start on 18node2
8387
* Resource action: FAKECLONE2:3 start on 18node4
8488
* Resource action: FAKECLONE2:4 start on remote1
85-
* Resource action: FAKECLONE2:5 start on 18node3
8689
* Pseudo action: FAKECLONE2-clone_running_0
87-
* Pseudo action: all_stopped
88-
* Resource action: FAKE1 monitor=60000 on 18node2
89-
* Resource action: FAKE2 start on 18node3
90-
* Resource action: FAKE3 start on 18node3
91-
* Resource action: FAKE4 start on 18node4
90+
* Resource action: FAKE6 start on 18node1
91+
* Resource action: FAKE7 start on 18node1
92+
* Resource action: shooter monitor=60000 on 18node2
93+
* Resource action: FAKE1 monitor=60000 on 18node4
94+
* Resource action: FAKE2 monitor=60000 on 18node2
95+
* Resource action: FAKE3 monitor=60000 on 18node3
96+
* Resource action: FAKE4 monitor=60000 on 18node4
9297
* Resource action: FAKE5 monitor=60000 on remote1
93-
* Resource action: FAKECLONE1:0 monitor=60000 on 18builder
94-
* Resource action: FAKECLONE1:1 monitor=60000 on 18node1
95-
* Resource action: FAKECLONE1:2 monitor=60000 on 18node2
96-
* Resource action: FAKECLONE1:3 monitor=60000 on 18node4
97-
* Resource action: FAKECLONE1:4 monitor=60000 on remote1
98-
* Resource action: FAKECLONE1:5 monitor=60000 on 18node3
99-
* Resource action: FAKECLONE2:0 monitor=60000 on 18builder
98+
* Resource action: FAKECLONE1:0 monitor=60000 on 18node1
99+
* Resource action: FAKECLONE1:1 monitor=60000 on remote1
100+
* Resource action: FAKECLONE2:0 monitor=60000 on 18node3
100101
* Resource action: FAKECLONE2:1 monitor=60000 on 18node1
101102
* Resource action: FAKECLONE2:2 monitor=60000 on 18node2
102103
* Resource action: FAKECLONE2:3 monitor=60000 on 18node4
103104
* Resource action: FAKECLONE2:4 monitor=60000 on remote1
104-
* Resource action: FAKECLONE2:5 monitor=60000 on 18node3
105-
* Resource action: FAKE2 monitor=60000 on 18node3
106-
* Resource action: FAKE3 monitor=60000 on 18node3
107-
* Resource action: FAKE4 monitor=60000 on 18node4
105+
* Pseudo action: FAKEGROUP_running_0
106+
* Resource action: FAKE6 monitor=10000 on 18node1
107+
* Resource action: FAKE7 monitor=10000 on 18node1
108108

109109
Revised cluster status:
110-
Online: [ 18builder 18node1 18node2 18node3 18node4 ]
110+
Online: [ 18node1 18node2 18node3 18node4 ]
111111
RemoteOnline: [ remote1 ]
112112

113-
shooter (stonith:fence_xvm): Started 18node1
114-
remote1 (ocf::pacemaker:remote): Started 18builder
115-
FAKE1 (ocf::heartbeat:Dummy): Started 18node2
116-
FAKE2 (ocf::heartbeat:Dummy): Started 18node3
113+
shooter (stonith:fence_xvm): Started 18node2
114+
remote1 (ocf::pacemaker:remote): Started 18node1
115+
FAKE1 (ocf::heartbeat:Dummy): Started 18node4
116+
FAKE2 (ocf::heartbeat:Dummy): Started 18node2
117117
FAKE3 (ocf::heartbeat:Dummy): Started 18node3
118118
FAKE4 (ocf::heartbeat:Dummy): Started 18node4
119119
FAKE5 (ocf::heartbeat:Dummy): Started remote1
120120
Clone Set: FAKECLONE1-clone [FAKECLONE1]
121-
Started: [ 18builder 18node1 18node2 18node3 18node4 remote1 ]
121+
Started: [ 18node1 remote1 ]
122+
Stopped: [ 18node2 18node3 18node4 ]
122123
Clone Set: FAKECLONE2-clone [FAKECLONE2]
123-
Started: [ 18builder 18node1 18node2 18node3 18node4 remote1 ]
124+
Started: [ 18node1 18node2 18node3 18node4 remote1 ]
125+
Resource Group: FAKEGROUP
126+
FAKE6 (ocf::heartbeat:Dummy): Started 18node1
127+
FAKE7 (ocf::heartbeat:Dummy): Started 18node1
124128

0 commit comments

Comments
 (0)