enforce transaction sync
authorVolker Birk <vb@pep-project.org>
Sat, 13 Apr 2019 23:44:30 +0200
branchsync
changeset 3513ba228219d1f9
parent 3512 a5a45f8fa684
child 3514 ff5d113bf2b3
enforce transaction
sync/sync.fsm
     1.1 --- a/sync/sync.fsm	Sat Apr 13 23:29:23 2019 +0200
     1.2 +++ b/sync/sync.fsm	Sat Apr 13 23:44:30 2019 +0200
     1.3 @@ -79,7 +79,7 @@
     1.4                  go Sole;
     1.5              }
     1.6  
     1.7 -            on Rollback
     1.8 +            on Rollback if sameTransaction
     1.9                  go Sole;
    1.10  
    1.11              // Reject is CommitReject
    1.12 @@ -89,7 +89,7 @@
    1.13                  go End;
    1.14              }
    1.15  
    1.16 -            on CommitReject {
    1.17 +            on CommitReject if sameTransaction {
    1.18                  do disable;
    1.19                  go End;
    1.20              }
    1.21 @@ -101,7 +101,7 @@
    1.22              }
    1.23  
    1.24              // got a CommitAccept from second
    1.25 -            on CommitAccept
    1.26 +            on CommitAccept if sameTransaction
    1.27                  go HandshakingNewPhase2;
    1.28          }
    1.29  
    1.30 @@ -116,7 +116,7 @@
    1.31                  go Sole;
    1.32              }
    1.33  
    1.34 -            on Rollback
    1.35 +            on Rollback if sameTransaction
    1.36                  go Sole;
    1.37  
    1.38              // Reject is CommitReject
    1.39 @@ -126,7 +126,7 @@
    1.40                  go End;
    1.41              }
    1.42  
    1.43 -            on CommitReject {
    1.44 +            on CommitReject if sameTransaction {
    1.45                  do disable;
    1.46                  go End;
    1.47              }
    1.48 @@ -138,33 +138,33 @@
    1.49              }
    1.50  
    1.51              // got a CommitAccept from first
    1.52 -            on CommitAccept
    1.53 +            on CommitAccept if sameTransaction
    1.54                  go HandshakingNewPhase2;
    1.55          }
    1.56  
    1.57          state HandshakingNewPhase1First {
    1.58 -            on Rollback
    1.59 +            on Rollback if sameTransaction
    1.60                  go Sole;
    1.61              
    1.62 -            on CommitReject {
    1.63 +            on CommitReject if sameTransaction {
    1.64                  do disable;
    1.65                  go End;
    1.66              }
    1.67  
    1.68 -            on CommitAccept
    1.69 +            on CommitAccept if sameTransaction
    1.70                  go NewGroup;
    1.71          }
    1.72  
    1.73          state HandshakingNewPhase1Second {
    1.74 -            on Rollback
    1.75 +            on Rollback if sameTransaction
    1.76                  go Sole;
    1.77              
    1.78 -            on CommitReject {
    1.79 +            on CommitReject if sameTransaction {
    1.80                  do disable;
    1.81                  go End;
    1.82              }
    1.83  
    1.84 -            on CommitAcceptForGroup
    1.85 +            on CommitAcceptForGroup if sameTransaction
    1.86                  go NewGroup;
    1.87          }
    1.88  
    1.89 @@ -190,7 +190,7 @@
    1.90                  send GroupKeysAndClose; // we're not grouped yet, this is our own keys
    1.91              }
    1.92  
    1.93 -            on GroupKeysAndClose {
    1.94 +            on GroupKeysAndClose if sameTransaction {
    1.95                  if keyElectionWon
    1.96                      do ownKeysAreGroupKeys;
    1.97                  else
    1.98 @@ -209,7 +209,7 @@
    1.99                  go Sole;
   1.100              }
   1.101  
   1.102 -            on Rollback
   1.103 +            on Rollback if sameTransaction
   1.104                  go Sole;
   1.105  
   1.106              // Reject is CommitReject
   1.107 @@ -219,7 +219,7 @@
   1.108                  go End;
   1.109              }
   1.110  
   1.111 -            on CommitReject {
   1.112 +            on CommitReject if sameTransaction {
   1.113                  do disable;
   1.114                  go End;
   1.115              }
   1.116 @@ -230,20 +230,20 @@
   1.117                  go HandshakingJoinPhase1;
   1.118              }
   1.119  
   1.120 -            on CommitAcceptForGroup
   1.121 +            on CommitAcceptForGroup if sameTransaction
   1.122                  go HandshakingJoinPhase1Own;
   1.123          }
   1.124  
   1.125          state HandshakingJoinPhase1 {
   1.126 -            on Rollback
   1.127 +            on Rollback if sameTransaction
   1.128                  go Sole;
   1.129              
   1.130 -            on CommitReject {
   1.131 +            on CommitReject if sameTransaction {
   1.132                  do disable;
   1.133                  go End;
   1.134              }
   1.135  
   1.136 -            on CommitAcceptForGroup
   1.137 +            on CommitAcceptForGroup if sameTransaction
   1.138                  go JoinGroup;
   1.139          }
   1.140  
   1.141 @@ -303,7 +303,7 @@
   1.142                  go Grouped;
   1.143              }
   1.144  
   1.145 -            on Rollback
   1.146 +            on Rollback if sameTransaction
   1.147                  go Grouped;
   1.148  
   1.149              // Reject is CommitReject
   1.150 @@ -312,7 +312,7 @@
   1.151                  go Grouped;
   1.152              }
   1.153  
   1.154 -            on CommitReject
   1.155 +            on CommitReject if sameTransaction
   1.156                  go Grouped;
   1.157  
   1.158              // Accept is Phase1Commit
   1.159 @@ -321,7 +321,7 @@
   1.160                  go HandshakingGroupedPhase1;
   1.161              }
   1.162  
   1.163 -            on CommitAccept
   1.164 +            on CommitAccept if sameTransaction
   1.165                  go HandshakingGroupedPhase1Own;
   1.166  
   1.167              on GroupKeys
   1.168 @@ -329,13 +329,13 @@
   1.169          }
   1.170  
   1.171          state HandshakingGroupedPhase1 {
   1.172 -            on Rollback
   1.173 +            on Rollback if sameTransaction
   1.174                  go Grouped;
   1.175  
   1.176 -            on CommitReject
   1.177 +            on CommitReject if sameTransaction
   1.178                  go Grouped;
   1.179  
   1.180 -            on CommitAccept {
   1.181 +            on CommitAccept if sameTransaction {
   1.182                  send GroupKeysAndClose;
   1.183                  go Grouped;
   1.184              }