"invalidations out of order" when committing a blob in ZODB 3.8.5

Bug #509801 reported by David Glick
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
ZODB
Fix Released
High
Jim Fulton

Bug Description

We're occasionally getting the following traceback when committing a transaction including a new blob, using ZODB 3.8.5.

Traceback (innermost last):
  Module ZPublisher.Publish, line 125, in publish
  Module Zope2.App.startup, line 238, in commit
  Module transaction._manager, line 93, in commit
  Module transaction._transaction, line 325, in commit
  Module transaction._transaction, line 424, in _commitResources
  Module ZODB.Connection, line 540, in commit
  Module ZODB.Connection, line 1140, in _commit_savepoint
  Module ZODB.Connection, line 336, in invalidate
AssertionError: invalidations out of order, None < '\x03\x83k\xd8\xcb4b\x99'

Can you provide more information on what causes this exception so that I can determine whether it is a ZODB issue or an app issue? I see from http://svn.zope.org/ZODB/branches/3.8/?view=rev&rev=106543 that this AssertionError was added for 3.8.5, so wanted to be sure to call it to your attention in case it's a new issue.

Revision history for this message
Jim Fulton (jim-zope) wrote : Re: [Bug 509801] [NEW] "invalidations out of order" when committing a blob in ZODB 3.8.5

On Tue, Jan 19, 2010 at 2:32 PM, David Glick <email address hidden> wrote:
> Public bug reported:
>
> We're occasionally getting the following traceback when committing a
> transaction including a new blob, using ZODB 3.8.5.
>
> Traceback (innermost last):
>  Module ZPublisher.Publish, line 125, in publish
>  Module Zope2.App.startup, line 238, in commit
>  Module transaction._manager, line 93, in commit
>  Module transaction._transaction, line 325, in commit
>  Module transaction._transaction, line 424, in _commitResources
>  Module ZODB.Connection, line 540, in commit
>  Module ZODB.Connection, line 1140, in _commit_savepoint
>  Module ZODB.Connection, line 336, in invalidate
> AssertionError: invalidations out of order, None < '\x03\x83k\xd8\xcb4b\x99'

Interesting.

> Can you provide more information on what causes this exception so that I
> can determine whether it is a ZODB issue or an app issue?

I'm sure it is a ZODB issue. I'll have to dig into it.

> I see from
> http://svn.zope.org/ZODB/branches/3.8/?view=rev&rev=106543 that this
> AssertionError was added for 3.8.5, so wanted to be sure to call it to
> your attention in case it's a new issue.

Yup. Thanks.

Jim

--
Jim Fulton

Revision history for this message
Graham Perrin (grahamperrin-gmail) wrote :

I noted
AssertionError: invalidations out of order, None
around 12 January; <http://n2.nabble.com/-tp4291640p4291640.html>

Revision history for this message
Martijn Jacobs (martijn-fourdigits) wrote :

I can confirm this behaviour with ZODB 3.8.5 with blob storage enabled. The problem goes away when using ZODB 3.8.4.

Revision history for this message
Hanno Schlichting (hannosch) wrote :

I have seen the same behavior in a site of ours.

Changed in zodb:
status: New → Confirmed
Revision history for this message
Christian Zagrodnick (zagy) wrote :

I also see this with ZODB 3.9.4 but not with ZODB 3.9.3

Jim Fulton (jim-zope)
Changed in zodb:
importance: Undecided → High
Revision history for this message
Christian Zagrodnick (zagy) wrote :

Any update on this? Can I help somehow?

Revision history for this message
Jim Fulton (jim-zope) wrote : Re: [Bug 509801] Re: "invalidations out of order" when committing a blob in ZODB 3.8.5

On Fri, Jun 11, 2010 at 5:31 AM, Christian Zagrodnick <email address hidden> wrote:
> Any update on this?

No. I don't consider this a burning priority. I'm just glad I added the
assertion. The transaction fails, rather than causing database
inconsistency.

> Can I help somehow?

Obviously, figuring out how to reproduce this would be
wildly helpful. :)

Jim

--
Jim Fulton

Revision history for this message
Christian Zagrodnick (zagy) wrote :

I added a test case to svn+ssh://svn.zope.org/repos/main/ZODB/branches/zagy-lp509801 (test -t savepoint_commit)

It works in

BlobAdaptedFileStorageBlobTests
BlobFileStorageBlobTests
MVCCMappingBlobTests

It is broken in:

ClientStorageNonSharedBlobsBlobTests
ClientStorageSharedBlobsBlobTests

The problem seems to be that the savepoint_storage._tid is None (storeBlob returns self._tid). But I don't know what that means or if that's good or bad ;)

Does that help a bit, Jim?

Revision history for this message
Jim Fulton (jim-zope) wrote :

On Fri, Jun 11, 2010 at 10:49 AM, Christian Zagrodnick <email address hidden> wrote:
> I added a test case to svn+ssh://svn.zope.org/repos/main/ZODB/branches
> /zagy-lp509801 (test -t savepoint_commit)
>
> It works in
>
> BlobAdaptedFileStorageBlobTests
> BlobFileStorageBlobTests
> MVCCMappingBlobTests
>
> It is broken in:
>
> ClientStorageNonSharedBlobsBlobTests
> ClientStorageSharedBlobsBlobTests
>
> The problem seems to be that the savepoint_storage._tid is None
> (storeBlob returns self._tid). But I don't know what that means  or if
> that's good or bad ;)
>
> Does that help a bit, Jim?

It should help a lot. Thanks!

Jim

--
Jim Fulton

Revision history for this message
Christian Zagrodnick (zagy) wrote :

Christian Theune volunteered do fix that.

Changed in zodb:
assignee: nobody → Christian Theune (ct-gocept)
Revision history for this message
Jim Fulton (jim-zope) wrote :

On Mon, Jun 14, 2010 at 3:45 AM, Christian Zagrodnick <email address hidden> wrote:
> Christian Theune volunteered do fix that.

Cool. I want to review the fix before it is committed to trunk.

Jim

--
Jim Fulton

Revision history for this message
Christian Theune (ctheune) wrote :

Ok. Looking at the code it seems like invalidate() is called explicitly without needing to know the serial but we simply need to ensure to satisfy the guard.

I made a fix on Zagy's branch in revision 113519.

Jim: can you review?

Changed in zodb:
assignee: Christian Theune (ct-gocept) → Jim Fulton (jim-zope)
status: Confirmed → In Progress
Revision history for this message
Christian Zagrodnick (zagy) wrote :

Jim, would you have a look at it?

Revision history for this message
Jim Fulton (jim-zope) wrote :

On Mon, Jun 21, 2010 at 10:54 AM, Christian Zagrodnick <email address hidden> wrote:
> Jim, would you have a look at it?

Absolutely. I just haven't gotten to it yet.

Jim

--
Jim Fulton

Revision history for this message
Harald Friessnegger (frisi) wrote :

i do have a couple of these errors in the error_log of a plone4.0 portal as well. today it lead to objects not beeing addable to a folder until i restarted the instance.

as there seems to be a fix for this already it would be great if it gets reviewed and released soon so it can be included in the next zope 2.12.X release.

Jim Fulton (jim-zope)
Changed in zodb:
status: In Progress → Fix Committed
Changed in zodb:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.