Signed-off-by: Jan Friesse <[email protected]>
---
 exec/totemrrp.c |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/exec/totemrrp.c b/exec/totemrrp.c
index 6fb5772..0445be2 100644
--- a/exec/totemrrp.c
+++ b/exec/totemrrp.c
@@ -468,6 +468,22 @@ static void active_timer_problem_decrementer_cancel (
 
 #define ENDIAN_LOCAL                           0xff22
 
+/*
+ * Rollover handling:
+ *
+ * ARR_SEQNO_START_TOKEN is the starting sequence number of last seen sequence
+ * for a token for active redundand ring.  This should remain zero, unless 
testing
+ * overflow in which case 07fffff00 or 0xffffff00 are good starting values.
+ * It should be same as on defined in totemsrp.c
+ */
+
+#define ARR_SEQNO_START_TOKEN 0x0
+
+/*
+ * These can be used ot test different rollover points
+ * #define ARR_SEQNO_START_MSG 0xfffffe00
+ */
+
 struct message_header {
        char type;
        char encapsulated;
@@ -1154,6 +1170,8 @@ void *active_instance_initialize (
 
        instance->rrp_instance = rrp_instance;
 
+       instance->last_token_seq = ARR_SEQNO_START_TOKEN - 1;
+
 error_exit:
        return ((void *)instance);
 }
@@ -1342,7 +1360,7 @@ static void active_token_recv (
        struct active_instance *active_instance = (struct active_instance 
*)rrp_instance->rrp_algo_instance;
 
        active_instance->totemrrp_context = context;
-       if (token_seq > active_instance->last_token_seq) {
+       if (sq_lt_compare (active_instance->last_token_seq, token_seq)) {
                memcpy (active_instance->token, msg, msg_len);
                active_instance->token_len = msg_len;
                for (i = 0; i < rrp_instance->interface_count; i++) {
@@ -1353,6 +1371,17 @@ static void active_token_recv (
                active_timer_expired_token_start (active_instance);
        }
 
+       /*
+        * TODO: This line (according to specification) should be inside
+        * sq_lt_compare condition. Big problem with such solution is, that
+        * if recovery action is taken, RRP doesn't know (only SRP does). This
+        * leads to set token seq to init seqno, but RRP doesn't know so it
+        * may consider new seq no older.
+        *
+        * Current implementation is not "so" bad because all "weird" cases
+        * are handled by SRP and worst thing which can happen is
+        * few more retransmit messages.
+        */
        active_instance->last_token_seq = token_seq;
 
        if (token_seq == active_instance->last_token_seq) {
-- 
1.7.1

_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to