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
64862e3e
Commit
64862e3e
authored
Mar 06, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
6b0f4e35
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
go/zodb/db.go
go/zodb/db.go
+8
-4
No files found.
go/zodb/db.go
View file @
64862e3e
...
...
@@ -428,7 +428,10 @@ 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)
//
// note: we are ok to get conn with .at = δtail.Tail inclusive, because
// we need only later transactions to invalidate conn cache, and data
// about later transactions is present in δtail.
conn
=
db
.
get
(
δtail
.
Tail
(),
at
)
if
conn
==
nil
{
conn
=
newConnection
(
db
,
at
)
...
...
@@ -520,7 +523,7 @@ func (conn *Connection) resync1(at Tid) {
δall
:=
false
// if we have to invalidate all objects
// both conn.at and at are covered by δtail - we can invalidate selectively
if
(
δtail
.
Tail
()
<
conn
.
at
&&
conn
.
at
<=
δtail
.
Head
())
&&
// XXX conn.at can = δtail.Tail
if
(
δtail
.
Tail
()
<
conn
.
at
&&
conn
.
at
<=
δtail
.
Head
())
&&
(
δtail
.
Tail
()
<
at
&&
at
<=
δtail
.
Head
())
{
var
δv
[]
ΔRevEntry
if
conn
.
at
<=
at
{
...
...
@@ -572,10 +575,11 @@ func (conn *Connection) resync1(at Tid) {
// get returns connection from db pool most close to at with conn.at ∈ [atMin, at].
//
// 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.
//
// Note: atMin is inclusive, because even if we get conn with .at = δtail.Tail,
// we still can use δtail data to invalidate conn cache with followup transactions.
func
(
db
*
DB
)
get
(
atMin
,
at
Tid
)
*
Connection
{
l
:=
len
(
db
.
pool
)
...
...
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