-
Notifications
You must be signed in to change notification settings - Fork 0
/
revision-2985.patch
133 lines (124 loc) · 3.66 KB
/
revision-2985.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
Index: exec/totemsrp.c
===================================================================
--- exec/totemsrp.c (revision 2984)
+++ exec/totemsrp.c (revision 2985)
@@ -3904,12 +3904,15 @@
return (0);
}
-static int memb_join_process (
+static void memb_join_process (
struct totemsrp_instance *instance,
const struct memb_join *memb_join)
{
struct srp_addr *proc_list;
struct srp_addr *failed_list;
+ int gather_entered = 0;
+ int fail_minus_memb_entries = 0;
+ struct srp_addr fail_minus_memb[PROCESSOR_COUNT_MAX];
proc_list = (struct srp_addr *)memb_join->end_of_memb_join;
failed_list = proc_list + memb_join->proc_list_entries;
@@ -3919,7 +3922,8 @@
memb_set_print ("faillist", failed_list, memb_join->failed_list_entries);
memb_set_print ("my_proclist", instance->my_proc_list, instance->my_proc_list_entries);
memb_set_print ("my_faillist", instance->my_failed_list, instance->my_failed_list_entries);
-*/
+-*/
+
if (memb_set_equal (proc_list,
memb_join->proc_list_entries,
instance->my_proc_list,
@@ -3942,7 +3946,7 @@
memb_state_commit_token_create (instance);
memb_state_commit_enter (instance);
- return (0);
+ return;
}
if (memb_consensus_agreed (instance) &&
memb_lowest_in_config (instance)) {
@@ -3951,7 +3955,7 @@
memb_state_commit_enter (instance);
} else {
- return (0);
+ return;
}
} else
if (memb_set_subset (proc_list,
@@ -3964,12 +3968,12 @@
instance->my_failed_list,
instance->my_failed_list_entries)) {
- return (0);
+ return;
} else
if (memb_set_subset (&memb_join->system_from, 1,
instance->my_failed_list, instance->my_failed_list_entries)) {
- return (0);
+ return;
} else {
memb_set_merge (proc_list,
memb_join->proc_list_entries,
@@ -3983,14 +3987,42 @@
&memb_join->system_from, 1,
instance->my_failed_list, &instance->my_failed_list_entries);
} else {
- memb_set_merge (failed_list,
- memb_join->failed_list_entries,
- instance->my_failed_list, &instance->my_failed_list_entries);
+ if (memb_set_subset (
+ &memb_join->system_from, 1,
+ instance->my_memb_list,
+ instance->my_memb_entries)) {
+
+ if (memb_set_subset (
+ &memb_join->system_from, 1,
+ instance->my_failed_list,
+ instance->my_failed_list_entries) == 0) {
+
+ memb_set_merge (failed_list,
+ memb_join->failed_list_entries,
+ instance->my_failed_list, &instance->my_failed_list_entries);
+ } else {
+ memb_set_subtract (fail_minus_memb,
+ &fail_minus_memb_entries,
+ failed_list,
+ memb_join->failed_list_entries,
+ instance->my_memb_list,
+ instance->my_memb_entries);
+
+ memb_set_merge (fail_minus_memb,
+ fail_minus_memb_entries,
+ instance->my_failed_list,
+ &instance->my_failed_list_entries);
+ }
+ }
}
memb_state_gather_enter (instance, 11);
- return (1); /* gather entered */
+ gather_entered = 1;
}
- return (0); /* gather not entered */
+ if (gather_entered == 0 &&
+ instance->memb_state == MEMB_STATE_OPERATIONAL) {
+
+ memb_state_gather_enter (instance, 12);
+ }
}
static void memb_join_endian_convert (const struct memb_join *in, struct memb_join *out)
@@ -4121,7 +4153,6 @@
{
const struct memb_join *memb_join;
struct memb_join *memb_join_convert = alloca (msg_len);
- int gather_entered;
if (endian_conversion_needed) {
memb_join = memb_join_convert;
@@ -4144,11 +4175,7 @@
}
switch (instance->memb_state) {
case MEMB_STATE_OPERATIONAL:
- gather_entered = memb_join_process (instance,
- memb_join);
- if (gather_entered == 0) {
- memb_state_gather_enter (instance, 12);
- }
+ memb_join_process (instance, memb_join);
break;
case MEMB_STATE_GATHER: