• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zopefoundation / ZODB / 810
84%

Build:
DEFAULT BRANCH: master
Ran 05 Apr 2018 05:19PM UTC
Jobs 4
Files 51
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
810

Pull #183

travis-ci

web-flow
Provide a way to retrieve raw extensions data

Currently when client has IStorageTransactionMetaData instance (e.g. on
storage iteration) it is possible to read transaction's .user and
.description in raw form, but .extension is always returned unpickled.

This creates several problems:

- tools like `zodb dump` [1] cannot dump data exactly as stored on a
  storage. This makes database potentially not bit-to-bit identical to
  its original after restoring from such dump.

- `zodb dump` output could be changing from run to run on the same
  database. This comes from the fact that e.g. python dictionaries are
  unordered and so when pickling a dict back to bytes the result could
  be not the same as original.

  ( this problem can be worked-around partly to work reliably for e.g.
    dict with str keys - by always emitting items in key sorted order,
    but it is hard to make it work reliably for arbitrary types )

Both issues make it hard to verify integrity of database at the lowest
possible level after restoration, and make it hard to verify bit-to-bit
compatibility with non-python ZODB implementations.

To fix we provide a way to retrieve raw extension from transaction
metadata. This is done in backward-compatible way by introducing
new IStorageTransactionMetaDataRaw interface, which may be optionally
provided by an IStorageTransactionMetaData instance, and if so there
will be additional

	.extension_bytes

attribute.

Then ZODB.Connection.TransactionMetaData (the only in-tree
IStorageTransactionMetaData implementer) constructor is extended to see
whether it was given extension in raw form, and if yes, remember it as
.extension_bytes in addition to deserialized .extension dict.

This way storages that now pass raw extension to TransactionMetaData will
automatically provide .extension_bytes in their iterated transactions.

Teach FileStorage & friends to provide/use new functionality.

/helped-by: Jim Fulton.

[1] https://lab.nexedi.com/nexedi/zodbtools
Pull Request #183: Provide a way to retrieve raw extensions data

12 of 12 new or added lines in 3 files covered. (100.0%)

6445 of 8536 relevant lines covered (75.5%)

3.0 hits per line

Jobs
ID Job ID Ran Files Coverage
3 810.3 05 Apr 2018 05:19PM UTC 0
74.77
Travis Job 810.3
4 810.4 05 Apr 2018 05:19PM UTC 0
75.15
Travis Job 810.4
5 810.5 05 Apr 2018 05:19PM UTC 0
75.23
Travis Job 810.5
6 810.6 05 Apr 2018 05:23PM UTC 0
75.16
Travis Job 810.6
Source Files on build 810
  • List 0
  • Changed 14
  • Source Changed 4
  • Coverage Changed 14
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Travis Build #810
  • Pull Request #183
  • PR Base - master (#809)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc