Resolve M_Storage locking and data consistency
Activity
Carlos Ruiz December 4, 2012 at 2:12 AM
https://bitbucket.org/idempiere/idempiere/commits/8883889
Fix error on view (ERROR: column "m_storage_uu" does not exist)
Carlos Ruiz November 28, 2012 at 9:03 PM
Implemented the locking for storage
https://bitbucket.org/idempiere/idempiere/changeset/abb9ccb
Carlos Ruiz November 22, 2012 at 11:31 PM
OK - this was committed into iDempiere:
There are two new tables and M_Storage was replaced by a view joining those two tables.
Please note the old M_Storage table will be deleted - if you want to preserve it (for historical or debugging purposes) please comment the line 367 on script 201211191100_IDEMPIERE-385_DB.sql
Thanks to Edwin and Ambidexter Consulting for their contributions on this effort.
This change is very big and it has space for more improvements.
I made basic successful tests for:
Purchase process (check reservations, matching and on hand)
Sales process (check reservations, matching on shipment and on hand)
Validation of availability on orders, movements
Inventory move
Physical inventory
Inventory valuation report
Replenishment report
Storage cleanup
using the following products:Plum (non-attributes)
TShirt GL (product attributes)
Patio Chair (product and instance attributes)
Related Commits:
https://bitbucket.org/idempiere/idempiere/changeset/16c1623
https://bitbucket.org/idempiere/idempiere/changeset/d7c2d71
https://bitbucket.org/idempiere/idempiere/changeset/042592a
https://bitbucket.org/idempiere/idempiere/changeset/ab3ad5c
https://bitbucket.org/idempiere/idempiere/changeset/1e1eaa3
https://bitbucket.org/idempiere/idempiere/changeset/b0cdb24
https://bitbucket.org/idempiere/idempiere/changeset/8f1fede
https://bitbucket.org/idempiere/idempiere/changeset/a7a7c2a
https://bitbucket.org/idempiere/idempiere/changeset/4a5a924
https://bitbucket.org/idempiere/idempiere/changeset/86ecf42
https://bitbucket.org/idempiere/idempiere/changeset/5ab59a5
https://bitbucket.org/idempiere/idempiere/changeset/4b8da99
https://bitbucket.org/idempiere/idempiere/changeset/0a1b337
https://bitbucket.org/idempiere/idempiere/changeset/2a54ced
https://bitbucket.org/idempiere/idempiere/changeset/b261f88
https://bitbucket.org/idempiere/idempiere/changeset/a5d08ca
https://bitbucket.org/idempiere/idempiere/changeset/a896b67
https://bitbucket.org/idempiere/idempiere/changeset/3f34718
https://bitbucket.org/idempiere/idempiere/changeset/e54d7ca
https://bitbucket.org/idempiere/idempiere/changeset/fdf2e46
https://bitbucket.org/idempiere/idempiere/changeset/1774e51
https://bitbucket.org/idempiere/idempiere/changeset/5eeec9a
https://bitbucket.org/idempiere/idempiere/changeset/4fa9dc3
https://bitbucket.org/idempiere/idempiere/changeset/308237a
Carlos Ruiz November 19, 2012 at 8:46 PM
Hi Edwin, started working on this.
Temporary fork with your commits into iDempiere:
https://bitbucket.org/CarlosRuiz_globalqss/idempiere-carlosruiz/compare
Regards,
Carlos Ruiz
Carlos Ruiz November 14, 2012 at 4:57 AM
Edwin,
I'm reviewing the commits here:
https://bitbucket.org/edwin_ang/adempiere361-mbd/compare/globalqss_adempiere361..CarlosRuiz_globalqss/adempiere361:globalqss_adempiere361
First thing I notice is the lack of the migration scripts.
Can you please commit it or upload here?
Regards,
Carlos Ruiz
At Vancouver conference we discussed the following idea to solve the M_Storage issue:
from M_Storage remove reserved and ordered
create a new table M_StorageReservation with product / ASI / Warehouse / IsSOTrx (this will define reserved/ordered) / Qty
Rename M_Storage to M_StorageOnHand
Create a view M_Storage (for reporting backward compatibility)
create reserve-location on warehouse? for reporting and info product purposes
change the db functions for the new structures (getavailable, getreserved ...)
review code that update storage for possible deadlocks, and to make it safer ensuring that is updating values on the database (not from memory)
the methods touching storage must process order by productid+ASI to avoid deadlocks
make concurrency tests
be sure to check all code for MStorage dependencies, i.e. the available qty check on sales order
__________________
At the moment of writing this we talked with Adaxa AUS and they solved this issue in a very similar way - so this is to be kept on hold for peer review and integration of such contribution.