Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
76f6fa11
Commit
76f6fa11
authored
Dec 26, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f9f4b93d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
10 deletions
+12
-10
go/zodb/cache.go
go/zodb/cache.go
+7
-6
go/zodb/cache_test.go
go/zodb/cache_test.go
+3
-3
go/zodb/open.go
go/zodb/open.go
+1
-0
go/zodb/zodb.go
go/zodb/zodb.go
+1
-1
No files found.
go/zodb/cache.go
View file @
76f6fa11
// Copyright (C) 2017 Nexedi SA and Contributors.
// Copyright (C) 2017
-2018
Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
Kirill Smelkov <kirr@nexedi.com>
//
//
// This program is free software: you can Use, Study, Modify and Redistribute
// This program is free software: you can Use, Study, Modify and Redistribute
// it under the terms of the GNU General Public License version 3, or (at your
// it under the terms of the GNU General Public License version 3, or (at your
...
@@ -31,7 +31,7 @@ import (
...
@@ -31,7 +31,7 @@ import (
"lab.nexedi.com/kirr/go123/xcontainer/list"
"lab.nexedi.com/kirr/go123/xcontainer/list"
)
)
//
TODO handle invalidations from the databas
e.
//
FIXME watch over storage and update cache to new commits ther
e.
// XXX managing LRU under 1 big gcMu might be bad for scalability.
// XXX managing LRU under 1 big gcMu might be bad for scalability.
// TODO maintain nhit / nmiss + way to read cache stats
// TODO maintain nhit / nmiss + way to read cache stats
...
@@ -46,8 +46,9 @@ type Cache struct {
...
@@ -46,8 +46,9 @@ type Cache struct {
mu
sync
.
RWMutex
mu
sync
.
RWMutex
// cache is fully synchronized with storage for transactions with tid <= head.
// cache is currently synchronized with storage for transactions with tid <= head.
// XXX clarify ^^^ (it means if revCacheEntry.head=∞ it is Cache.head)
// XXX clarify ^^^ (it means if revCacheEntry.head=∞ it is Cache.head) XXX
// XXX load(at > head) -> wait?
head
Tid
head
Tid
entryMap
map
[
Oid
]
*
oidCacheEntry
// oid -> oid's cache entries
entryMap
map
[
Oid
]
*
oidCacheEntry
// oid -> oid's cache entries
...
@@ -89,7 +90,7 @@ type revCacheEntry struct {
...
@@ -89,7 +90,7 @@ type revCacheEntry struct {
// ( this way we do not need to bump .head to next tid in many
// ( this way we do not need to bump .head to next tid in many
// unchanged cache entries when a transaction invalidation comes )
// unchanged cache entries when a transaction invalidation comes )
//
//
// .head can be > cache.head and still finite - that represents a
// .head can be > cache.head and still finite - that represents a
XXX
// case when load with tid > cache.head was called.
// case when load with tid > cache.head was called.
head
Tid
head
Tid
...
...
go/zodb/cache_test.go
View file @
76f6fa11
// Copyright (C) 2017 Nexedi SA and Contributors.
// Copyright (C) 2017
-2018
Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
Kirill Smelkov <kirr@nexedi.com>
//
//
// This program is free software: you can Use, Study, Modify and Redistribute
// This program is free software: you can Use, Study, Modify and Redistribute
// it under the terms of the GNU General Public License version 3, or (at your
// it under the terms of the GNU General Public License version 3, or (at your
...
@@ -613,7 +613,7 @@ func TestCache(t *testing.T) {
...
@@ -613,7 +613,7 @@ func TestCache(t *testing.T) {
// XXX verify caching vs ctx cancel
// XXX verify caching vs ctx cancel
// XXX verify db inconsistency checks
// XXX verify db inconsistency checks
// XXX verify loading with
before > cache.before
// XXX verify loading with
at > cache.head
}
}
type
Checker
struct
{
type
Checker
struct
{
...
...
go/zodb/open.go
View file @
76f6fa11
...
@@ -159,6 +159,7 @@ func (s *storage) Prefetch(ctx context.Context, xid Xid) {
...
@@ -159,6 +159,7 @@ func (s *storage) Prefetch(ctx context.Context, xid Xid) {
}
}
// watcher
// watcher
// FIXME tests
// watchRequest represents request to add/del a watch.
// watchRequest represents request to add/del a watch.
type
watchRequest
struct
{
type
watchRequest
struct
{
...
...
go/zodb/zodb.go
View file @
76f6fa11
...
@@ -437,7 +437,7 @@ type CommitEvent struct {
...
@@ -437,7 +437,7 @@ type CommitEvent struct {
// Watcher allows to be notified of changes to database.
// Watcher allows to be notified of changes to database.
//
//
// Watcher is safe to
be used
from multiple goroutines simultaneously.
// Watcher is safe to
use
from multiple goroutines simultaneously.
type
Watcher
interface
{
type
Watcher
interface
{
// AddWatch registers watchq to be notified of database changes.
// AddWatch registers watchq to be notified of database changes.
//
//
...
...
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