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
nexedi
ZODB
Commits
c9726cb5
Commit
c9726cb5
authored
Jul 28, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Plain Diff
Merge 4.x branch
parents
f371a71c
a2da8235
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
17 deletions
+34
-17
CHANGES.rst
CHANGES.rst
+10
-1
src/ZODB/ConflictResolution.py
src/ZODB/ConflictResolution.py
+6
-3
src/ZODB/fstools.py
src/ZODB/fstools.py
+7
-2
src/ZODB/scripts/fstail.py
src/ZODB/scripts/fstail.py
+2
-2
src/ZODB/scripts/tests/fstail.txt
src/ZODB/scripts/tests/fstail.txt
+2
-2
src/ZODB/scripts/tests/test_doc.py
src/ZODB/scripts/tests/test_doc.py
+4
-4
src/ZODB/tests/TransactionalUndoStorage.py
src/ZODB/tests/TransactionalUndoStorage.py
+3
-3
No files found.
CHANGES.rst
View file @
c9726cb5
...
...
@@ -56,7 +56,16 @@ Concurrency Control (MVCC) implementation:
This change allows server-nased storages like ZEO and NEO to be
implemented more simply and cleanly.
4.4.2 (unreleased)
4.4.3 (unreleased)
==================
- Internal FileStorage-undo fixes that should allow undo in some cases
where it didn't work before.
- fstail: print the txn offset and header size, instead of only the data offset.
fstail can now be used to truncate a DB at the right offset.
4.4.2 (2016-07-08)
==================
Better support of the new commit protocol. This fixes issues with blobs and
...
...
src/ZODB/ConflictResolution.py
View file @
c9726cb5
...
...
@@ -18,7 +18,8 @@ import six
import
zope.interface
from
ZODB.POSException
import
ConflictError
from
ZODB.loglevels
import
BLATHER
from
ZODB._compat
import
BytesIO
,
PersistentUnpickler
,
PersistentPickler
,
_protocol
from
ZODB._compat
import
(
BytesIO
,
PersistentUnpickler
,
PersistentPickler
,
_protocol
)
# Subtle: Python 2.x has pickle.PicklingError and cPickle.PicklingError,
# and these are unrelated classes! So we shouldn't use pickle.PicklingError,
...
...
@@ -71,7 +72,8 @@ def state(self, oid, serial, prfactory, p=''):
p
=
p
or
self
.
loadSerial
(
oid
,
serial
)
p
=
self
.
_crs_untransform_record_data
(
p
)
file
=
BytesIO
(
p
)
unpickler
=
PersistentUnpickler
(
find_global
,
prfactory
.
persistent_load
,
file
)
unpickler
=
PersistentUnpickler
(
find_global
,
prfactory
.
persistent_load
,
file
)
unpickler
.
load
()
# skip the class tuple
return
unpickler
.
load
()
...
...
@@ -239,7 +241,8 @@ def tryToResolveConflict(self, oid, committedSerial, oldSerial, newpickle,
prfactory
=
PersistentReferenceFactory
()
newpickle
=
self
.
_crs_untransform_record_data
(
newpickle
)
file
=
BytesIO
(
newpickle
)
unpickler
=
PersistentUnpickler
(
find_global
,
prfactory
.
persistent_load
,
file
)
unpickler
=
PersistentUnpickler
(
find_global
,
prfactory
.
persistent_load
,
file
)
meta
=
unpickler
.
load
()
if
isinstance
(
meta
,
tuple
):
klass
=
meta
[
0
]
...
...
src/ZODB/fstools.py
View file @
c9726cb5
...
...
@@ -67,9 +67,14 @@ class TxnHeader:
self
.
_ext
=
self
.
_file
.
read
(
self
.
ext_len
)
self
.
ext
=
loads
(
self
.
_ext
)
def
get_offset
(
self
):
return
self
.
_pos
def
__len__
(
self
):
return
TRANS_HDR_LEN
+
self
.
user_len
+
self
.
descr_len
+
self
.
ext_len
def
get_data_offset
(
self
):
return
(
self
.
_pos
+
TRANS_HDR_LEN
+
self
.
user_len
+
self
.
descr_len
+
self
.
ext_len
)
return
self
.
_pos
+
len
(
self
)
def
get_timestamp
(
self
):
return
TimeStamp
(
self
.
tid
)
...
...
src/ZODB/scripts/fstail.py
View file @
c9726cb5
...
...
@@ -36,8 +36,8 @@ def main(path, ntxn):
th
.
read_meta
()
print
(
"%s: hash=%s"
%
(
th
.
get_timestamp
(),
binascii
.
hexlify
(
hash
).
decode
()))
print
((
"user=%r description=%r length=%d offset=%d"
%
(
th
.
user
,
th
.
descr
,
th
.
length
,
th
.
get_
data_offset
(
))))
print
((
"user=%r description=%r length=%d offset=%d
(+%d)
"
%
(
th
.
user
,
th
.
descr
,
th
.
length
,
th
.
get_
offset
(),
len
(
th
))))
print
()
th
=
th
.
prev_txn
()
i
-=
1
...
...
src/ZODB/scripts/tests/fstail.txt
View file @
c9726cb5
...
...
@@ -24,10 +24,10 @@ Now lets have a look at the last transactions of this FileStorage:
>>> from ZODB.scripts.fstail import main
>>> main(storagefile, 5)
2007-11-10 15:18:48.543001: hash=b16422d09fabdb45d4e4325e4b42d7d6f021d3c3
user='' description='' length=132 offset=1
85
user='' description='' length=132 offset=1
62 (+23)
<BLANKLINE>
2007-11-10 15:18:48.543001: hash=b16422d09fabdb45d4e4325e4b42d7d6f021d3c3
user='' description='initial database creation' length=150 offset=
52
user='' description='initial database creation' length=150 offset=
4 (+48)
<BLANKLINE>
Now clean up the storage again:
...
...
src/ZODB/scripts/tests/test_doc.py
View file @
c9726cb5
...
...
@@ -29,13 +29,13 @@ checker = zope.testing.renormalizing.RENormalizing([
# Python 3 produces larger pickles, even when we use zodbpickle :(
# this changes all the offsets and sizes in fstail.txt
(
re
.
compile
(
"user='' description='' "
"length=[0-9]+ offset=[0-9]+"
),
"length=[0-9]+ offset=[0-9]+
\
(
\
+23
\
)
"
),
"
user
=
''
description
=
''
"
"length=<LENGTH> offset=<OFFSET>"
),
"
length
=<
LENGTH
>
offset
=<
OFFSET
>
(
+
23
)
"),
(re.compile("
user
=
''
description
=
'initial database creation'
"
"length=[0-9]+ offset=
[0-9]+
"
),
"
length
=
[
0
-
9
]
+
offset
=
4
\
(
\
+
48
\
)
"),
"
user
=
''
description
=
'initial database creation'
"
"length=<
<LENGTH> offset=<OFFSET>
"
),
"
length
=<
LENGTH
>
offset
=
4
(
+
48
)
"),
])
def test_suite():
...
...
src/ZODB/tests/TransactionalUndoStorage.py
View file @
c9726cb5
...
...
@@ -619,9 +619,9 @@ class TransactionalUndoStorage:
tid
=
p64
(
i
+
1
)
eq
(
txn
.
tid
,
tid
)
L1
=
[(
rec
.
oid
,
rec
.
tid
,
rec
.
data_txn
)
for
rec
in
txn
]
L2
=
[
(
oid
,
revid
,
None
)
for
_tid
,
oid
,
revid
in
orig
if
_tid
==
tid
]
L1
=
{(
rec
.
oid
,
rec
.
tid
,
rec
.
data_txn
)
for
rec
in
txn
}
L2
=
{
(
oid
,
revid
,
None
)
for
_tid
,
oid
,
revid
in
orig
if
_tid
==
tid
}
eq
(
L1
,
L2
)
...
...
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