Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
a20f81e1
Commit
a20f81e1
authored
Feb 04, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
090ce48d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
38 deletions
+4
-38
wcfs/wcfs.go
wcfs/wcfs.go
+2
-4
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+2
-34
No files found.
wcfs/wcfs.go
View file @
a20f81e1
...
...
@@ -413,10 +413,8 @@ type Root struct {
zstor
zodb
.
IStorage
// ZODB DB handle for zstor.
// keeps cache of connections for both head/ and @<rev>/ accesses.
// XXX head won't be kept here and will be .Resync()'ed explicitly?
//
// only one connection is used for head/ and only one for each @<rev>.
// keeps cache of connections for @<rev>/ accesses.
// only one connection is used for for each @<rev>.
zdb
*
zodb
.
DB
// directory + ZODB connection for head/
...
...
wcfs/wcfs_test.py
View file @
a20f81e1
...
...
@@ -121,29 +121,6 @@ def test_join_autostart():
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 select !wcfs mode so that we prepare data through !wcfs path.
@
func
...
...
@@ -210,8 +187,6 @@ def test_wcfs():
# path to f under wcfs
fpath
=
"%s/%s"
%
(
bigpath
,
h
(
f
.
_p_oid
))
print
print
fpath
st
=
os
.
stat
(
fpath
)
assert
st
.
st_size
==
0
...
...
@@ -220,10 +195,6 @@ def test_wcfs():
# head/at = last txn of whole db
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
#hole = 10 XXX reenable
...
...
@@ -234,9 +205,7 @@ def test_wcfs():
memcpy
(
vma
,
s
)
commit
()
# sync wcfs to ZODB
wc
.
_sync
()
wcsync
()
# sync wcfs to ZODB
# we wrote "hello world" after hole'th block, but size is always mutiple of blksize.
fsize
=
(
hole
+
1
)
*
blksize
...
...
@@ -267,8 +236,7 @@ def test_wcfs():
memcpy
(
vma2
,
s2
)
commit
()
wc
.
_sync
()
wcsync
()
fsize1
=
fsize
fsize
=
fsize1
+
blksize
# we added one more block
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment