Commit d033a617 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 5c004da1
......@@ -1219,6 +1219,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 trasnactions 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.
......@@ -4,7 +4,7 @@ ZEO Fan Out
We should be able to set up ZEO servers with ZEO clients. Let's see
if we can make it work.
We'll use some helper functions. The first is a helpter that starts
We'll use some helper functions. The first is a helper that starts
ZEO servers for us and another one that picks ports.
We'll start the first server:
......@@ -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