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

.

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