Commit 04626c4e authored by Jim Fulton's avatar Jim Fulton

Added a client-storage check to make sure a client doesn't connect to

an out-of-date server.
parent b1e8c210
......@@ -1206,6 +1206,10 @@ class ClientStorage(object):
log2("No verification necessary (last_inval_tid up-to-date)")
self.finish_verification()
return "no verification"
elif ltid < last_inval_tid:
message = "Client has seen newer transactions than server!"
log2(message, level=logging.CRITICAL)
raise ClientStorageError(message)
# log some hints about last transaction
log2("last inval tid: %r %s\n"
......
This diff is collapsed.
......@@ -13,7 +13,8 @@ We'll start the first server:
>>> port0 = ZEO.tests.testZEO.get_port()
>>> zconf0 = ZEO.tests.forker.ZEOConfig(('', port0))
>>> zport0, adminaddr0, pid0, path0 = ZEO.tests.forker.start_zeo_server(
... '<filestorage 1>\n path fs\n</filestorage>\n', zconf0, port0)
... '<filestorage 1>\n path fs\n</filestorage>\n', zconf0,
... port0, keep=1)
Then we'll start 2 others that use this one:
......@@ -56,13 +57,6 @@ And some databases and connections around these:
>>> r2
{}
>>> db2 = DB(cs2)
>>> tm2 = transaction.TransactionManager()
>>> c2 = db2.open(transaction_manager=tm2)
>>> r2 = c2.root()
>>> r2
{}
If we update c1, we'll eventually see the change in c2:
>>> import persistent.mapping
......
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