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
c2225847
Commit
c2225847
authored
Dec 04, 2008
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow any last tid to be set for empty zeo cache files.
parent
62d662d3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
src/CHANGES.txt
src/CHANGES.txt
+7
-1
src/ZEO/cache.py
src/ZEO/cache.py
+1
-1
src/ZEO/tests/test_cache.py
src/ZEO/tests/test_cache.py
+9
-1
No files found.
src/CHANGES.txt
View file @
c2225847
...
@@ -22,7 +22,7 @@ New Features
...
@@ -22,7 +22,7 @@ New Features
XXX There are known issues with this implementation that need to be
XXX There are known issues with this implementation that need to be
sorted out before it is "released".
sorted out before it is "released".
3.9.0a
6
(2008-12-??)
3.9.0a
7
(2008-12-??)
====================
====================
New Features
New Features
...
@@ -33,6 +33,12 @@ New Features
...
@@ -33,6 +33,12 @@ New Features
The ordinary file may be used outside the current transaction and
The ordinary file may be used outside the current transaction and
even after the blob's database connection has been closed.
even after the blob's database connection has been closed.
Bugs Fixed
----------
- Starting ClientStorages sometimes failed with non-new but empty
cache files.
3.9.0a6 (2008-11-30)
3.9.0a6 (2008-11-30)
====================
====================
...
...
src/ZEO/cache.py
View file @
c2225847
...
@@ -436,7 +436,7 @@ class ClientCache(object):
...
@@ -436,7 +436,7 @@ class ClientCache(object):
# recent tid.
# recent tid.
@
locked
@
locked
def
setLastTid
(
self
,
tid
):
def
setLastTid
(
self
,
tid
):
if
self
.
tid
is
not
None
and
tid
<=
self
.
tid
:
if
(
self
.
tid
is
not
None
)
and
(
tid
<=
self
.
tid
)
and
self
:
raise
ValueError
(
"new last tid (%s) must be greater than "
raise
ValueError
(
"new last tid (%s) must be greater than "
"previous one (%s)"
%
(
u64
(
tid
),
"previous one (%s)"
%
(
u64
(
tid
),
u64
(
self
.
tid
)))
u64
(
self
.
tid
)))
...
...
src/ZEO/tests/test_cache.py
View file @
c2225847
...
@@ -85,6 +85,9 @@ class CacheTests(ZODB.tests.util.TestCase):
...
@@ -85,6 +85,9 @@ class CacheTests(ZODB.tests.util.TestCase):
self
.
assertEqual
(
self
.
cache
.
getLastTid
(),
n2
)
self
.
assertEqual
(
self
.
cache
.
getLastTid
(),
n2
)
self
.
cache
.
invalidate
(
n1
,
n3
)
self
.
cache
.
invalidate
(
n1
,
n3
)
self
.
assertEqual
(
self
.
cache
.
getLastTid
(),
n3
)
self
.
assertEqual
(
self
.
cache
.
getLastTid
(),
n3
)
# the cache complains only when it's non-empty
self
.
cache
.
store
(
n1
,
n3
,
None
,
'x'
)
self
.
assertRaises
(
ValueError
,
self
.
cache
.
setLastTid
,
n2
)
self
.
assertRaises
(
ValueError
,
self
.
cache
.
setLastTid
,
n2
)
def
testLoad
(
self
):
def
testLoad
(
self
):
...
@@ -326,6 +329,11 @@ class CacheTests(ZODB.tests.util.TestCase):
...
@@ -326,6 +329,11 @@ class CacheTests(ZODB.tests.util.TestCase):
cache
.
close
()
cache
.
close
()
os
.
remove
(
'cache'
)
os
.
remove
(
'cache'
)
def
testSetAnyLastTidOnEmptyCache
(
self
):
self
.
cache
.
setLastTid
(
p64
(
5
))
self
.
cache
.
setLastTid
(
p64
(
5
))
self
.
cache
.
setLastTid
(
p64
(
3
))
self
.
cache
.
setLastTid
(
p64
(
4
))
__test__
=
dict
(
__test__
=
dict
(
kill_does_not_cause_cache_corruption
=
kill_does_not_cause_cache_corruption
=
...
...
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