[Erp5-dev] reindex inside a transaction?

jp at nexedi.com jp at nexedi.com
Sat Nov 6 19:50:19 CET 2010


Hi,

Could you provide the revision of SVN you are using ? Are you using ZEO environment ?

Some issues of this kind have been found and fixed a couple of months ago and were released in 5.4.6 (http://svn.erp5.org/erp5/release/5.4.6/). If I remember well, part of them were related to Zope core and part of them to CMFActiivity. But it could also be the normal behaviour of MVCC. 

I can tell you more later this WE.

Regards,

JPS.



> Hi
> 
> I observed a very strange behaviour, which makes me rather worried.
> Here is the use case:
> 
> There is a document (an invoice) and a workflow. Upon validation of
> the document the workflow script does two things:
> - generates a pdf version
> - changes the title of the document (because validated invoices are
> numbered sequentially)
> 
> Then the document is automatically reindexed. The problem is that
> while every validated invoice has the new title when you look at the
> object, the catalog sometimes contains the new value, and sometimes
> the old value. Next time the doc is validated the values in ZODB and
> in catalog become equal.
> 
> All this is very strange, especially that it appears to happen
> randomly and is not reproduceable. How and why it may happen?
> 
> The only way I see is that a reindex is processed by activity tool
> before the transaction is commited to the ZODB, so it uses old version
> of the object. Is reindex wrote to the sql activity queue immediately,
> or only after the transaction is committed? Because if it is written
> immediately, then the following might happen:
> - the workflow changes the object state, writes the object to ZODB
> - activity tool writes the activity to the sql queue
> - workflow triggers the after_scripts which begins to generate PDF,
> which takes some time
> - activity tool picks up the job and executes reindex
> - the script returns and transaction is committed
> and we have an inconsistency in data.
> 
> Am I right, or there might be some other reason?
> 
> Bartek
> 
> 
> -- 
> "CPU stepping is when you tile your front porch with extra CPU like
> celeron 1ghz units.
> typically you spread a thin layer of mortar the cpu's are laid and
> then joints filled.
> that's it cpu steps all done!"
> 
> (dragonsprayer at www.tomshardware.co.uk)
> _______________________________________________
> Erp5-dev mailing list
> Erp5-dev at erp5.org
> http://mail.nexedi.com/mailman/listinfo/erp5-dev
> 


More information about the Erp5-dev mailing list