Commit c9658ff3 authored by Julien Muchembled's avatar Julien Muchembled

Importer: fix retrieval of an object from ZODB when next serial in NEO

parent f1bc3c32
......@@ -491,8 +491,11 @@ class ImporterDatabaseManager(DatabaseManager):
# except clause because it would be crazy to import a
# NEO DB using this backend.
checksum = None
return (serial, next_serial or
db._getNextTID(db._getPartition(u_oid), u_oid, u_tid),
if not next_serial:
next_serial = db._getNextTID(db._getPartition(u_oid), u_oid, u_tid)
if next_serial:
next_serial = p64(next_serial)
return (serial, next_serial,
0, checksum, value, zodb.getDataTid(z_oid, u_tid))
def getTransaction(self, tid, all=False):
......
......@@ -193,11 +193,20 @@ class ImporterTests(NEOThreadedTest):
cluster.start()
t, c = cluster.getTransaction()
r = c.root()["neo"]
# Test retrieving of an object from ZODB when next serial in NEO.
r._p_changed = 1
t.commit()
t.begin()
storage = c.db().storage
storage._cache.clear()
storage.loadBefore(r._p_oid, r._p_serial)
##
self.assertRaisesRegexp(NotImplementedError, " getObjectHistory$",
c.db().history, r._p_oid)
i = r.walk()
next(islice(i, 9, None))
dm.doOperation(cluster.storage) # resume
logging.info("start migration")
dm.doOperation(cluster.storage)
deque(i, maxlen=0)
last_import = None
for i, r in enumerate(r.treeFromFs(src_root, 10)):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment