Re: ConflictError debugging?

Etienne Robillard <[email protected]> Sat, 30 Jun 2018 14:11:49 -0400
Newsgroups gmane.comp.web.zope.zodb
Organization Isotope Software
Message-ID <[email protected]>
Hi,

Le 2018-06-30 à 12:45, Alan Runyan a écrit :
> i think Persistent Mapping doesn’t support conflict resolution. use a 
> BTree instead.


Really not sure how to do that! :-)

All I know is the schevo.backends.zodb.ZodbBackend class handles the 
connection to ClientStorage and then commit to database any pending 
transactions (?):

def commit(self):
     transaction.commit()

Note that in DurusBackend the commit method of the class is slightly 
different:

def commit(self):
     self.conn.commit()

However I cannot yet just call self.conn.commit() with ZodbBackend since 
Connection.commit requires a transaction as first argument...

Kind regards,

Etienne



> On Sat, Jun 30, 2018 at 08:52 Etienne Robillard <[email protected] 
> <mailto:[email protected]>> wrote:
> 
>     Hello,
> 
>     Can someone please tell me what is going on here?
> 
> 
>     INFO:[('127.0.0.1', 4343)] ClientStorage (pid=5766) created RW/normal
>     for storage: '1'
>     INFO:created temporary cache file '<fdopen>'
>     DEBUG:Using selector: PollSelector
>     DEBUG:disconnected <ZEO.asyncio.client.Client object at 0xb3578ed0> None
>     DEBUG:try_connecting
>     INFO:Connected Protocol(('127.0.0.1', 4343), '1', 0)
>     INFO:[('127.0.0.1', 4343)] Connected to storage: ('localhost', 4343)
>     DEBUG:new transaction
>     DEBUG:commit
>     DEBUG:new transaction
>     DEBUG:commit
>     INFO:[('127.0.0.1', 4343)] ClientStorage (pid=5766) created RW/normal
>     for storage: '1'
>     INFO:created temporary cache file '<fdopen>'
>     DEBUG:Using selector: PollSelector
>     DEBUG:disconnected <ZEO.asyncio.client.Client object at 0xb35528d0> None
>     DEBUG:try_connecting
>     INFO:Connected Protocol(('127.0.0.1', 4343), '1', 0)
>     INFO:[('127.0.0.1', 4343)] Connected to storage: ('localhost', 4343)
>     DEBUG:new transaction
>     DEBUG:commit
>     DEBUG:new transaction
>     DEBUG:commit
>     DEBUG:new transaction
>     DEBUG:commit <Connection at 0945fb70>
>     DEBUG:commit
>     DEBUG:Initialized ZODB instance: <Database u'127.0.0.1:4343
>     <http://127.0.0.1:4343>' :: V 0>
>     INFO:[('127.0.0.1', 4545)] ClientStorage (pid=5766) created RW/normal
>     for storage: '1'
>     INFO:created temporary cache file '<fdopen>'
>     DEBUG:Using selector: PollSelector
>     DEBUG:disconnected <ZEO.asyncio.client.Client object at 0x09111150> None
>     DEBUG:try_connecting
>     INFO:Connected Protocol(('127.0.0.1', 4545), '1', 0)
>     INFO:[('127.0.0.1', 4545)] Connected to storage: ('localhost', 4545)
>     DEBUG:new transaction
>     DEBUG:commit
>     DEBUG:new transaction
>     DEBUG:commit
>     DEBUG:new transaction
>     DEBUG:commit <Connection at 09115770>
>     DEBUG:commit
>     DEBUG:Initialized ZODB instance: <Database u'127.0.0.1:4545
>     <http://127.0.0.1:4545>' :: V 30>
>     DEBUG:Initialized ZODB connections: {'db_default': <Database
>     u'127.0.0.1:4343 <http://127.0.0.1:4343>' :: V 0>, 'db_blog':
>     <Database u'127.0.0.1:4545 <http://127.0.0.1:4545>' :: V 30>}
>     DEBUG:new transaction
>     DEBUG:commit <Connection at b34dee10>
>     libschevo 4.0.2 :: Database Activities :: Update Database
> 
>     Opening database...
>     Current database version is 0.
>     Syncing database with new schema source...
>     db_default
>     db_blog
>     Traceback (most recent call last):
>         File "/usr/local/pypy/bin/schevo", line 11, in <module>
>           load_entry_point('libschevo', 'console_scripts', 'schevo')()
>         File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
>     32, in __call__
>           return self.main(arg0, args)
>         File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
>     74, in main
>           return command()(*args)
>         File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
>     32, in __call__
>           return self.main(arg0, args)
>         File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
>     74, in main
>           return command()(*args)
>         File "/home/erob/src/libschevo/lib/schevo/script/command.py", line
>     32, in __call__
>           return self.main(arg0, args)
>         File "/home/erob/src/libschevo/lib/schevo/script/db_update.py",
>     line
>     92, in main
>           db._sync(schema_source, initialize=False)
>         File "/home/erob/src/libschevo/lib/schevo/database2.py", line 1477,
>     in _sync
>           self._commit()
>         File "/home/erob/src/libschevo/lib/schevo/backends/zodb.py", line
>     102, in commit
>           transaction.commit()
>         File
>     "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/transaction/_manager.py",
> 
>     line 131, in commit
>           return self.get().commit()
>         File
>     "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/transaction/_transaction.py",
> 
>     line 311, in commit
>           reraise(t, v, tb)
>         File
>     "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/transaction/_transaction.py",
> 
>     line 302, in commit
>           self._commitResources()
>         File
>     "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/transaction/_transaction.py",
> 
>     line 447, in _commitResources
>           reraise(t, v, tb)
>         File
>     "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/transaction/_transaction.py",
> 
>     line 424, in _commitResources
>           rm.tpc_vote(self)
>         File
>     "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/ZODB/Connection.py",
> 
>     line 692, in tpc_vote
>           s = vote(transaction)
>         File
>     "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/ZEO/ClientStorage.py",
> 
>     line 753, in tpc_vote
>           for oid in self._call('vote', id(txn)) or ():
>         File
>     "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/ZEO/asyncio/client.py",
> 
>     line 764, in call
>           return self.__call(self.call_threadsafe, method, args, **kw)
>         File
>     "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/ZEO/asyncio/client.py",
> 
>     line 743, in call
>           return self.wait_for_result(result, timeout)
>         File
>     "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/ZEO/asyncio/client.py",
> 
>     line 756, in wait_for_result
>           return future.result(timeout)
>         File
>     "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/concurrent/futures/_base.py",
> 
>     line 429, in result
>           return self.__get_result()
>         File
>     "/usr/local/pypy/pypy2-v5.9.0-linux32/site-packages/concurrent/futures/_base.py",
> 
>     line 381, in __get_result
>           raise exception_type, self._exception, self._traceback
>     ConflictError: database conflict error (oid 0x01, class
>     persistent.mapping.PersistentMapping, serial this txn started with
>     0x03c8913c1dc30988 2018-06-30 13:48:06.975437, serial currently
>     committed 0x03c8913dac03f200 2018-06-30 13:49:40.316112)
> 
>     The command i'm attempting to run is:
> 
>     $ /usr/local/pypy/bin/schevo db update --app mainapp
>     zodb://127.0.0.1:4343 <http://127.0.0.1:4343>
> 
>     Thank you,
> 
>     Etienne
> 
> 
>     -- 
>     You received this message because you are subscribed to the Google
>     Groups "zodb" group.
>     To unsubscribe from this group and stop receiving emails from it,
>     send an email to [email protected]
>     <mailto:zodb%[email protected]>.
>     For more options, visit https://groups.google.com/d/optout.
> 

-- 
Etienne Robillard
[email protected]
https://www.isotopesoftware.ca/

-- 
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.