Commit 4d2100d6 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8117cc7d
...@@ -49,23 +49,20 @@ type DB struct { ...@@ -49,23 +49,20 @@ type DB struct {
mu sync.Mutex mu sync.Mutex
// connections nearby current db // pool of unused connections.
// XXX covered by δtail
// live cache is reused through finding conn with nearby at and // live cache is reused through finding conn with nearby at and
// invalidating live objects based on δtail info. // invalidating live objects based on δtail info.
//
// XXX vs δtail coverage?
connv []*Connection // order by ↑= .at connv []*Connection // order by ↑= .at
// // connections that are too far away from current db
// // not covered by δtail
// historicv []*Connections // XXX needed? (think again)
// δtail of database changes for invalidations // δtail of database changes for invalidations
// min(rev) = min(conn.at) for all conn ∈ db (opened and in the pool) // min(rev) = min(conn.at) for all conn ∈ db (opened and in the pool) XXX no
// XXX + min(conn.at) for all conn ∈ waiting/opening. // XXX + min(conn.at) for all conn ∈ waiting/opening.
δtail *ΔTail // [](rev↑, []oid) δtail *ΔTail // [](rev↑, []oid)
// openers waiting for δtail.Head to become covering their at. // openers waiting for δtail.Head to become covering their at.
δwait map[δwaiter]struct{} // set{(at, ready)} XXX -> set_δwaiter? δwait map[δwaiter]struct{} // set{(at, ready)}
// XXX δtail/δwait -> Storage. XXX or -> Cache? (so it is not duplicated many times for many DB case) // XXX δtail/δwait -> Storage. XXX or -> Cache? (so it is not duplicated many times for many DB case)
} }
...@@ -89,8 +86,8 @@ func NewDB(stor IStorage) *DB { ...@@ -89,8 +86,8 @@ func NewDB(stor IStorage) *DB {
watchq := make(chan CommitEvent) watchq := make(chan CommitEvent)
stor.AddWatch(watchq) stor.AddWatch(watchq)
// XXX DelWatch? in db.Close() ?
go db.watcher(watchq) go db.watcher(watchq)
// XXX DelWatch? in db.Close() ?
return db return db
} }
......
...@@ -229,6 +229,8 @@ func TestPersistentDB(t *testing.T) { ...@@ -229,6 +229,8 @@ func TestPersistentDB(t *testing.T) {
// do not evict obj2 from live cache. obj1 is ok to be evicted. // do not evict obj2 from live cache. obj1 is ok to be evicted.
zcache1 := conn1.Cache() zcache1 := conn1.Cache()
zcache1.SetControl(&zcacheControl{[]Oid{_obj2.oid}}) zcache1.SetControl(&zcacheControl{[]Oid{_obj2.oid}})
// FIXME test that live cache keeps objects live even if we drop all
// regular pointers to it and do GC.
// get objects and assert their type // get objects and assert their type
xobj1, err := conn1.Get(ctx1, 101); X(err) xobj1, err := conn1.Get(ctx1, 101); X(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