Commit a20f81e1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 090ce48d
...@@ -413,10 +413,8 @@ type Root struct { ...@@ -413,10 +413,8 @@ type Root struct {
zstor zodb.IStorage zstor zodb.IStorage
// ZODB DB handle for zstor. // ZODB DB handle for zstor.
// keeps cache of connections for both head/ and @<rev>/ accesses. // keeps cache of connections for @<rev>/ accesses.
// XXX head won't be kept here and will be .Resync()'ed explicitly? // only one connection is used for for each @<rev>.
//
// only one connection is used for head/ and only one for each @<rev>.
zdb *zodb.DB zdb *zodb.DB
// directory + ZODB connection for head/ // directory + ZODB connection for head/
......
...@@ -121,29 +121,6 @@ def test_join_autostart(): ...@@ -121,29 +121,6 @@ def test_join_autostart():
assert os.path.isdir(wc.mountpoint + "/head/bigfile") assert os.path.isdir(wc.mountpoint + "/head/bigfile")
"""
# XXX hack -> kill (?) or read-wait on head/at
# Conn._sync makes sure that underlying wcfs is synced to last ZODB data
@method(wcfs.Conn)
def _sync(self):
print >>sys.stderr, "\n# >>> wcfs.Conn.sync"
zurl = readfile(self.mountpoint + "/.wcfs/zurl")
bigfilev = os.listdir(self.mountpoint + "/head/bigfile")
self.close()
subprocess.check_call(["fusermount", "-u", self.mountpoint])
c2 = wcfs.join(zurl, autostart=True)
assert c2.mountpoint == self.mountpoint
self._fwcfs = c2._fwcfs
# recreate bigfile entries
for bf in bigfilev:
os.stat("%s/head/bigfile/%s" % (self.mountpoint, bf))
print >>sys.stderr, "# <<< wcfs.Conn.sync\n"
"""
# XXX parametrize zblk0, zblk1 # XXX parametrize zblk0, zblk1
# XXX select !wcfs mode so that we prepare data through !wcfs path. # XXX select !wcfs mode so that we prepare data through !wcfs path.
@func @func
...@@ -210,8 +187,6 @@ def test_wcfs(): ...@@ -210,8 +187,6 @@ def test_wcfs():
# path to f under wcfs # path to f under wcfs
fpath = "%s/%s" % (bigpath, h(f._p_oid)) fpath = "%s/%s" % (bigpath, h(f._p_oid))
print
print fpath
st = os.stat(fpath) st = os.stat(fpath)
assert st.st_size == 0 assert st.st_size == 0
...@@ -220,10 +195,6 @@ def test_wcfs(): ...@@ -220,10 +195,6 @@ def test_wcfs():
# head/at = last txn of whole db # head/at = last txn of whole db
assert readfile(head + "/at") == h(tid2) assert readfile(head + "/at") == h(tid2)
return
# TODO check head/at syncs to later non-bigfile commits
# commit data to f and make sure we can see it on wcfs # commit data to f and make sure we can see it on wcfs
#hole = 10 XXX reenable #hole = 10 XXX reenable
...@@ -234,9 +205,7 @@ def test_wcfs(): ...@@ -234,9 +205,7 @@ def test_wcfs():
memcpy(vma, s) memcpy(vma, s)
commit() commit()
wcsync() # sync wcfs to ZODB
# sync wcfs to ZODB
wc._sync()
# we wrote "hello world" after hole'th block, but size is always mutiple of blksize. # we wrote "hello world" after hole'th block, but size is always mutiple of blksize.
fsize = (hole + 1)*blksize fsize = (hole + 1)*blksize
...@@ -267,8 +236,7 @@ def test_wcfs(): ...@@ -267,8 +236,7 @@ def test_wcfs():
memcpy(vma2,s2) memcpy(vma2,s2)
commit() commit()
wcsync()
wc._sync()
fsize1 = fsize fsize1 = fsize
fsize = fsize1 + blksize # we added one more block fsize = fsize1 + blksize # we added one more block
......
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