After further poking around we discovered another problem using commit-aside in Python. If you have a view that has a binary B property then some part of the full commit does not seem to work. If the view has no B properties then we can do a full commit and nuke the aside file with no consequences, but if there is a B property we can reliably crash the python process due to something in Mk4py.dll exploding. The following code snippet should recreate the problem.
import metakit, random, os
db = metakit.storage("_f.mk", 1)
dba = metakit.storage("_f.mka", 1)
db.aside(dba)
vw = db.getas("a[i:I,b:B]")
vw.append(i=1,b=random.getrandbits(32))
vw.append(i=2, b=random.getrandbits(32))
vw.append(i=3, b=random.getrandbits(32))
dba.commit()
db.commit(1)
del vw
del db
del dba
os.remove("_f.mka")
db = metakit.storage("_f.mk", 1)
dba = metakit.storage("_f.mka", 1)
db.aside(dba)
vw = db.getas("a")
assert len(vw) == 3
# and now to crash things
assert vw[0].i == 1
If none of the view properties are binary then everything will work as expected (modulo the "open the views before trying a full commit" bit Zooko noted) but with a binary property in the mix then as soon as we try to use the re-opened views after doing a full commit and nuking the aside file everything comes crashing down.
Regards,
Jim McCoy
Summary
Commit aside has several known limitations and will probably never be fixed.
- 2006-05-09 mccoy
Imported
- 2006-12-08 jcw
Copied from metakit cvstrac ticket #10
- 2006-12-08 jcw
The "commit aside" functionality of Metakit has never been fully implemented. Considering this has not changed in the past years, I don't expect it to be addressed in the near future.
