diff --git a/neo/master/recovery.py b/neo/master/recovery.py
index 9e0cf98c05db1b06d6e3ead4c87e3ea17494bf1f..de6d3c75bb5a8251e735d813ecaef52735f1d3eb 100644
--- a/neo/master/recovery.py
+++ b/neo/master/recovery.py
@@ -55,7 +55,6 @@ class RecoveryManager(MasterHandler):
         self.app.changeClusterState(ClusterStates.RECOVERING)
         em = self.app.em
 
-        self.app.tm.setLastOID(None)
         self.app.pt.setID(None)
 
         # collect the last partition table available
@@ -119,7 +118,7 @@ class RecoveryManager(MasterHandler):
     def answerLastIDs(self, conn, loid, ltid, lptid):
         # Get max values.
         if loid is not None:
-            self.app.tm.setLastOID(max(loid, self.app.tm.getLastOID()))
+            self.app.tm.setLastOID(loid)
         if ltid is not None:
             self.app.tm.setLastTID(ltid)
         if lptid > self.target_ptid:
diff --git a/neo/master/transactions.py b/neo/master/transactions.py
index 9fa3e574f6874fc4633eadf04d98f61907a8a3ab..0903d3114edf33c10bf833fd2702258fb6f5eca8 100644
--- a/neo/master/transactions.py
+++ b/neo/master/transactions.py
@@ -266,7 +266,7 @@ class TransactionManager(object):
         return False
 
     def setLastOID(self, oid):
-        self._last_oid = oid
+        self._last_oid = max(oid, self._last_oid)
 
     def getLastOID(self):
         return self._last_oid