Commit 84fe9dcc authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent bdd6be33
......@@ -1012,11 +1012,13 @@ func (f *BigFile) readBlk(ctx context.Context, blk int64, dest []byte) error {
}
// /bigfile/<bigfileX>/head/at -> readAt serves read.
func (bf *BigFile) readAt() []byte {
// XXX locking
// XXX zbf.PJar() not good if we want to share objects between connections?
return []byte(bf.zbf.PJar().At().String())
// /(head|<rev>)/at -> readAt serves read.
func (h *Head) readAt() []byte {
// XXX implemented only for Head, not Rev
root := groot
root.zheadMu.Lock()
defer root.zheadMu.Unlock()
return []byte(root.zhead.At().String())
}
......@@ -1108,6 +1110,7 @@ func main() {
Node: nodefs.NewDefaultNode(),
tab: make(map[zodb.Oid]*BigFile),
})
mkfile(head, "at", NewSmallFile(head.readAt)) // TODO mtime(at) = tidtime(at)
// TODO handle autoexit
_ = autoexit
......
......@@ -165,8 +165,9 @@ def test_bigfile_empty():
wc = wcfs.join(testzurl, autostart=True)
defer(wc.close)
# path to head/bigfile/ under wcfs
bigpath = wc.mountpoint + "/head/bigfile"
# path to head/ and head/bigfile/ under wcfs
head = wc.mountpoint + "/head"
bigpath = head + "/bigfile"
# lookup to non-BigFile - must be rejected
with raises(OSError) as exc:
......@@ -182,7 +183,7 @@ def test_bigfile_empty():
assert st.st_mtime == tidtime(tid1)
# head/at = last txn of whole db
assert readfile(fpath + "/head/at") == tid2.encode('hex')
assert readfile(head + "/at") == tid2.encode('hex')
# TODO check head/at syncs to later non-bigfile commits
......
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