Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
4d2100d6
Commit
4d2100d6
authored
Jan 25, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8117cc7d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
go/zodb/db.go
go/zodb/db.go
+6
-9
go/zodb/persistent_test.go
go/zodb/persistent_test.go
+2
-0
No files found.
go/zodb/db.go
View file @
4d2100d6
...
...
@@ -49,23 +49,20 @@ type DB struct {
mu
sync
.
Mutex
// connections nearby current db
// XXX covered by δtail
// pool of unused connections.
// live cache is reused through finding conn with nearby at and
// invalidating live objects based on δtail info.
//
// XXX vs δtail coverage?
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
// 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.
δtail
*
ΔTail
// [](rev↑, []oid)
// 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)
}
...
...
@@ -89,8 +86,8 @@ func NewDB(stor IStorage) *DB {
watchq
:=
make
(
chan
CommitEvent
)
stor
.
AddWatch
(
watchq
)
// XXX DelWatch? in db.Close() ?
go
db
.
watcher
(
watchq
)
// XXX DelWatch? in db.Close() ?
return
db
}
...
...
go/zodb/persistent_test.go
View file @
4d2100d6
...
...
@@ -229,6 +229,8 @@ func TestPersistentDB(t *testing.T) {
// do not evict obj2 from live cache. obj1 is ok to be evicted.
zcache1
:=
conn1
.
Cache
()
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
xobj1
,
err
:=
conn1
.
Get
(
ctx1
,
101
);
X
(
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment