Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mark MVCCAdapter instance's tpc_finish callbacks #344

Closed
wants to merge 1 commit into from

Conversation

d-maurer
Copy link
Contributor

Since ZODB>=5.6 lastTransaction must change after invalidation processing. The problem reported in "zopefoundation/ZEO#166" demonstrates that this is necessary for the invalidations from a local tpc_finish as well.

MVCCAdapter instances put those invalidations into the tpc_finish callback. This implies that lastTransaction must change after those callbacks are run. The test ZODB.tests.BasicStorage.BasicStorage.check_tid_ordering_w_commit uses the tpc_finish callback to sample the result of lastTransaction. It requires that lastTransaction changes before the sampling. Obviously, both requirements contradict one another.

That the test currently succeeds for all storages almost surely means that those storages do not yet fulfill the requirement introduced by ZODB==5.6. The optimal approach likely would be to modify all storages and adapt the test accordingly. Because I do not want to change all storages at the moment, I opted for a different (slightly hacky) solution:
MVCCAdapter instances set callback.invalidateTransaction = True for their tpc_finish callbacks. This allows a storage implementation to distinguish callbacks from MVCCAdapter instances (lastTransaction must change after the callback) from other callbacks (e.g. from tests where lastTransaction might be expected to change before the callback).

@d-maurer
Copy link
Contributor Author

The explanation provided by @navytux in "#307 (comment)" shows that this is not necessary.

@d-maurer d-maurer closed this Apr 14, 2021
@d-maurer d-maurer deleted the mark_mvccadapter_callbacks#ZEO_166 branch April 14, 2021 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant