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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
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
Show 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 {
...
@@ -541,35 +541,33 @@ type blkLoadState struct {
// See "3) for */head/data the following invariant is maintained..."
// See "3) for */head/data the following invariant is maintained..."
type
zodbCacheControl
struct
{}
type
zodbCacheControl
struct
{}
func
(
cc
*
zodbCacheControl
)
WantEvict
(
obj
zodb
.
IPersistent
)
bool
{
func
(
_
*
zodbCacheControl
)
PCacheClassify
(
obj
zodb
.
IPersistent
)
zodb
.
PCachePolicy
{
switch
obj
.
(
type
)
{
switch
obj
.
(
type
)
{
default
:
// ZBlk* should be in cache but without data
return
true
// XXX ZBlk should be in ghost state - else we keep ZBlk data in cache
case
*
ZBlk0
:
case
*
ZBlk0
:
return
zodb
.
PCachePinObject
|
zodb
.
PCacheNonTemporal
case
*
ZBlk1
:
case
*
ZBlk1
:
return
zodb
.
PCachePinObject
|
zodb
.
PCacheNonTemporal
// ZBigFile btree index should be in cache with data
case
*
btree
.
LOBTree
:
case
*
btree
.
LOBTree
:
return
zodb
.
PCachePinObject
|
zodb
.
PCacheKeepState
case
*
btree
.
LOBucket
:
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.
// for performance reason we also keep ZBigFile in cache.
//
//
// ZBigFile is top-level object that is used on every block load, and
// ZBigFile is top-level object that is used on every block load, and
// it would be a waste to evict ZBigFile state from cache.
// it would be a waste to evict ZBigFile state from cache.
case
*
ZBigFile
:
case
*
ZBigFile
:
return
zodb
.
PCachePinObject
|
zodb
.
PCacheKeepState
// 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
false
return
0
}
}
func
traceWatch
(
format
string
,
argv
...
interface
{})
{
func
traceWatch
(
format
string
,
argv
...
interface
{})
{
...
@@ -1521,7 +1519,7 @@ func main() {
...
@@ -1521,7 +1519,7 @@ func main() {
// open zodb storage/db/connection
// open zodb storage/db/connection
ctx
:=
context
.
Background
()
// XXX + timeout?
ctx
:=
context
.
Background
()
// XXX + timeout?
zstor
,
err
:=
zodb
.
Open
Storage
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
zstor
,
err
:=
zodb
.
Open
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
,
ReadOnly
:
true
,
})
})
if
err
!=
nil
{
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