Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
c2a36e9c
Commit
c2a36e9c
authored
Mar 11, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
9bfac376
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
17 deletions
+15
-17
wcfs/wcfs.go
wcfs/wcfs.go
+15
-17
No files found.
wcfs/wcfs.go
View file @
c2a36e9c
...
...
@@ -541,35 +541,33 @@ type blkLoadState struct {
// See "3) for */head/data the following invariant is maintained..."
type
zodbCacheControl
struct
{}
func
(
cc
*
zodbCacheControl
)
WantEvict
(
obj
zodb
.
IPersistent
)
bool
{
func
(
_
*
zodbCacheControl
)
PCacheClassify
(
obj
zodb
.
IPersistent
)
zodb
.
PCachePolicy
{
switch
obj
.
(
type
)
{
default
:
return
true
// XXX ZBlk should be in ghost state - else we keep ZBlk data in cache
// ZBlk* should be in cache but without data
case
*
ZBlk0
:
return
zodb
.
PCachePinObject
|
zodb
.
PCacheNonTemporal
case
*
ZBlk1
:
return
zodb
.
PCachePinObject
|
zodb
.
PCacheNonTemporal
// ZBigFile btree index should be in cache with data
case
*
btree
.
LOBTree
:
return
zodb
.
PCachePinObject
|
zodb
.
PCacheKeepState
case
*
btree
.
LOBucket
:
return
zodb
.
PCachePinObject
|
zodb
.
PCacheKeepState
// don't let ZData to pollute the cache
case
*
ZData
:
return
zodb
.
PCacheNonTemporal
// for performance reason we also keep ZBigFile in cache.
//
// ZBigFile is top-level object that is used on every block load, and
// it would be a waste to evict ZBigFile state from cache.
case
*
ZBigFile
:
// FIXME we need to keep ZBigFile in cache: even if we keep a pointer
// to ZBigFile, but it is allowed to drop its state, it will release
// pointer to LOBTree object and, consequently, that LOBTree object,
// even if it was marked not to be released from cache will be GC'ed by
// go runtime, and the cache will loose its weak reference to it.
// XXX however we cannot protect ZBigFile from releasing state - as
// any object can be explicitly invalidated.
//
// FIXME -> teach zodb.LiveCache to keep object by itself
return
zodb
.
PCachePinObject
|
zodb
.
PCacheKeepState
}
return
false
return
0
}
func
traceWatch
(
format
string
,
argv
...
interface
{})
{
...
...
@@ -1521,7 +1519,7 @@ func main() {
// open zodb storage/db/connection
ctx
:=
context
.
Background
()
// XXX + timeout?
zstor
,
err
:=
zodb
.
Open
Storage
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
zstor
,
err
:=
zodb
.
Open
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
,
})
if
err
!=
nil
{
...
...
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