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
358cd09c
Commit
358cd09c
authored
Apr 23, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
95df0951
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
wcfs/wcfs.go
wcfs/wcfs.go
+2
-2
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+11
-3
No files found.
wcfs/wcfs.go
View file @
358cd09c
...
@@ -122,7 +122,7 @@
...
@@ -122,7 +122,7 @@
// clients, that had requested it (separately to each client), about the
// clients, that had requested it (separately to each client), about the
// changes:
// changes:
//
//
// S:
2 pin <bigfileX> #<blk> @<rev_max> XXX 2-> 2*k (multiple pins in parallel)
// S:
<2·k> pin <bigfileX> #<blk> @<rev_max>
//
//
// and waits until all clients confirm that changed file block can be updated
// and waits until all clients confirm that changed file block can be updated
// in global OS cache.
// in global OS cache.
...
@@ -134,7 +134,7 @@
...
@@ -134,7 +134,7 @@
//
//
// and must send ack back to the server when it is done:
// and must send ack back to the server when it is done:
//
//
// C:
2
ack
// C:
<2·k>
ack
//
//
// The server sends pin notifications only for file blocks, that are known to
// The server sends pin notifications only for file blocks, that are known to
// be potentially changed after client's <at>, and <rev_max> describes the
// be potentially changed after client's <at>, and <rev_max> describes the
...
...
wcfs/wcfs_test.py
View file @
358cd09c
...
@@ -129,6 +129,9 @@ class tDB:
...
@@ -129,6 +129,9 @@ class tDB:
t
.
head
=
None
t
.
head
=
None
t
.
_headv
=
[]
t
.
_headv
=
[]
# number of commits made so far
t
.
ncommit
=
0
# fh(.wcfs/zhead) + history of zhead read from there
# fh(.wcfs/zhead) + history of zhead read from there
t
.
_wc_zheadfh
=
open
(
t
.
wc
.
mountpoint
+
"/.wcfs/zhead"
)
t
.
_wc_zheadfh
=
open
(
t
.
wc
.
mountpoint
+
"/.wcfs/zhead"
)
t
.
_wc_zheadv
=
[]
t
.
_wc_zheadv
=
[]
...
@@ -164,6 +167,7 @@ class tDB:
...
@@ -164,6 +167,7 @@ class tDB:
data
+=
b'
\
0
'
*
(
zf
.
blksize
-
len
(
data
))
# trailing \0
data
+=
b'
\
0
'
*
(
zf
.
blksize
-
len
(
data
))
# trailing \0
vma
=
zfh
.
mmap
(
blk
,
1
)
vma
=
zfh
.
mmap
(
blk
,
1
)
memcpy
(
vma
,
data
)
memcpy
(
vma
,
data
)
print
(
' δ f<%s>
\
t
%s'
%
(
h
(
zf
.
_p_oid
),
sorted
(
zfDelta
.
keys
())))
t
.
_changed
=
{}
t
.
_changed
=
{}
# NOTE there is no clean way to retrieve tid of just committed transaction
# NOTE there is no clean way to retrieve tid of just committed transaction
...
@@ -173,7 +177,8 @@ class tDB:
...
@@ -173,7 +177,8 @@ class tDB:
transaction
.
commit
()
transaction
.
commit
()
head
=
last
.
_p_serial
head
=
last
.
_p_serial
#print('commit -> %s' % h(head))
t
.
ncommit
+=
1
print
(
'commit -> @%s
\
t
# @at%d'
%
(
h
(
head
),
t
.
ncommit
))
t
.
head
=
head
t
.
head
=
head
t
.
_headv
.
append
(
head
)
t
.
_headv
.
append
(
head
)
return
head
return
head
...
@@ -533,6 +538,9 @@ def test_wcfs():
...
@@ -533,6 +538,9 @@ def test_wcfs():
t
.
stat
(
nonfile
)
t
.
stat
(
nonfile
)
assert
exc
.
value
.
errno
==
EINVAL
assert
exc
.
value
.
errno
==
EINVAL
# reset ncommit so that atX in the code correspond with debug output
t
.
ncommit
=
0
# >>> file initially empty
# >>> file initially empty
f
=
t
.
open
(
zf
)
f
=
t
.
open
(
zf
)
f
.
assertCache
([])
f
.
assertCache
([])
...
@@ -612,8 +620,8 @@ def test_wcfs():
...
@@ -612,8 +620,8 @@ def test_wcfs():
@
func
@
func
def
_
():
def
_
():
defer
(
done
.
close
)
defer
(
done
.
close
)
pinv
=
w
.
expectPin
([(
zf
,
2
,
at1
),
(
zf
,
3
,
at
1
)])
pinv
=
w
.
expectPin
([(
zf
,
2
,
at1
),
(
zf
,
3
,
at
2
)])
#pinv = w.expectPin({zf: [(2, at1), (3, at
1
)]}) XXX <- this way better? (sugar)
#pinv = w.expectPin({zf: [(2, at1), (3, at
2
)]}) XXX <- this way better? (sugar)
for
p
in
pinv
:
for
p
in
pinv
:
p
.
ack
()
p
.
ack
()
go
(
_
)
go
(
_
)
...
...
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