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

zopefoundation / ZODB / 1009
84%

Build:
DEFAULT BRANCH: master
Ran 31 Mar 2020 02:08PM UTC
Jobs 6
Files 51
Run time 4min
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
1009

push

travis-ci

jmuchemb
FileStorage: Save committed transaction to disk even if changed data is empty

ZODB tries to avoid saving empty transactions to storage on
`transaction.commit()`. The way it works is: if no objects were changed
during ongoing transaction, ZODB.Connection does not join current
TransactionManager, and transaction.commit() performs two-phase commit
protocol only on joined DataManagers. In other words if no objects were
changed, no tpc_*() methods are called at all on ZODB.Connection at
transaction.commit() time.

This way application servers like Zope/ZServer/ERP5/... can have
something as

    try:
        # process incoming request
        transaction.commit()    # processed ok
    except:
        transaction.abort()
        # problem: log + reraise

in top-level code to process requests without creating many on-disk
transactions with empty data changes just because read-only requests
were served.

Everything is working as intended.

However at storage level, FileStorage currently also checks whether
transaction that is being committed also comes with empty data changes,
and _skips_ saving transaction into disk *at all* for such cases, even
if it has been explicitly told to commit the transaction via two-phase
commit protocol calls done at storage level.

This creates the situation, where contrary to promise in
ZODB/interfaces.py(*), after successful tpc_begin/tpc_vote/tpc_finish()
calls made at storage level, transaction is _not_ made permanent,
despite tid of "committed" transaction being returned to caller. In other
words FileStorage, when asked to commit a transaction, even if one with
empty data changes, reports "ok" and gives transaction ID to the caller,
without creating corresponding transaction record on disk.

This behaviour is

a) redundant to application-level avoidance to create empty transaction
   on storage described in the beginning, and

b) creates problems:

The first problem is that application that works at storage-level might
be i... (continued)

8 of 8 new or added lines in 1 file covered. (100.0%)

6494 of 8553 relevant lines covered (75.93%)

4.53 hits per line

Jobs
ID Job ID Ran Files Coverage
1 1009.1 31 Mar 2020 02:08PM UTC 0
74.52
Travis Job 1009.1
2 1009.2 31 Mar 2020 02:08PM UTC 0
75.57
Travis Job 1009.2
3 1009.3 31 Mar 2020 02:09PM UTC 0
75.57
Travis Job 1009.3
4 1009.4 31 Mar 2020 02:08PM UTC 0
75.57
Travis Job 1009.4
5 1009.5 31 Mar 2020 02:08PM UTC 0
75.66
Travis Job 1009.5
8 1009.8 (PURE_PYTHON=1) 31 Mar 2020 02:12PM UTC 0
75.63
Travis Job 1009.8
Source Files on build 1009
  • List 0
  • Changed 22
  • Source Changed 1
  • Coverage Changed 22
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Travis Build #1009
  • bb9bf539 on github
  • Prev Build on master (#1007)
  • Next Build on master (#1029)
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