[Zope-dev] Re: [ZODB-Dev] Re: [Bug] ZODB invalidation processing

2007-05-31 Thread Dieter Maurer
Joachim Schmitz wrote at 2007-5-31 12:07 +0200:
 ...
2007-05-31 09:45:06 INFO Skins.create_level A923157 finished to create 
level 200
Now the conflict error, look at the transaction start-time, this is 
before the restart of zope !!

You are probably tricked out here: the serials are in fact UTC timestamps.
I am not sure but it may well be that the times shown for the serials
are UTC (GMT +0) and not local times.



-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [ZODB-Dev] Re: [Bug] ZODB invalidation processing

2007-05-31 Thread Perry

Dieter Maurer schrieb:

Joachim Schmitz wrote at 2007-5-31 12:07 +0200:

...
2007-05-31 09:45:06 INFO Skins.create_level A923157 finished to create 
level 200
Now the conflict error, look at the transaction start-time, this is 
before the restart of zope !!





You are probably tricked out here: the serials are in fact UTC timestamps.
I am not sure but it may well be that the times shown for the serials
are UTC (GMT +0) and not local times.


I added 2 hours to the txn times and only looked at minutes.

so the observation is still true.

--

Gruß Joachim

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [ZODB-Dev] Re: [Bug] ZODB invalidation processing

2007-05-30 Thread Joachim Schmitz

Andreas Jung schrieb:



--On 28. Mai 2007 21:12:13 +0200 Andreas Jung [EMAIL PROTECTED] wrote:




--On 28. Mai 2007 20:03:47 +0200 Joachim Schmitz [EMAIL PROTECTED] 
wrote:



Joachim Schmitz schrieb:
ConflictError: database conflict error (oid 0x7fd771, class
BTrees._IOBTree.IOBucket, serial this txn started with 
0x036deefe18489244
2007-05-28 17:34:05.691441, serial currently committed 
0x036def009207e011

2007-05-28 17:36:34.225960)
--

How can I find out, which objects are really involved in the conflict.


from ZODB.utils import p64
print app._p_jar[p64(some_oid)]

The oid is available from the traceback. If you are running ZEO it might
be necessary to replace 'app' with the top-level (or some other object)
of the related storage (might be tricky to figure out if you have
multiple storages).


Another trick that helped me lately to identify the reason for conflict 
errors was to implement the _p_resolveConflict() hook as method of the 
related class having the conflict.


How would I do that for the Class _IOBTree, which is in a c-module ?


--
Gruß Joachim

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [ZODB-Dev] Re: [Bug] ZODB invalidation processing

2007-05-29 Thread Dieter Maurer
Joachim Schmitz wrote at 2007-5-28 17:45 +0200:
In ZODB.Connection.Connection.open I see:

 if self._reset_counter != global_reset_counter:
 # New code is in place.  Start a new cache.
 self._resetCache()
 else:
 self._flush_invalidations()

So self._flush_invalidations() is only called in the else-condition.
In your patch it is always called. I try your version and report back.

As almost always self._reset_counter == global_reset_counter
and _resetCache effectively flushes the cache, the change is *VERY* unlikely
to affect what you see with respect to conflict errors.


-- 
Dieter
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [ZODB-Dev] Re: [Bug] ZODB invalidation processing

2007-05-28 Thread Joachim Schmitz

Joachim Schmitz schrieb:

Hi Dieter,

thanks for this hint.

Dieter Maurer schrieb:

Perry wrote at 2007-5-25 13:16 +0200:

database conflict error (oid 0x7905e6, class BTrees._IOBTree.IOBucket,
serial this txn started with 0x036ddc2a44454dee 2007-05-25
09:14:16.000950, serial currently committed 0x036ddc2c21950377
2007-05-25 09:16:07.870801) (80 conflicts (10 unresolved) since startup
at Fri May 25 05:19:08 2007)


In our private Zope version, I have still a note like this:

# DM 2005-08-22: always call '_flush_invalidations' as it does
#  more than cache handling only
self._flush_invalidations()
if self._reset_counter != global_reset_counter:
# New code is in place.  Start a new cache.
self._resetCache()
# DM 2005-08-22: always call '_flush_invalidations'
##else:
##self._flush_invalidations()

The note indicates that the bug was fixed at least at 2005-08-22
(though the handling was not completely right in case the cache
was reset).

In ZODB.Connection.Connection.open I see:

if self._reset_counter != global_reset_counter:
# New code is in place.  Start a new cache.
self._resetCache()
else:
self._flush_invalidations()

So self._flush_invalidations() is only called in the else-condition.
In your patch it is always called. I try your version and report back.

I patched the ZODB to always do the self._flush_invalidations(). But 
that didn't change anything, and after looking at the code it couldn't 
cause it was already always called.


here again is the history of a conflict error for one user which finally 
fails:
2007-05-28T18:32:12 INFO ZPublisher.Conflict ConflictError at 
/VirtualHostBase/http/uniben.waeup.org:80/uniben/VirtualHostRoot/campus/students/V659242/study_course/create_level: 
database conflict error (oid 0x7fd771, class BTrees._IOBTree.IOBucket, 
serial this txn started with 0x036deefb352fd600 2007-05-28 
17:31:12.465670, serial currently committed 0x036deefb9aa4d733 
2007-05-28 17:31:36.244666) (34 conflicts (4 unresolved) since startup 
at Mon May 28 17:41:55 2007)
2007-05-28T18:32:44 INFO ZPublisher.Conflict ConflictError at 
/VirtualHostBase/http/uniben.waeup.org:80/uniben/VirtualHostRoot/campus/students/V659242/study_course/create_level: 
database conflict error (oid 0x7fd771, class BTrees._IOBTree.IOBucket, 
serial this txn started with 0x036deefb9aa4d733 2007-05-28 
17:31:36.244666, serial currently committed 0x036deefc2e4ff122 
2007-05-28 17:32:10.854439) (35 conflicts (4 unresolved) since startup 
at Mon May 28 17:41:55 2007)
2007-05-28T18:33:15 INFO Skins.create_level V659242 finished to create 
level 1002007-05-28T18:34:29 INFO ZPublisher.Conflict ConflictError at 
/VirtualHostBase/http/uniben.waeup.org:80/uniben/VirtualHostRoot/campus/students/V659242/study_course/create_level: 
database conflict error (oid 0x7fd771, class BTrees._IOBTree.IOBucket, 
serial this txn started with 0x036deefc2e4ff122 2007-05-28 
17:32:10.854439, serial currently committed 0x036deefe18489244 
2007-05-28 17:34:05.691441) (36 conflicts (4 unresolved) since startup 
at Mon May 28 17:41:55 2007)
2007-05-28T18:35:21 INFO Skins.create_level V659242 finished to create 
level 1002007-05-28T18:38:36 INFO ZPublisher.Conflict ConflictError at 
/VirtualHostBase/http/uniben.waeup.org:80/uniben/VirtualHostRoot/campus/students/V659242/study_course/create_level: 
database conflict error (oid 0x7fd771, class BTrees._IOBTree.IOBucket, 
serial this txn started with 0x036deefe18489244 2007-05-28 
17:34:05.691441, serial currently committed 0x036def009207e011 
2007-05-28 17:36:34.225960) (42 conflicts (4 unresolved) since startup 
at Mon May 28 17:41:55 2007)


--
2007-05-28T18:38:36 ERROR Zope.SiteErrorLog 
http://uniben.waeup.org/campus/students/V659242/study_course/create_level

Traceback (innermost last):
  Module Zope2.App.startup, line 173, in zpublisher_exception_hook
  Module ZPublisher.Publish, line 121, in publish
  Module Zope2.App.startup, line 240, in commit
  Module transaction._manager, line 96, in commit
  Module Products.CPSCompat.PatchZODBTransaction, line 175, in commit
  Module transaction._transaction, line 436, in _commitResources
  Module ZODB.Connection, line 665, in tpc_vote
  Module ZEO.ClientStorage, line 893, in tpc_vote
  Module ZEO.ClientStorage, line 877, in _check_serials
ConflictError: database conflict error (oid 0x7fd771, class 
BTrees._IOBTree.IOBucket, serial this txn started with 
0x036deefe18489244 2007-05-28 17:34:05.691441, serial currently 
committed 0x036def009207e011 2007-05-28 17:36:34.225960)

--

How can I find out, which objects are really involved in the conflict.


--
Gruß Joachim

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce


[Zope-dev] Re: [ZODB-Dev] Re: [Bug] ZODB invalidation processing

2007-05-28 Thread Andreas Jung



--On 28. Mai 2007 20:03:47 +0200 Joachim Schmitz [EMAIL PROTECTED] wrote:


Joachim Schmitz schrieb:
ConflictError: database conflict error (oid 0x7fd771, class
BTrees._IOBTree.IOBucket, serial this txn started with 0x036deefe18489244
2007-05-28 17:34:05.691441, serial currently committed 0x036def009207e011
2007-05-28 17:36:34.225960)
--

How can I find out, which objects are really involved in the conflict.


from ZODB.utils import p64
print app._p_jar[p64(some_oid)]

The oid is available from the traceback. If you are running ZEO it might be 
necessary to replace 'app' with the top-level (or some other object) of the 
related storage (might be tricky to figure out if you have multiple 
storages).


-aj

pgp2dg2Rm3pMf.pgp
Description: PGP signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [ZODB-Dev] Re: [Bug] ZODB invalidation processing

2007-05-28 Thread Andreas Jung



--On 28. Mai 2007 21:12:13 +0200 Andreas Jung [EMAIL PROTECTED] wrote:




--On 28. Mai 2007 20:03:47 +0200 Joachim Schmitz [EMAIL PROTECTED] wrote:


Joachim Schmitz schrieb:
ConflictError: database conflict error (oid 0x7fd771, class
BTrees._IOBTree.IOBucket, serial this txn started with 0x036deefe18489244
2007-05-28 17:34:05.691441, serial currently committed 0x036def009207e011
2007-05-28 17:36:34.225960)
--

How can I find out, which objects are really involved in the conflict.


from ZODB.utils import p64
print app._p_jar[p64(some_oid)]

The oid is available from the traceback. If you are running ZEO it might
be necessary to replace 'app' with the top-level (or some other object)
of the related storage (might be tricky to figure out if you have
multiple storages).


Another trick that helped me lately to identify the reason for conflict 
errors was to implement the _p_resolveConflict() hook as method of the 
related class having the conflict.



-aj

pgp5nrM10XbSx.pgp
Description: PGP signature
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )