Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
POSKeyError while packing #325
After some runs of zodbpack the stress-script ends with an error. This error was ZODB.POSException.ReadConflictError, relstorage.adapters.interfaces.UnableToLockRowsToReadCurrentError or immediately POSKeyError. After starting the plone site there are a lot of POSKeyErrors.
The first pack runs did only find a few objects to remove but the run that cause to problem did find a lot of (almost all) objects to remove.
Output of zodbpack without error in stress script:
Output of zodbpack with error in stress script:
Sometimes the pack script hangs after finishing and have to be killed.
We tested this with RelStorage 2.0.0 and 3.0a7.
Example output of stress-script with RelStorage 2.0.0:
Example output of stress-script with RelStorage 3.0a7:
We use Postgresql.
Please let me know if more information is needed.
PR #325 now demonstrates the error relatively reliably. Packing with simultaneous write access at ZODB level undermines ZODB transaction logic. Although the transaction is successfully completed at ZODB level, there is no complete persistence of the changes in the history-free RelStorage backend. Consequently, the changed objects at the ZODB level are corrupt and raise a POSKeyError when they are accessed after successful commit. Apparently, the packing logic at SQL level does not harmonize with the transaction logic of the ZODB.