• Julien Muchembled's avatar
    Add test showing that clients may be stuck on an old snapshot in case of failure during tpc_finish · fd4cfaa9
    Julien Muchembled authored
    If anything wrong happens after a transaction is locked and before the end of
    onTransactionCommitted, recovery phase should be run again, so that the master
    gets correct last tid.
    
    Following patch by Vincent is an attempt to fix this:
    
    --- a/neo/master/app.py
    +++ b/neo/master/app.py
    @@ -329,8 +329,8 @@ def playPrimaryRole(self):
    
             # recover the cluster status at startup
             try:
    -            self.runManager(RecoveryManager)
                 while True:
    +                self.runManager(RecoveryManager)
                     self.runManager(VerificationManager)
                     try:
                         if self.backup_tid:
    @@ -338,10 +338,6 @@ def playPrimaryRole(self):
                                 raise RuntimeError("No upstream cluster to backup"
                                                    " defined in configuration")
                             self.backup_app.provideService()
    -                        # Reset connection with storages (and go through a
    -                        # recovery phase) when leaving backup mode in order
    -                        # to get correct last oid/tid.
    -                        self.runManager(RecoveryManager)
                             continue
                         self.provideService()
                     except OperationFailure:
    fd4cfaa9
TODO 10.4 KB