Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zodb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joshua
zodb
Commits
beaad669
Commit
beaad669
authored
Sep 24, 2010
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish z64-ification of lastTransaction.
parent
d30a1ae9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
20 deletions
+21
-20
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+18
-17
src/ZEO/ServerStub.py
src/ZEO/ServerStub.py
+1
-1
src/ZEO/cache.py
src/ZEO/cache.py
+2
-2
No files found.
src/ZEO/ClientStorage.py
View file @
beaad669
...
...
@@ -1339,25 +1339,25 @@ class ClientStorage(object):
# it should set self._server. If it goes through full cache
# verification, then endVerify() should self._server.
l
tid
=
server
.
lastTransaction
()
server_
tid
=
server
.
lastTransaction
()
if
not
self
.
_cache
:
logger
.
info
(
"%s No verification necessary -- empty cache"
,
self
.
__name__
)
if
l
tid
!=
utils
.
z64
:
self
.
_cache
.
setLastTid
(
l
tid
)
if
server_
tid
!=
utils
.
z64
:
self
.
_cache
.
setLastTid
(
server_
tid
)
self
.
finish_verification
()
return
"empty cache"
last_inval
_tid
=
self
.
_cache
.
getLastTid
()
if
last_inval_tid
is
not
None
:
if
ltid
==
last_inval
_tid
:
cache
_tid
=
self
.
_cache
.
getLastTid
()
if
cache_tid
!=
utils
.
z64
:
if
server_tid
==
cache
_tid
:
logger
.
info
(
"%s No verification necessary"
" (
last_inval
_tid up-to-date %r)"
,
self
.
__name__
,
l
tid
)
" (
cache
_tid up-to-date %r)"
,
self
.
__name__
,
server_
tid
)
self
.
finish_verification
()
return
"no verification"
elif
ltid
<
last_inval
_tid
:
elif
server_tid
<
cache
_tid
:
message
=
(
"%s Client has seen newer transactions than server!"
%
self
.
__name__
)
logger
.
critical
(
message
)
...
...
@@ -1365,23 +1365,24 @@ class ClientStorage(object):
# log some hints about last transaction
logger
.
info
(
"%s last inval tid: %r %s
\
n
"
,
self
.
__name__
,
last_inval
_tid
,
tid2time
(
last_inval
_tid
))
self
.
__name__
,
cache
_tid
,
tid2time
(
cache
_tid
))
logger
.
info
(
"%s last transaction: %r %s"
,
self
.
__name__
,
ltid
,
ltid
and
tid2time
(
ltid
))
self
.
__name__
,
server_tid
,
server_tid
and
tid2time
(
server_tid
))
pair
=
server
.
getInvalidations
(
last_inval
_tid
)
pair
=
server
.
getInvalidations
(
cache
_tid
)
if
pair
is
not
None
:
logger
.
info
(
"%s Recovering %d invalidations"
,
self
.
__name__
,
len
(
pair
[
1
]))
self
.
finish_verification
(
pair
)
return
"quick verification"
elif
l
tid
!=
utils
.
z64
:
elif
server_
tid
!=
utils
.
z64
:
# Hm, to have gotten here, the cache is non-empty, but
# it has no last tid. This doesn't seem like good situation.
# We'll have to verify the cache, if we're willing.
self
.
_cache
.
setLastTid
(
l
tid
)
self
.
_cache
.
setLastTid
(
server_
tid
)
zope
.
event
.
notify
(
ZEO
.
interfaces
.
StaleCache
(
self
))
...
...
@@ -1398,8 +1399,8 @@ class ClientStorage(object):
if
self
.
_cache
and
self
.
_drop_cache_rather_verify
:
logger
.
critical
(
"%s dropping stale cache"
,
self
.
__name__
)
self
.
_cache
.
clear
()
if
l
tid
:
self
.
_cache
.
setLastTid
(
l
tid
)
if
server_
tid
:
self
.
_cache
.
setLastTid
(
server_
tid
)
self
.
finish_verification
()
return
"cache dropped"
...
...
src/ZEO/ServerStub.py
View file @
beaad669
...
...
@@ -310,7 +310,7 @@ class StorageServer308(StorageServer):
def
__init__
(
self
,
rpc
):
if
rpc
.
peer_protocol_version
==
'Z200'
:
self
.
lastTransaction
=
lambda
:
None
self
.
lastTransaction
=
lambda
:
z64
self
.
getInvalidations
=
lambda
tid
:
None
self
.
getAuthProtocol
=
lambda
:
None
...
...
src/ZEO/cache.py
View file @
beaad669
...
...
@@ -177,7 +177,7 @@ class ClientCache(object):
# tid for the most recent transaction we know about. This is also
# stored near the start of the file.
self
.
tid
=
None
self
.
tid
=
z64
# Always the offset into the file of the start of a block.
# New and relocated objects are always written starting at
...
...
@@ -458,7 +458,7 @@ class ClientCache(object):
def
setLastTid
(
self
,
tid
):
if
(
not
tid
)
or
(
tid
==
z64
):
return
if
(
self
.
tid
is
not
None
)
and
(
tid
<=
self
.
tid
)
and
self
:
if
(
tid
<=
self
.
tid
)
and
self
.
_len
:
if
tid
==
self
.
tid
:
return
# Be a little forgiving
raise
ValueError
(
"new last tid (%s) must be greater than "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment