Commit eceb8b9e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent bd5e1658
...@@ -225,7 +225,7 @@ class BackupApplication(object): ...@@ -225,7 +225,7 @@ class BackupApplication(object):
# all partitions. t1 is wrong for the same reason. # all partitions. t1 is wrong for the same reason.
# So we have chosen the highest one (t3 - 1). # So we have chosen the highest one (t3 - 1).
# t2 should also work but maybe harder to implement. # t2 should also work but maybe harder to implement.
cell.backup_tid = add64(tid, -1) # XXX wrong! (we did not yet pulled the data) cell.backup_tid = add64(tid, -1)
logging.debug( logging.debug(
"partition %u: updating backup_tid of %r to %s", "partition %u: updating backup_tid of %r to %s",
offset, cell, dump(cell.backup_tid)) offset, cell, dump(cell.backup_tid))
......
...@@ -169,7 +169,8 @@ class ReplicationTests(NEOThreadedTest): ...@@ -169,7 +169,8 @@ class ReplicationTests(NEOThreadedTest):
finally: finally:
backup.stop() backup.stop()
# U -> B propagation with Mb -> Sb (Replicate) delayed # U -> B propagation with Mb -> Sb' (secondary, Replicate from primary Sb) delayed
# TODO also test: "U -> B propagation with Mb -> Sb (Replicate) delayed" ?
from neo.storage.database import manager as dbmanager from neo.storage.database import manager as dbmanager
from neo.master import handlers as mhandler from neo.master import handlers as mhandler
#dbmanager.X = 1 #dbmanager.X = 1
...@@ -179,9 +180,9 @@ class ReplicationTests(NEOThreadedTest): ...@@ -179,9 +180,9 @@ class ReplicationTests(NEOThreadedTest):
tid, upstream_name, source_dict = packet.decode() tid, upstream_name, source_dict = packet.decode()
print 'REPLICATE tid: %r, upstream_name: %r, source_dict: %r' % \ print 'REPLICATE tid: %r, upstream_name: %r, source_dict: %r' % \
(tid, upstream_name, source_dict) (tid, upstream_name, source_dict)
return True #return True
#return not upstream_name and all(source_dict.itervalues()) return not upstream_name and all(source_dict.itervalues())
return upstream_name != "" #return upstream_name != ""
backup.reset() backup.reset()
try: try:
backup.start() backup.start()
...@@ -190,23 +191,16 @@ class ReplicationTests(NEOThreadedTest): ...@@ -190,23 +191,16 @@ class ReplicationTests(NEOThreadedTest):
u_last_tid0 = U.last_tid u_last_tid0 = U.last_tid
self.assertEqual(B.backup_tid, u_last_tid0) self.assertEqual(B.backup_tid, u_last_tid0)
self.assertEqual(B.last_tid, u_last_tid0) self.assertEqual(B.last_tid, u_last_tid0)
print
print 'B.backup_tid: %r' % B.backup_tid
with backup.master.filterConnection(*backup.storage_list) as f: with backup.master.filterConnection(*backup.storage_list) as f:
f.add(delaySecondary) # NOTE delays backup pickup Mb -> Sb f.add(delaySecondary)
print 'B.backup_tid: %r' % B.backup_tid
while not f.filtered_count: while not f.filtered_count:
print 'B.backup_tid: %r' % B.backup_tid
importZODB(1) importZODB(1)
print 'B.backup_tid: %r' % B.backup_tid
self.tic() self.tic()
print 'B.backup_tid: %r' % B.backup_tid # there were new commits
print
print 'u_last_tid0: %r' % u_last_tid0
print 'U.last_tid: %r' % U.last_tid
print 'B.backup_tid: %r' % B.backup_tid
self.assertGreater(U.last_tid, u_last_tid0) self.assertGreater(U.last_tid, u_last_tid0)
self.assertEqual(B.backup_tid, u_last_tid0) # is not updated for data (but can be pre-updated to tid-1 on first synced txn) XXX text
self.assertLess(B.backup_tid, U.last_tid)
# info about last_tid is synced fully
self.assertEqual(B.last_tid, U.last_tid) self.assertEqual(B.last_tid, U.last_tid)
backup.neoctl.setClusterState(ClusterStates.STOPPING_BACKUP) backup.neoctl.setClusterState(ClusterStates.STOPPING_BACKUP)
self.tic() self.tic()
...@@ -224,7 +218,7 @@ class ReplicationTests(NEOThreadedTest): ...@@ -224,7 +218,7 @@ class ReplicationTests(NEOThreadedTest):
dbmanager.X = 0 dbmanager.X = 0
mhandler.X = 0 mhandler.X = 0
# S -> Sb (AddObject) delayed # S -> Sb (AddObject) delayed XXX not only S -> Sb: also Sb -> Sb'
backup.reset() backup.reset()
try: try:
backup.start() backup.start()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment