Commit fdda65cd authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c5552417
...@@ -30,7 +30,7 @@ import ( ...@@ -30,7 +30,7 @@ import (
"lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/set" "lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/set"
"lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xbtree" "lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xbtree"
"lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xtail" "lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xtail"
"lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xzodb" // "lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xzodb"
) )
type setI64 = set.I64 type setI64 = set.I64
...@@ -217,10 +217,12 @@ func (δFtail *ΔFtail) Track(file *ZBigFile, blk int64, path []btree.LONode, zb ...@@ -217,10 +217,12 @@ func (δFtail *ΔFtail) Track(file *ZBigFile, blk int64, path []btree.LONode, zb
// //
// δZ should include all objects changed by ZODB transaction. // δZ should include all objects changed by ZODB transaction.
// //
// Zhead must be active connection at δFtail.Head() database state. // XXX readd zhead?
// Objects in Zhead must not be modified. // // Zhead must be active connection at δFtail.Head() database state.
// During call to Update zhead must not be otherwise used - even for reading. // // Objects in Zhead must not be modified.
func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit, zhead *xzodb.ZConn) (_ ΔF, err error) { // // During call to Update zhead must not be otherwise used - even for reading.
//func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit, zhead *xzodb.ZConn) (_ ΔF, err error) {
func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
defer xerr.Contextf(&err, "ΔFtail update %s -> %s", δFtail.Head(), δZ.Tid) defer xerr.Contextf(&err, "ΔFtail update %s -> %s", δFtail.Head(), δZ.Tid)
// XXX δFtail.update() first? // XXX δFtail.update() first?
......
...@@ -162,9 +162,14 @@ func TestΔFtail(t_ *testing.T) { ...@@ -162,9 +162,14 @@ func TestΔFtail(t_ *testing.T) {
// commit updated blkTab + dataTab // commit updated blkTab + dataTab
tdTxt := fmt.Sprintf("t%s D%s", xbtreetest.KVTxt(blkTab), dataTabTxt(dataTab)) tdTxt := fmt.Sprintf("t%s D%s", xbtreetest.KVTxt(blkTab), dataTabTxt(dataTab))
commit := t.CommitTree(tdTxt) commit := t.CommitTree(tdTxt)
fmt.Printf("@%s δT: %v δD: %s\n", commit.At, test.δblkTab, test.δdataTab)
fmt.Printf("@%s %s\n", commit.At, commit.Tree) fmt.Printf("@%s %s\n", commit.At, commit.Tree)
// update δftail
δF, err := δftail.Update(commit.ΔZ); X(err)
// XXX assert // XXX assert
_ = δF
} }
} }
......
...@@ -868,7 +868,8 @@ retry: ...@@ -868,7 +868,8 @@ retry:
// invalidate kernel cache for data in changed files // invalidate kernel cache for data in changed files
// NOTE no δFmu lock needed because zhead is WLocked // NOTE no δFmu lock needed because zhead is WLocked
δF, err := bfdir.δFtail.Update(δZ, zhead) // δF <- δZ |tracked // δF, err := bfdir.δFtail.Update(δZ, zhead) // δF <- δZ |tracked
δF, err := bfdir.δFtail.Update(δZ) // δF <- δZ |tracked
if err != nil { if err != nil {
return err return err
} }
......
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