[Checkins] [zopefoundation/ZODB] 23cb78: mvccadapter: check if the last TID changed without...

Julien Muchembled noreply at github.com
Wed Apr 1 17:44:16 CEST 2020


  Branch: refs/heads/issue290
  Home:   https://github.com/zopefoundation/ZODB
  Commit: 23cb78970ed8f92119b88d308aacc7c9fef12d07
      https://github.com/zopefoundation/ZODB/commit/23cb78970ed8f92119b88d308aacc7c9fef12d07
  Author: Julien Muchembled <jm at nexedi.com>
  Date:   2020-04-01 (Wed, 01 Apr 2020)

  Changed paths:
    M src/ZODB/FileStorage/tests.py
    M src/ZODB/mvccadapter.py
    M src/ZODB/tests/testConnection.py
    M src/ZODB/tests/testmvcc.py

  Log Message:
  -----------
  mvccadapter: check if the last TID changed without invalidation

Since commit b5895a5c23309ff2dfe8fd853b838a0c5e349210 ("mvccadapter:
fix race with invalidations when starting a new transaction"),
a ZEO test fails as follows:

    File "src/ZEO/tests/drop_cache_rather_than_verify.txt", line 114, in drop_cache_rather_than_verify.txt
    Failed example:
        conn.root()[1].x
    Expected:
        6
    Got:
        1

Earlier in the test, the ZEO server is restarted and then another
client commits. When disconnected, the first client does not receive
invalidations anymore and the connection gets stuck in the past until
there's a new commit after it reconnected. It was possible to make the
test pass with the following patch:

--- a/src/ZEO/ClientStorage.py
+++ b/src/ZEO/ClientStorage.py
@@ -357,6 +357,7 @@ def notify_connected(self, conn, info):
 
         # invalidate our db cache
         if self._db is not None:
+            self._db.invalidate(self.lastTransaction(), ())
             self._db.invalidateCache()
 
         logger.info("%s %s to storage: %s",

Other implementations like NEO are probably affected the same way.

Rather than changing interfaces in a backward-incompatible way,
this commit revert to the original behaviour, and all the changes
that were done in existing tests are reverted.




More information about the checkins mailing list