Commit 5fb2be0f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 39ff832b
......@@ -156,8 +156,7 @@ const (
// data access is non-temporal.
//
// Object state is used once and then won't be used for a long time.
// There is no reason to preserve object state in cache.
// XXX Don't pollute ...
// Don't pollute cache with this object state.
PCacheNonTemporal // XXX PCachePolicy ?
)
......
......@@ -262,14 +262,14 @@ func (obj *Persistent) PDeactivate() {
// no constant load/unload on object access. XXX -> MRU cache?
// NOTE wcfs manages its objects explicitly and does not need this.
// XXX reenable
/*
if cc := obj.jar.cache.control; cc != nil {
if !cc.WantEvict(obj.instance) {
// XXX catch inconsistency in PCacheClassify result
// XXX locking for .control ?
cp := cc.PCacheClassify(obj.instance)
if cp & PCacheKeepState != 0 {
return
}
}
*/
// already ghost
if obj.state == GHOST {
......
......@@ -468,6 +468,10 @@ func testPersistentDB(t0 *testing.T, rawcache bool) {
tdb := testdb(t0, rawcache)
defer tdb.Close()
tdb.Add(101, "bonjour")
tdb.Add(102, "monde")
tdb.Commit()
at0 := tdb.head
tdb.Add(101, "hello")
......@@ -694,13 +698,13 @@ func testPersistentDB(t0 *testing.T, rawcache bool) {
t.PActivate(robj1)
t.PActivate(robj2)
t.checkObj(robj1, 101, at0, UPTODATE, 1, "init")
t.checkObj(robj2, 102, at0, UPTODATE, 1, "db")
t.checkObj(robj1, 101, at0, UPTODATE, 1, "bonjour")
t.checkObj(robj2, 102, at0, UPTODATE, 1, "monde")
robj1.PDeactivate()
robj2.PDeactivate()
t.checkObj(robj1, 101, InvalidTid, GHOST, 0)
t.checkObj(robj2, 102, at0, UPTODATE, 0, "db")
t.checkObj(robj2, 102, at0, UPTODATE, 0, "monde")
// Resync ↑ (at0 -> at2; from outside δtail coverage)
t.Abort()
......
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