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
9f41c041
Commit
9f41c041
authored
Dec 24, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c40f3831
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
21 deletions
+23
-21
wcfs/wcfs.go
wcfs/wcfs.go
+23
-21
No files found.
wcfs/wcfs.go
View file @
9f41c041
...
@@ -165,26 +165,27 @@
...
@@ -165,26 +165,27 @@
//
//
// Protection against slow or faulty clients
// Protection against slow or faulty clients
//
//
// If a client, on purpose or due to a bug or being stopped, is slow to
// If a client, on purpose or due to a bug or being stopped, is slow to
respond
//
respond with ack to invalidation notification, it creates a problem becaus
e
//
with ack to file invalidation notification, it creates a problem because th
e
//
head/data updates will be blocked and thus all other clients that try to
//
server will become blocked waiting for pin acknowledgments, and thus all
//
work with current data
will get stuck.
//
other clients, that try to work with the same file,
will get stuck.
//
//
// To avoid this problem it should be possible for wcfs to stop a client with
// The problem could be avoided, if wcfs would reside in OS kernel and this way
// ptrace and change its address space in a style similar to e.g.
// could be able to manipulate clients address space directly (then
// VirtualAllocEx on Windows. Here is hacky example how this could be done on Linux:
// invalidation protocol won't be needed). It is also possible to imagine
// mechanism, where wcfs would synchronously change clients' address space via
// injecting trusted code and running it on client side via ptrace to adjust
// file mappings.
//
//
// https://gist.github.com/rofl0r/1073739/63f0f788a4923e26fcf743dd9a8411d4916f0ac0
// However ptrace does not work when client thread is blocked under pagefault,
// and that is exactly what wcfs would need to do to process invalidations
// lazily, because eager invalidation processing results in prohibitively slow
// file opens. See internal wcfs overview for details about why ptrace
// cannot be used and why lazy invalidation processing is required.
//
//
// This way there should be no possibility for a client to block wcfs
// Lacking OS primitives to change address space of another process and not
// indefinitely waiting for client's ack.
// being able to work it around with ptrace in userspace, wcfs takes approach
//
// to kill a slow client on 30 seconds timeout by default.
// Similarly for initial mmapings client could first mmap head/data, then open
// head/invalidations and tell the server that it wants Cat revision, with
// the server then remmaping blocks to get to Cat state via ptrace.
//
// However for simplicity the plan is to go first without ptrace and just kill
// a slow client on, say 30 seconds, timeout.
//
//
//
//
// Writes
// Writes
...
@@ -299,7 +300,7 @@ package main
...
@@ -299,7 +300,7 @@ package main
// δFtail.by allows to quickly lookup information by #blk.
// δFtail.by allows to quickly lookup information by #blk.
//
//
// min(rev) in δFtail is min(@at) at which head/data is currently mmapped (see below).
// min(rev) in δFtail is min(@at) at which head/data is currently mmapped (see below).
// XXX min(10 minutes) of history to support initial open
en
ings
// XXX min(10 minutes) of history to support initial openings
//
//
// 7) when we receive a FUSE read(#blk) request to a file/head/data we process it as follows:
// 7) when we receive a FUSE read(#blk) request to a file/head/data we process it as follows:
//
//
...
@@ -336,9 +337,10 @@ package main
...
@@ -336,9 +337,10 @@ package main
// - client.remmap(file, #blk, @rev/data)
// - client.remmap(file, #blk, @rev/data)
// - mmapping.pinned += blk
// - mmapping.pinned += blk
//
//
// remmapping is done synchronously via ptrace.
// remmapping is done via "invalidation protocol" exchange with client.
// XXX via running wcfs-trusted code wcfs injects into clients.
// ( one could imagine adjusting mappings synchronously via running
// FIXME ptrace won't work when client thread is blocked under pagefault or syscall(~).
// wcfs-trusted code via ptrace that wcfs injects into clients, but ptrace
// won't work when client thread is blocked under pagefault or syscall(~) )
//
//
// in order to support remmapping for each file/head/data
// in order to support remmapping for each file/head/data
//
//
...
...
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