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
6b0f4e35
Commit
6b0f4e35
authored
Mar 06, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c0478833
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
go/zodb/db.go
go/zodb/db.go
+5
-3
go/zodb/δtail.go
go/zodb/δtail.go
+3
-1
No files found.
go/zodb/db.go
View file @
6b0f4e35
...
...
@@ -113,7 +113,8 @@ type DB struct {
// waiters for δtail.Head to become ≥ their at.
hwait
map
[
hwaiter
]
struct
{}
// set{(at, ready)}
// XXX δtail/hwait -> Storage. XXX or -> Cache? (so it is not duplicated many times for many DB case)
// XXX δtail/hwait -> Storage or -> Cache?
// (so it is not duplicated many times for many DB case)
}
...
...
@@ -427,6 +428,7 @@ func (db *DB) open(at Tid, noPool bool) *Connection {
}
// at ∈ (δtail, δhead] ; try to get nearby idle connection or make a new one
//conn = db.get(δtail.Tail()+1, at)
conn
=
db
.
get
(
δtail
.
Tail
(),
at
)
if
conn
==
nil
{
conn
=
newConnection
(
db
,
at
)
...
...
@@ -570,7 +572,7 @@ func (conn *Connection) resync1(at Tid) {
// get returns connection from db pool most close to at with conn.at ∈ [atMin, at].
//
//
XXX recheck [atMin or (atMin -- see "= δtail.Tail" in resync
.
//
Note: contraty to e.g. δtail.Tail, atMin is inclusive
.
//
// If there is no such connection in the pool - nil is returned.
// Must be called with db.mu locked.
...
...
@@ -651,7 +653,7 @@ func (db *DB) put(conn *Connection) {
copy
(
db
.
pool
[
i
+
1
:
],
db
.
pool
[
i
:
])
db
.
pool
[
i
]
=
conn
// XXX GC too idle connections here
? XXX
// XXX GC too idle connections here
}
// ---- txn sync ----
...
...
go/zodb/δtail.go
View file @
6b0f4e35
...
...
@@ -59,7 +59,7 @@ import (
type
ΔTail
struct
{
head
Tid
tail
Tid
tailv
[]
ΔRevEntry
// XXX -> revv ?
tailv
[]
ΔRevEntry
// XXX -> revv ?
δv? δvec? changev ?
lastRevOf
map
[
Oid
]
Tid
// index for LastRevOf queries
// XXX -> lastRevOf = {} oid -> []rev↑ if linear scan in LastRevOf starts to eat cpu
...
...
@@ -98,6 +98,8 @@ func (δtail *ΔTail) Head() Tid {
// Tail returns oldest database state for which δtail has history coverage.
//
// XXX not inclusive?
//
// Tail is ↑= on Forget, even if δtail becomes empty.
func
(
δtail
*
ΔTail
)
Tail
()
Tid
{
return
δtail
.
tail
...
...
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