| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
| |
If an image is incomplete, but has no upstream server that can be used
for replication, reload the cache map from disk periodically, in case
some other server instance is writing to the image.
|
| |
|
|
|
|
|
|
|
| |
Cache maps will now be saved periodically, but only if either they have
a "dirty" bit set, which happens if any bits in the map get cleared
again (due to corruption), or if new data has been replicated from an
uplink server. This either means at least one byte received and 5
minutes have passed, or at least 500MB have been downloaded. The timer
currently runs every 20 seconds.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Move CMD_GET_BLOCK out of switch block and mark as likely. Don't acquire
and release cache map for every single request, but keep reference
around and only release when a message other than CMD_GET_BLOCK arrives.
On idle links, this should happen through CMD_KEEPALIVE every now and
then.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Tracking the "working" state of images using one boolean is insufficient
regarding the different ways in which providing an image can fail.
Introduce separate flags for different conditions, like "file not
readable", "file not writable", "no uplink server available", "file
content has changed".
|
| | |
|
| |
|
|
|
| |
If enabled, a failed fallocate will not abort image replication, but
retry with sparse mode.
|
| |
|
|
|
|
|
| |
In proxy mode, when rid 0 is requested, we now first query
our uplink servers for the latest revision and if this fails,
like in non-proxy mode, we'll see what the latest version on
disk is.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
This setting allows you to control the formerly hard-coded timeout of 10
hours before a proxy would start deleting old images in order to free up
space for new images. Setting it to -1 entirely disables automatic
deletion, in case you have an external process for freeing up disk
space.
|
| | |
|
| |
|
|
|
|
| |
Not really namespace but simple string matching for the image path. Path
is matched from start with no support for glob or regex, so usually you
want to have a trailing '/' to limit to certain directories.
|
| |
|
|
|
| |
The score wasn't reset when adding clients to the list, resulting in
exactly one server filling up the whole list.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Initializing the signal in the thread lead to a race
where we would init the uplink and queue a request for it
before the thread actually initialized it. This was not harmful
but lead to spurious warnings in the server's log.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Keeping the uplink thread around forever even though we
disconnected from the upstream server seems wasteful. Get
rid of this and rear down the uplink entirely.
|
| |
|
|
|
|
| |
Gets rid of a bunch of locking, especially the hot path in net.c where
clients are requesting data. Many clients unsing the same incomplete
image previously created a bottleneck here.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to POSIX, a signal sent to a PID can be delivered to an
arbitrary thread of that process that hasn't the signal blocked. This
seens to never happen on Linux, but would mess things up since the code
expected the main signal handler to only be executed by the main thread.
This should now be fixed by examining the destination PID of the signal
as well as the ID of the thread currently running the signal handler. If
we notice the signal wasn't sent by our own PID and the handler is not
currently run by the main thread, we re-send the signal to the main
thread. Otherwise, if the signal was sent by our own PID but the handler
is not run in the main thread, do nothing. This way we can use
pthread_kill() to wake up threads that might be stuck in a blocking
syscall when it's time to shut down.
|
| | |
|
| | |
|
| |
|
|
| |
To be used by "close unused fd" checks, and others...
|
| | |
|
| |
|
|
| |
First step towards less locking for proxy mode
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Alt-Server checks are now run using the threadpool, so we don't need a
queue and dedicated thread anymore. The rtt history is now kept per
uplink, so many uplinks won't overwhelm the history, making its time
window very short.
Also the fail counter is now split up; a global one for when the server
actually isn't reachable, a local (per-uplink) one for when the server
is reachable but doesn't serve the requested image.
|
| | |
|
| | |
|
| |
|
|
|
| |
* Change link to uplink everywhere
* dnbd3_connection_t -> dnbd3_uplink_t
|