Commit 76f6fa11 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f9f4b93d
// Copyright (C) 2017 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
// Copyright (C) 2017-2018 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// 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
......@@ -31,7 +31,7 @@ import (
"lab.nexedi.com/kirr/go123/xcontainer/list"
)
// TODO handle invalidations from the database.
// FIXME watch over storage and update cache to new commits there.
// XXX managing LRU under 1 big gcMu might be bad for scalability.
// TODO maintain nhit / nmiss + way to read cache stats
......@@ -46,8 +46,9 @@ type Cache struct {
mu sync.RWMutex
// cache is fully synchronized with storage for transactions with tid <= head.
// XXX clarify ^^^ (it means if revCacheEntry.head=∞ it is Cache.head)
// cache is currently synchronized with storage for transactions with tid <= head.
// XXX clarify ^^^ (it means if revCacheEntry.head=∞ it is Cache.head) XXX
// XXX load(at > head) -> wait?
head Tid
entryMap map[Oid]*oidCacheEntry // oid -> oid's cache entries
......@@ -89,7 +90,7 @@ type revCacheEntry struct {
// ( this way we do not need to bump .head to next tid in many
// 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.
head Tid
......
// Copyright (C) 2017 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
// Copyright (C) 2017-2018 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// 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
......@@ -613,7 +613,7 @@ func TestCache(t *testing.T) {
// XXX verify caching vs ctx cancel
// XXX verify db inconsistency checks
// XXX verify loading with before > cache.before
// XXX verify loading with at > cache.head
}
type Checker struct {
......
......@@ -159,6 +159,7 @@ func (s *storage) Prefetch(ctx context.Context, xid Xid) {
}
// watcher
// FIXME tests
// watchRequest represents request to add/del a watch.
type watchRequest struct {
......
......@@ -437,7 +437,7 @@ type CommitEvent struct {
// 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 {
// AddWatch registers watchq to be notified of database changes.
//
......
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