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
99c7d87c
Commit
99c7d87c
authored
May 09, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
58c160f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
wcfs/wcfs.go
wcfs/wcfs.go
+4
-4
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+7
-5
No files found.
wcfs/wcfs.go
View file @
99c7d87c
...
...
@@ -810,7 +810,8 @@ retry:
// XXX no indexMu lock needed because head is Locked
δF
:=
bfdir
.
δFtail
.
Update
(
δZ
,
zhead
)
fmt
.
Printf
(
"
\n\n
zδhandle: δF (#%d):
\n
"
,
len
(
δF
.
ByFile
))
if
false
{
fmt
.
Printf
(
"
\n\n
S: zδhandle: δF (#%d):
\n
"
,
len
(
δF
.
ByFile
))
for
file
,
δfile
:=
range
δF
.
ByFile
{
blkv
:=
δfile
.
Blocks
.
Elements
()
sort
.
Slice
(
blkv
,
func
(
i
,
j
int
)
bool
{
...
...
@@ -820,10 +821,10 @@ retry:
if
δfile
.
Size
{
size
=
"S"
}
fmt
.
Printf
(
"
\t
- %s
\t
%s %v
\n
"
,
file
.
zfile
.
POid
(),
size
,
blkv
)
fmt
.
Printf
(
"
S:
\t
- %s
\t
%s %v
\n
"
,
file
.
zfile
.
POid
(),
size
,
blkv
)
}
//time.Sleep(1*time.Second)
fmt
.
Printf
(
"
\n\n
"
)
}
wg
,
ctx
:=
errgroup
.
WithContext
(
context
.
TODO
())
// XXX ctx = ?
for
file
,
δfile
:=
range
δF
.
ByFile
{
...
...
@@ -1486,7 +1487,6 @@ func (wlink *WatchLink) _serveRX() (err error) {
}
e2
:=
wlink
.
sk
.
Close
()
fmt
.
Printf
(
"S: wlink %d: sk.close -> %v
\n
"
,
wlink
.
id
,
e2
)
if
e
==
nil
{
e
=
e2
}
...
...
wcfs/wcfs_test.py
View file @
99c7d87c
...
...
@@ -203,7 +203,7 @@ class tDB:
# perform modifications scheduled by change.
# use !wcfs mode so that we prepare data independently of wcfs code paths.
dF
=
DF
()
for
zf
,
zfDelta
in
t
.
_changed
.
ite
rite
ms
():
for
zf
,
zfDelta
in
t
.
_changed
.
items
():
dfile
=
DFile
()
zfh
=
zf
.
fileh_open
(
_use_wcfs
=
False
)
for
blk
,
data
in
zfDelta
.
iteritems
():
...
...
@@ -211,9 +211,7 @@ class tDB:
data
+=
b'
\
0
'
*
(
zf
.
blksize
-
len
(
data
))
# trailing \0
vma
=
zfh
.
mmap
(
blk
,
1
)
memcpy
(
vma
,
data
)
print
(
' δ f<%s>
\
t
%s'
%
(
h
(
zf
.
_p_oid
),
sorted
(
zfDelta
.
keys
())))
dF
.
byfile
[
zf
]
=
dfile
t
.
_changed
=
{}
# NOTE there is no clean way to retrieve tid of just committed transaction
# we use last._p_serial as workaround.
...
...
@@ -224,7 +222,11 @@ class tDB:
head
=
last
.
_p_serial
t
.
head
=
head
t
.
_headv
.
append
(
head
)
print
(
'commit -> %s'
%
t
.
hat
(
head
))
print
(
'
\
n
M: commit -> %s'
%
t
.
hat
(
head
))
for
zf
,
zfDelta
in
t
.
_changed
.
items
():
print
(
'M: f<%s>
\
t
%s'
%
(
h
(
zf
.
_p_oid
),
sorted
(
zfDelta
.
keys
())))
t
.
_changed
=
{}
dF
.
rev
=
head
for
dfile
in
dF
.
byfile
.
values
():
...
...
@@ -692,8 +694,8 @@ def test_wcfs():
assert w.sendReq(ctx, b"watch %s @%s" % (h(zf._p_oid), h(at1))) == "ok"
wg.go(_)
wg.wait()
"""
print('
\
n
CCC
\
n
')
"""
bg
=
context
.
background
()
...
...
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