Re: [ZODB-Dev] RelStorage pack with history-free storage results in POSKeyErrors

2011-01-28 Thread Chris Withers
On 27/01/2011 11:24, Shane Hathaway wrote:
 On 01/27/2011 03:57 AM, Chris Withers wrote:
 It would also be *really* handy if zodbpack could run off a normal
 zope.conf for both logging and storage config (although, in my case, I'd
 then need to be able to specify which storage to pack, I want to avoid
 packing one of them!)

 Please note that the zodbpack utility is simple, short, and has no extra
 dependencies.  I prefer to keep it that way.  If you want to do
 something more interesting, please fork zodbpack.

Fair enough, simple is good for me :-)
If errors or logging occur inside zodbpack, where do they go?

 However, more than happy to poke, just tell me where and for what...

 Is the problem repeatable?

Yes.

 If you start with the same database twice
 and pack, do you end up with POSKeyErrors on the same OIDs?

Not sure.

 I know
 that's probably a long test to run, but I'm not yet sure what else to
 suggest.

Okay, some more info...

I re-converted the .fs file for this storage.
This time, I've taken a mysqldump backup.

I then packed, and *then* started the batch process: no problems.
While the batch was running, I tried packing again but the pack finished 
without any problems.

Okay, so next up I restored the backup.
This time I set the batch running and *then* started the pack.
This eventually caused the POSKeyErrors to begin again.

I'm going to have a go at knocking up a small batch script that you can 
run to reproduce the issue, but there's definitely an issue here when 
packing while changing lots of data in a ZODB.

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] RelStorage pack with history-free storage results in POSKeyErrors

2011-01-28 Thread Shane Hathaway
On 01/28/2011 02:21 AM, Chris Withers wrote:
 Okay, so next up I restored the backup.
 This time I set the batch running and *then* started the pack.
 This eventually caused the POSKeyErrors to begin again.

 I'm going to have a go at knocking up a small batch script that you can
 run to reproduce the issue, but there's definitely an issue here when
 packing while changing lots of data in a ZODB.

I look forward to your results!

Shane
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] RelStorage, history-free, MySQL - errors

2011-01-28 Thread Chris Withers
Hi Shane,

Okay, so here's the test harness:

svn co https://secure.simplistix.co.uk/svn/relstorage_pack -r 4594

It uses the normal RelStorage test users and databases.

After running the buildout, I do each of the following in their own 
terminal:

bin/generate --zap
bin/zodbpack pack.conf


On 28/01/2011 10:26, Shane Hathaway wrote:
 I'm going to have a go at knocking up a small batch script that you can
 run to reproduce the issue, but there's definitely an issue here when
 packing while changing lots of data in a ZODB.

 I look forward to your results!

I initially had the file size set to 200Kb and everything seemed to be 
behaving as it should.

I dropped the file size to 1kb and tried again, getting the following 
after a short time:

Traceback (most recent call last):
   File bin/generate, line 100, in module
 generate.generate('/home/zope/relstorage_pack/zodb.conf')
   File /home/zope/relstorage_pack/generate.py, line 62, in generate
 app.manage_delObjects([id])
   File 
/var/buildout-eggs/Zope2-2.12.7-py2.6-linux-i686.egg/OFS/ObjectManager.py, 
line 536, in manage_delObjects
 if v.wl_isLocked():
   File 
/var/buildout-eggs/ZODB3-3.9.6-py2.6-linux-i686.egg/ZODB/Connection.py, line 
847, in setstate
 self._setstate(obj)
   File 
/var/buildout-eggs/ZODB3-3.9.6-py2.6-linux-i686.egg/ZODB/Connection.py, line 
897, in _setstate
 p, serial = self._storage.load(obj._p_oid, '')
   File 
/var/buildout-eggs/RelStorage-1.4.0-py2.6.egg/relstorage/storage.py, 
line 448, in load
 state, tid_int = cache.load(cursor, oid_int)
   File 
/var/buildout-eggs/RelStorage-1.4.0-py2.6.egg/relstorage/cache.py, 
line 234, in load
 self._check_tid_after_load(oid_int, actual_tid_int, tid_int)
   File 
/var/buildout-eggs/RelStorage-1.4.0-py2.6.egg/relstorage/cache.py, 
line 187, in _check_tid_after_load
 'thread_ident': thread.get_ident(),
AssertionError: Detected an inconsistency between the RelStorage cache 
and the database while loading an object using the delta_after0 dict. 
Please verify the database is configured for ACID compliance and that 
all clients are using the same commit lock.  (oid_int=2509, 
expect_tid_int=20891637739451L, actual_tid_int=None, 
current_tid=20892026220390L, cp0=20891176006912L, 
cp1=20891176006912L, len(delta_after0)=2376, len(delta_after1)=0, 
pid=6087, thread_ident=-1219049280)

Not the POSKeyError I'm having trouble with, but looks like you might 
want to know ;-)

Could this have anything to do with the POSKeyErrors?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] RelStorage, history-free, pack causes POSKeyError with BTreeFolder2

2011-01-28 Thread Chris Withers
Bingo:

svn co https://secure.simplistix.co.uk/svn/relstorage_pack -r 4595
cd relstorage_pack
python2.6 bootstrap.py
bin/buildout

Then in one terminal:

bin/generate --zap --folder_depth 3

Leave it running for a minute or two, and then in another do:

bin/zodbpack pack.conf

After a bit I get:

Traceback (most recent call last):
   File bin/generate, line 100, in module
 generate.generate('/home/zope/relstorage_pack/zodb.conf')
   File /home/zope/relstorage_pack/generate.py, line 64, in generate
 container.manage_delObjects([path[-1]])
   File 
/var/buildout-eggs/ZODB3-3.9.6-py2.6-linux-i686.egg/ZODB/Connection.py, line 
847, in setstate
 self._setstate(obj)
   File 
/var/buildout-eggs/ZODB3-3.9.6-py2.6-linux-i686.egg/ZODB/Connection.py, line 
897, in _setstate
 p, serial = self._storage.load(obj._p_oid, '')
   File 
/var/buildout-eggs/RelStorage-1.4.0-py2.6.egg/relstorage/storage.py, 
line 462, in load
 raise POSKeyError(oid)
ZODB.POSException.POSKeyError: 0x1675

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] RelStorage, history-free, pack causes POSKeyError with BTreeFolder2

2011-01-28 Thread Chris Withers


On 28 Jan 2011, at 21:58, Jürgen Herrmann juergen.herrm...@xlhost.de wrote:

 On Fri, 28 Jan 2011 12:34:35 +, Chris Withers wrote:
 Bingo:
 
 svn co https://secure.simplistix.co.uk/svn/relstorage_pack -r 4595
 cd relstorage_pack
 python2.6 bootstrap.py
 bin/buildout
 
 Then in one terminal:
 
 bin/generate --zap --folder_depth 3
 
 Leave it running for a minute or two, and then in another do:
 
 bin/zodbpack pack.conf
 
 After a bit I get:
 
 Traceback (most recent call last):
   File bin/generate, line 100, in module
 generate.generate('/home/zope/relstorage_pack/zodb.conf')
   File /home/zope/relstorage_pack/generate.py, line 64, in 
 generate
 container.manage_delObjects([path[-1]])
   File
 
 /var/buildout-eggs/ZODB3-3.9.6-py2.6-linux-i686.egg/ZODB/Connection.py,
 line
 847, in setstate
 self._setstate(obj)
   File
 
 /var/buildout-eggs/ZODB3-3.9.6-py2.6-linux-i686.egg/ZODB/Connection.py,
 line
 897, in _setstate
 p, serial = self._storage.load(obj._p_oid, '')
   File
 
 /var/buildout-eggs/RelStorage-1.4.0-py2.6.egg/relstorage/storage.py,
 line 462, in load
 raise POSKeyError(oid)
 ZODB.POSException.POSKeyError: 0x1675
 
 cheers,
 
 Chris
 
 Afaics you use zodbpack's default of days=0. This is known to produce
 POSKeyErrors if the database is written to while packing. Try with 
 something
 like days=0.1 .
 
 Regards,
 Jürgen
 -- 
 XLhost.de ® - Webhosting von supersmall bis eXtra Large 
 
 XLhost.de GmbH
 Jürgen Herrmann, Geschäftsführer
 Boelckestrasse 21, 93051 Regensburg, Germany
 
 Geschäftsführer: Jürgen Herrmann
 Registriert unter: HRB9918
 Umsatzsteuer-Identifikationsnummer: DE245931218
 
 Fon:  +49 (0)800 XLHOSTDE [0800 95467833]
 Fax:  +49 (0)800 95467830
 Web:  http://www.XLhost.de
 ___
 For more information about ZODB, see the ZODB Wiki:
 http://www.zope.org/Wikis/ZODB/
 
 ZODB-Dev mailing list  -  ZODB-Dev@zope.org
 https://mail.zope.org/mailman/listinfo/zodb-dev
 
 __
 This email has been scanned by the MessageLabs Email Security System.
 For more information please visit http://www.messagelabs.com/email 
 __
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev


Re: [ZODB-Dev] RelStorage, history-free, pack causes POSKeyError with BTreeFolder2

2011-01-28 Thread Shane Hathaway
On 01/28/2011 05:34 AM, Chris Withers wrote:
 bin/generate --zap --folder_depth 3

 Leave it running for a minute or two, and then in another do:

 bin/zodbpack pack.conf

Thanks to this test, I found a serious flaw in the history-free variant 
of packing.  Currently, the history-free and history-preserving variants 
share the fill_object_refs() method, which assumes that it's possible to 
enumerate the references from all objects in a specific transaction. 
However, that assumption is only correct in the history-preserving 
variant.  In history-free storages, object states disappear every time 
they are replaced by a newer version, causing fill_object_refs() to 
think the replaced objects have no references.  That mistake leads to 
garbage collection of too many objects.

I'm surprised that existing tests did not reveal this.  Until I release 
a fix, I recommend not packing history-free databases.

Shane
___
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zodb-dev