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
6ec94d4d
Commit
6ec94d4d
authored
Jul 15, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3563e821
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
wcfs/internal/xbtree/xbtreetest/treegen.py
wcfs/internal/xbtree/xbtreetest/treegen.py
+16
-0
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+7
-2
No files found.
wcfs/internal/xbtree/xbtreetest/treegen.py
View file @
6ec94d4d
...
...
@@ -227,6 +227,12 @@ def TreesSrv(zstor, r):
xprint
(
"%s"
%
ashex
(
head
))
continue
# make sure we continue with undeleted ztree/zfile
if
deleted
(
ztree
):
undelete
(
ztree
)
if
deleted
(
zfile
):
undelete
(
zfile
)
# t... D... commands to natively commit updates to tree and values
if
treetxt
.
startswith
(
't'
):
t
,
D
=
treetxt
.
split
()
...
...
@@ -486,8 +492,18 @@ def commitDelete(obj, description): # -> tid
# reset transaction to a new one
transaction
.
begin
()
obj
.
_v_deleted
=
True
return
tid
# deleted reports whether obj was deleted via commitDelete.
def
deleted
(
obj
):
# -> bool
return
getattr
(
obj
,
'_v_deleted'
,
False
)
# undelete forces recreation for obj that was previously deleted via commitDelete.
def
undelete
(
obj
):
obj
.
_p_changed
=
True
del
obj
.
_v_deleted
# ztreetxt returns text representation of a ZODB tree.
@
func
(
ZCtx
)
...
...
wcfs/internal/zdata/δftail.go
View file @
6ec94d4d
...
...
@@ -306,6 +306,7 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
if
err
!=
nil
{
return
ΔF
{},
err
}
//fmt.Printf("zfile<%s> diff %s..%s -> δ: %v\n", oid, headOld, δZ.Tid, δ)
if
δ
!=
nil
{
// XXX rebuild first
...
...
@@ -550,6 +551,7 @@ func (δFtail *ΔFtail) LastBlkRev(ctx context.Context, zf *ZBigFile, blk int64,
func
(
δFtail
*
ΔFtail
)
_LastBlkRev
(
ctx
context
.
Context
,
zf
*
ZBigFile
,
blk
int64
,
at
zodb
.
Tid
)
(
_
zodb
.
Tid
,
exact
bool
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"blkrev f<%s> #%d @%s"
,
zf
.
POid
(),
blk
,
at
)
//fmt.Printf("\nblkrev #%d @%s\n", blk, at)
// XXX locking
// XXX rebuild
...
...
@@ -557,6 +559,7 @@ func (δFtail *ΔFtail) _LastBlkRev(ctx context.Context, zf *ZBigFile, blk int64
// find epoch that covers at and associated blktab root/object
vδE
:=
δftail
.
vδE
//fmt.Printf(" vδE: %v\n", vδE)
l
:=
len
(
vδE
)
i
:=
sort
.
Search
(
l
,
func
(
i
int
)
bool
{
return
at
<
vδE
[
i
]
.
Rev
...
...
@@ -595,6 +598,8 @@ func (δFtail *ΔFtail) _LastBlkRev(ctx context.Context, zf *ZBigFile, blk int64
epoch
=
vδE
[
i
]
.
Rev
}
//fmt.Printf(" epoch: @%s root: %s\n", epoch, root)
// get to rootObj (NOTE @head, because it is ΔBtail.GetAt requirement)
if
rootObj
==
nil
&&
root
!=
xbtree
.
VDEL
{
zconn
:=
zf
.
PJar
()
...
...
@@ -616,7 +621,7 @@ func (δFtail *ΔFtail) _LastBlkRev(ctx context.Context, zf *ZBigFile, blk int64
var
tabRevExact
,
ok
bool
if
rootObj
!=
nil
{
zblkOid
,
ok
,
tabRev
,
tabRevExact
,
err
=
δFtail
.
δBtail
.
GetAt
(
ctx
,
rootObj
,
blk
,
at
)
//fmt.Printf("GetAt #%d @%s -> %s, %v, @%s, %v\n", blk, at, zblkOid, ok, tabRev, tabRevExact)
//fmt.Printf("
GetAt #%d @%s -> %s, %v, @%s, %v\n", blk, at, zblkOid, ok, tabRev, tabRevExact)
if
err
!=
nil
{
return
zodb
.
InvalidTid
,
false
,
err
}
...
...
@@ -635,7 +640,7 @@ func (δFtail *ΔFtail) _LastBlkRev(ctx context.Context, zf *ZBigFile, blk int64
// blktab[blk] was changed to point to a zblk @rev.
// blk revision is max rev and when zblk changed last in (rev, at] range.
zblkRev
,
zblkRevExact
:=
δFtail
.
δBtail
.
ΔZtail
()
.
LastRevOf
(
zblkOid
,
at
)
//fmt.Printf("ZRevOf %s @%s -> @%s, %v\n", zblkOid, at, zblkRev, zblkRevExact)
//fmt.Printf("
ZRevOf %s @%s -> @%s, %v\n", zblkOid, at, zblkRev, zblkRevExact)
if
zblkRev
>
tabRev
{
return
zblkRev
,
zblkRevExact
,
nil
}
else
{
...
...
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