Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
2943740a
Commit
2943740a
authored
May 11, 2009
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug Fixed: Deleted records weren't removed when packing file storages.
parent
4ea687c9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
8 deletions
+35
-8
src/CHANGES.txt
src/CHANGES.txt
+8
-0
src/ZEO/tests/testZEO.py
src/ZEO/tests/testZEO.py
+5
-3
src/ZODB/FileStorage/fspack.py
src/ZODB/FileStorage/fspack.py
+5
-1
src/ZODB/tests/IExternalGC.test
src/ZODB/tests/IExternalGC.test
+15
-3
src/ZODB/tests/testFileStorage.py
src/ZODB/tests/testFileStorage.py
+2
-1
No files found.
src/CHANGES.txt
View file @
2943740a
...
...
@@ -2,6 +2,14 @@
Change History
================
3.9.0b2 (2009-05-??)
====================
Bugs Fixed
----------
- Deleted records weren't removed when packing file storages.
3.9.0b1 (2009-05-04)
====================
...
...
src/ZEO/tests/testZEO.py
View file @
2943740a
...
...
@@ -1193,7 +1193,7 @@ class ServerManagingClientStorage(ClientStorage):
def
tpc_abort
(
self
,
id
):
self
.
rpc
.
call
(
'tpc_abort'
,
id
)
def
__init__
(
self
,
name
,
blob_dir
,
shared
=
False
):
def
__init__
(
self
,
name
,
blob_dir
,
shared
=
False
,
extrafsoptions
=
''
):
if
shared
:
server_blob_dir
=
blob_dir
else
:
...
...
@@ -1206,9 +1206,10 @@ class ServerManagingClientStorage(ClientStorage):
blob-dir %s
<filestorage>
path %s
%s
</filestorage>
</blobstorage>
"""
%
(
server_blob_dir
,
name
+
'.fs'
),
"""
%
(
server_blob_dir
,
name
+
'.fs'
,
extrafsoptions
),
port
=
port
,
)
os
.
remove
(
config
)
...
...
@@ -1260,7 +1261,8 @@ def test_suite():
)
zeo
.
addTest
(
PackableStorage
.
IExternalGC_suite
(
lambda
:
ServerManagingClientStorageForIExternalGCTest
(
'data.fs'
,
'blobs'
)
ServerManagingClientStorageForIExternalGCTest
(
'data.fs'
,
'blobs'
,
extrafsoptions
=
'pack-gc false'
)
))
for
klass
in
quick_test_classes
:
zeo
.
addTest
(
unittest
.
makeSuite
(
klass
,
"check"
))
...
...
src/ZODB/FileStorage/fspack.py
View file @
2943740a
...
...
@@ -219,7 +219,11 @@ class GC(FileStorageFormatter):
while
pos
<
end
:
dh
=
self
.
_read_data_header
(
pos
)
self
.
checkData
(
th
,
tpos
,
dh
,
pos
)
self
.
oid2curpos
[
dh
.
oid
]
=
pos
if
dh
.
plen
or
dh
.
back
:
self
.
oid2curpos
[
dh
.
oid
]
=
pos
else
:
if
dh
.
oid
in
self
.
oid2curpos
:
del
self
.
oid2curpos
[
dh
.
oid
]
pos
+=
dh
.
recordlen
()
tlen
=
self
.
_read_num
(
pos
)
...
...
src/ZODB/tests/IExternalGC.test
View file @
2943740a
...
...
@@ -25,6 +25,18 @@ At this point, object 0 and 1 is garbage, but it's still in the storage:
>>> p0, s0 = storage.load(oid0, '')
>>> p1, s1 = storage.load(oid1, '')
The storage is configured not to gc on pack, so even if we pack, these
objects won'
t
go
away
:
>>>
len
(
storage
)
3
>>>
import
time
>>>
db
.
pack
(
time
.
time
()
+
1
)
>>>
len
(
storage
)
3
>>>
p0
,
s0
=
storage
.
load
(
oid0
,
''
)
>>>
p1
,
s1
=
storage
.
load
(
oid1
,
''
)
Now
we
'll use the new deleteObject API to delete the objects. We can'
t
go
through
the
database
to
do
this
,
so
we
'll have to manage the
transaction ourselves.
...
...
@@ -62,11 +74,11 @@ We can still get the data if we load before the time we deleted.
If we pack, however, the old data will be removed and the data will be
gone:
>>> import time
>>> db.pack(time.time()+1)
>>> len(db.storage)
1
>>> time.sleep(1)
>>> time.sleep(.1)
>>> storage.load(oid0, '') # doctest: +ELLIPSIS
Traceback (most recent call last):
...
...
src/ZODB/tests/testFileStorage.py
View file @
2943740a
...
...
@@ -587,7 +587,8 @@ def test_suite():
test_packing
=
True
,
))
suite
.
addTest
(
PackableStorage
.
IExternalGC_suite
(
lambda
:
ZODB
.
FileStorage
.
FileStorage
(
'data.fs'
,
blob_dir
=
'blobs'
)))
lambda
:
ZODB
.
FileStorage
.
FileStorage
(
'data.fs'
,
blob_dir
=
'blobs'
,
pack_gc
=
False
)))
return
suite
if
__name__
==
'__main__'
:
...
...
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