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
f4ac3442
Commit
f4ac3442
authored
Apr 03, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
340f7659
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
53 deletions
+52
-53
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+52
-3
wcfs/notes.txt
wcfs/notes.txt
+0
-50
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
f4ac3442
...
@@ -22,6 +22,53 @@
...
@@ -22,6 +22,53 @@
// TODO move -> btree when ΔTail matures.
// TODO move -> btree when ΔTail matures.
package
xbtree
package
xbtree
// δ(BTree) notes
// ==============
//
// input: BTree, (@new, []oid) -> find out δ(BTree) i.e. {-k(v), +k'(v'), ...}
//
// - oid ∈ Bucket
// - oid ∈ BTree
//
// Bucket:
//
// old = {k -> v}
// new = {k' -> v'}
//
// Δ = -k(v), +k(v), ...
//
// => for all buckets
//
// Δ accumulates to []δk(v)[n+,n-] n+ ∈ {0,1}, n- ∈ {0,1}, if n+=n- - cancel
//
//
// BTree:
//
// old = {k -> B} or {k -> T}
// new = {k' -> B'} or {k' -> T'}
//
// Δ = -k(B), +k(B), -k(T), +K(T), ...
//
// we translate (in top-down order):
//
// k(B) -> {} of k(v)
// k(T) -> {} of k(B) -> {} of k(v)
//
// which gives
//
// Δ = k(v), +k(v), ...
//
// i.e. exactly as for buckets and it accumulates to global Δ.
//
// The globally-accumulated Δ is the answer for δ(BTree, (@new, []oid))
//
// top-down order is obtained via toposort({oid}) wrt visited PathSet.
//
// δ(BTree) in wcfs context:
//
// . -k(blk) -> invalidate #blk
// . +k(blk) -> invalidate #blk (e.g. if blk was previously read as hole)
//go:generate ../../gen-set δbtree Tree *Tree zset_tree.go
//go:generate ../../gen-set δbtree Tree *Tree zset_tree.go
//go:generate ../../gen-set δbtree Object interface{} zset_object.go
//go:generate ../../gen-set δbtree Object interface{} zset_object.go
...
@@ -110,7 +157,9 @@ func (δb *ΔTail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
...
@@ -110,7 +157,9 @@ func (δb *ΔTail) Track(path []Node) { // XXX Tree|Bucket; path[0] = root
/*
/*
root = path[0]
root = path[0]
for obj in path:
for obj in path:
.rootIdx[obj] += root
if not obj in trackIdx:
.new += obj # XXX .4rebuild += ... ?
.trackIdx[obj] += root
*/
*/
}
}
...
@@ -140,14 +189,14 @@ func (δB *ΔTail) Update(δZ *zodb.EventCommit) {
...
@@ -140,14 +189,14 @@ func (δB *ΔTail) Update(δZ *zodb.EventCommit) {
for root, δZ in δbZ:
for root, δZ in δbZ:
toposort(δZ)
toposort(δZ)
for δ in δZ:
for δ in δZ:
T | B = zconn
.Get(δ) // XXX .zconn
must be at .head and active
T | B = zconn
Old.Get(δ) // XXX .zconnOld
must be at .head and active
T' | B' = zconnNew.Get(δ)
T' | B' = zconnNew.Get(δ)
diff(T, T')
diff(T, T')
diff(B, B')
diff(B, B')
...
...
.
tailv
<- [] of (root, []key)
.
δBtail
<- [] of (root, []key)
*/
*/
}
}
...
...
wcfs/notes.txt
View file @
f4ac3442
...
@@ -182,53 +182,3 @@ Lock request has been issued. Thus the following scenario is possible::
...
@@ -182,53 +182,3 @@ Lock request has been issued. Thus the following scenario is possible::
To avoid such deadlocks zwatcher asks OS cache uploaders to pause while it is
To avoid such deadlocks zwatcher asks OS cache uploaders to pause while it is
running, and retries taking zconnMu.Lock until all uploaders are indeed paused.
running, and retries taking zconnMu.Lock until all uploaders are indeed paused.
δ(BTree) notes (XXX -> btreediff package)
=========================================
input: BTree, (@new, []oid) -> find out δ(BTree) i.e. {-k(v), +k'(v'), ...}
- oid ∈ Bucket
- oid ∈ BTree
Bucket:
old = {k -> v}
new = {k' -> v'}
Δ = -k(v), +k(v), ...
=> for all buckets
Δ accumulates to []δk(v)[n+,n-] n+ ∈ {0,1}, n- ∈ {0,1}, if n+=n- - cancel
BTree:
old = {k -> B} or {k -> T}
new = {k' -> B'} or {k' -> T'}
Δ = -k(B), +k(B), -k(T), +K(T), ...
we translate (in top-down order):
k(B) -> {} of k(v)
k(T) -> {} of k(B) -> {} of k(v)
which gives
Δ = k(v), +k(v), ...
i.e. exactly as for buckets and it accumulates to global Δ.
The globally-accumulated Δ is the answer for δ(BTree, (@new, []oid))
top-down order is obtained via toposort({oid}) wrt visited PathSet.
XXX -> internal/btreediff ?
δ(BTree) in wcfs context:
. -k(blk) -> invalidate #blk
. +k(blk) -> invalidate #blk (e.g. if blk was previously read as hole)
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