-
Notifications
You must be signed in to change notification settings - Fork 92
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
Relax assertion in check_tid_ordering_w_commit test #316
Conversation
Found by NEO test suite. No idea how I could miss that. |
/cc @navytux |
@jmuchemb, thanks for heads up. After looking a bit inside I think I understand at least roughly what was going on and is changed by your patch: since 4a6b028 However I'm not sure I understand why this test is correct at all: in my view nothing should block --- a/src/ZODB/tests/BasicStorage.py
+++ b/src/ZODB/tests/BasicStorage.py
@@ -379,7 +379,7 @@ def lastInvalidations():
while len(attempts) < expected_attempts:
attempts_cond.wait()
- time.sleep(.01) # for good measure :)
+ time.sleep(10) # for good measure :)
finish.set()
for t in to_join: ? This test was added in c3091e2 by @jimfulton which talks about ordering and "some sort of locking strategy". We should be fine with ordering. However "some sort of locking strategy" does not imply "the storage is locked for other operations while a commit is in progress", isn't it? Kirill |
Yes, it does. The reason is that the tpc_finish callback is called while the cache is locked, and that load wants to access the cache. On ZODB < 5, NEO also needs lastTransaction() to be updated with the same lock as the one used to process invalidations (see #307). |
It is pointless for lastTransaction() to block until it is allowed to return the TID of a transaction that has just been committed, because it may still not be the real last TID (e.g. for some storage implementations, invalidations are received from a shared server via the network). While invalidations are still being processed, it's fine to return immediately with the previous last TID. This was clarified in commit 4a6b028 ("mvccadapter: check if the last TID changed without invalidation"). See pull request #316
It is pointless for lastTransaction() to block until it is allowed to return the TID of a transaction that has just been committed, because it may still not be the real last TID (e.g. for some storage implementations, invalidations are received from a shared server via the network). While invalidations are still being processed, it's fine to return immediately with the previous last TID. This was clarified in commit 4a6b028 ("mvccadapter: check if the last TID changed without invalidation"). See pull request #316
It is pointless for lastTransaction() to block until it is allowed to return the TID of a transaction that has just been committed, because it may still not be the real last TID (e.g. for some storage implementations, invalidations are received from a shared server via the network). While invalidations are still being processed, it's fine to return immediately with the previous last TID.
This was clarified in commit 4a6b028 ("mvccadapter: check if the last TID changed without invalidation").