Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
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
Ivan Tyagov
neoppod
Commits
759491bd
Commit
759491bd
authored
Sep 14, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A bug in ZODB may corrupt data when converting back to FileStorage
parent
87bc05eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
neo/scripts/neomigrate.py
neo/scripts/neomigrate.py
+3
-0
neo/tests/functional/testClient.py
neo/tests/functional/testClient.py
+15
-3
No files found.
neo/scripts/neomigrate.py
View file @
759491bd
...
@@ -57,6 +57,9 @@ def main(args=None):
...
@@ -57,6 +57,9 @@ def main(args=None):
src
=
FileStorage
(
file_name
=
source
)
src
=
FileStorage
(
file_name
=
source
)
dst
=
NEOStorage
(
master_nodes
=
destination
,
name
=
cluster
)
dst
=
NEOStorage
(
master_nodes
=
destination
,
name
=
cluster
)
else
:
else
:
print
(
"WARNING: due to a bug in FileStorage (at least up to ZODB trunk"
"@121629), output database may be corrupted if input database is"
" not packed."
)
src
=
NEOStorage
(
master_nodes
=
source
,
name
=
cluster
)
src
=
NEOStorage
(
master_nodes
=
source
,
name
=
cluster
)
dst
=
FileStorage
(
file_name
=
destination
)
dst
=
FileStorage
(
file_name
=
destination
)
...
...
neo/tests/functional/testClient.py
View file @
759491bd
...
@@ -173,10 +173,18 @@ class ClientTests(NEOFunctionalTest):
...
@@ -173,10 +173,18 @@ class ClientTests(NEOFunctionalTest):
db
=
ZODB
.
DB
(
storage
=
storage
)
db
=
ZODB
.
DB
(
storage
=
storage
)
return
(
db
,
storage
)
return
(
db
,
storage
)
def
__populate
(
self
,
db
,
tree_size
=
TREE_SIZE
):
def
__populate
(
self
,
db
,
tree_size
=
TREE_SIZE
,
filestorage_bug
=
True
):
conn
=
db
.
open
()
conn
=
db
.
open
()
root
=
conn
.
root
()
root
=
conn
.
root
()
root
[
'trees'
]
=
Tree
(
tree_size
)
root
[
'trees'
]
=
Tree
(
tree_size
)
if
filestorage_bug
:
ob
=
root
[
'trees'
].
right
left
=
ob
.
left
del
ob
.
left
transaction
.
commit
()
ob
.
_p_changed
=
1
transaction
.
commit
()
ob
.
left
=
left
transaction
.
commit
()
transaction
.
commit
()
conn
.
close
()
conn
.
close
()
...
@@ -197,12 +205,12 @@ class ClientTests(NEOFunctionalTest):
...
@@ -197,12 +205,12 @@ class ClientTests(NEOFunctionalTest):
(
neo_db
,
neo_conn
)
=
self
.
neo
.
getZODBConnection
()
(
neo_db
,
neo_conn
)
=
self
.
neo
.
getZODBConnection
()
self
.
__checkTree
(
neo_conn
.
root
()[
'trees'
])
self
.
__checkTree
(
neo_conn
.
root
()[
'trees'
])
def
testExport
(
self
):
def
testExport
(
self
,
filestorage_bug
=
False
):
# create a neo storage
# create a neo storage
self
.
neo
.
start
()
self
.
neo
.
start
()
(
neo_db
,
neo_conn
)
=
self
.
neo
.
getZODBConnection
()
(
neo_db
,
neo_conn
)
=
self
.
neo
.
getZODBConnection
()
self
.
__populate
(
neo_db
)
self
.
__populate
(
neo_db
,
filestorage_bug
=
filestorage_bug
)
# copy neo to data fs
# copy neo to data fs
dfs_db
,
dfs_storage
=
self
.
__getDataFS
(
reset
=
True
)
dfs_db
,
dfs_storage
=
self
.
__getDataFS
(
reset
=
True
)
...
@@ -215,6 +223,10 @@ class ClientTests(NEOFunctionalTest):
...
@@ -215,6 +223,10 @@ class ClientTests(NEOFunctionalTest):
self
.
__checkTree
(
root
[
'trees'
])
self
.
__checkTree
(
root
[
'trees'
])
def
testExportFileStorageBug
(
self
):
# currently fails due to a bug in ZODB.FileStorage
self
.
testExport
(
True
)
def
testLockTimeout
(
self
):
def
testLockTimeout
(
self
):
""" Hold a lock on an object to block a second transaction """
""" Hold a lock on an object to block a second transaction """
def
test
():
def
test
():
...
...
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