summaryrefslogtreecommitdiffstats
path: root/src/server/altservers.c
Commit message (Collapse)AuthorAgeFilesLines
* [SERVER] Refactor uplink/cache handling, improve crc checkingSimon Rettberg2018-07-041-17/+9Star
| | | | | | | | | | | | | The cacheFd is now moved to the uplink data structure and will only be handled by the uplink thread. The integrity checker now supports checking all blocks of an image. This will be triggered automatically whenever a check for a single block failed. Also, if a crc check on startup fails, the image won't be discarded anymore, but rather a full check will be initiated. Furthermore, when calling image_updateCacheMap() on an image that was previously complete, the cache map will now be re-initialized, and a new uplink connection created.
* [SERVER] Acquire write lock before initializing arraySimon Rettberg2018-04-161-1/+5
|
* [SERVER] altservers: Short timeout during RTT measurement, round request rangeSimon Rettberg2017-11-081-1/+3
| | | | | Rounding to 4k so caching works efficiently This should now close #3231
* [SERVER] rpc: Add q=logfile, q=altservers and q=config to /querySimon Rettberg2017-11-081-0/+30
|
* [SERVER] altservers: Tweak, cleanup, refactor, renameSimon Rettberg2017-11-081-18/+28
|
* [SERVER] Support finer control over replication when a proxy connects to a proxySimon Rettberg2017-11-021-1/+1
| | | | | | | Introduce new flag in "select image" message to tell the uplink server whether we have background replication enabled or not. Also reject a connecting proxy if the connecting proxy uses BGR but we don't, as this would basically force the image to be replicated locally too.
* [*] Mark logadd() as printf-style function, fix errors that it revealedSimon Rettberg2017-10-311-1/+1
| | | | ...there were quite a few format string errors as it turns out :/
* [*] Introduce constants for IPv4/6 in dnbd3_host_tSimon Rettberg2017-10-281-1/+1
| | | | | | | AF_INET luckily was "2" on all platforms checked, so no problems there with interoperation, but AF_INET6 is different between Linux, BSD, Windows and possibly others, so map back and forth between AF_INET/AF_INET6 and HOST_IP4/HOST_IP6 to fix this.
* [SERVER] Improve altserver handling and selectionSimon Rettberg2017-10-251-26/+41
| | | | | | We order the list so that servers that fail are kept at the end of the list. This is so that when we fetch servers for RTT measurement, we're less likely to pick those.
* [SERVER] Initialize PRNGSimon Rettberg2017-10-241-0/+1
|
* [SERVER] Fix types or add explicit casts everywhere we might have type ↵Simon Rettberg2017-10-241-2/+2
| | | | conversion problems
* [SERVER] Use monotonic clock for measuring timeSimon Rettberg2017-10-191-13/+17
| | | | | Introduces new shared source unit timing.[ch] Closes #3214
* [SERVER] More tweaks to alt-server selection wrt proxy cyclesSimon Rettberg2017-10-181-4/+9
| | | | | This needs an overhaul; status needs to be moved from global alt-servers list to individual uplinks
* [SERVER] Try to connect to different server if proxy cycle is detectedSimon Rettberg2017-10-171-7/+17
|
* [*] Support hop-counting in request header, protocol version 3Simon Rettberg2017-10-171-1/+4
| | | | | | | | | | | | | | We steal 8 bits from the request offset to count hops when requests get relayed by proxies. This still leaves plenty of bits for the offset (56 bits, supporting images of up to 72 petabytes). This is used to detect proxy cycles. The algorithm is not perfect but should prevent endless relays of the same request. This is backwards compatible to old clients and servers, as the server only ever sets the hopcount in relayed requests if the upstream server is using protocol version 3 or newer, and clients are automatically upwards compatible as there is practically no image larger than 74PB, so the newly introduced hop count field is always 0 even in requests from old clients.
* [SERVER] Helper function for loading line based space separated data from fileSimon Rettberg2017-10-011-33/+27Star
|
* [SERVER] Fix closing timeout reset, fix log messagesSimon Rettberg2017-09-081-0/+1
|
* [SERVER] Implement closeUnusedFd config optionSimon Rettberg2017-09-021-0/+5
| | | | | | | This will close the readFd of images that have no active clients after some idle period (1 hour currently). Prevents deleted images from taking up space until the server is shut down.
* [*] Continue splitting #defines to clientconfig.h etc.Simon Rettberg2017-09-021-1/+1
|
* [SERVER] Split server-only defs from config.h to serverconfig.hSimon Rettberg2017-08-261-0/+1
|
* [SERVER] Remove stray lineSimon Rettberg2017-04-271-1/+0Star
|
* [SERVER] Fix formattingSimon Rettberg2016-03-221-6/+6
|
* dnbd3server build success on freebsd :)Sebastian2016-02-111-2/+2
|
* cleanup commitsSebastian2016-02-111-12/+0Star
|
* [SHARED] signal.h -> fdsignal.hSimon Rettberg2016-02-101-1/+1
|
* First steps in make signals more abstract from the underlying mechanism; ↵Simon Rettberg2016-02-051-11/+10Star
| | | | | | | | | | replace epoll with poll. We now don't assume that a signal equals a single fd (eventfd on Linux). The next step would be to create a version of signal.c that uses a pipe internally, so it can be used on other platforms, like *BSD. This is also the reason epoll was replaced with poll in uplink.c
* [SERVER] BREAKING: Get rid of pseudo case-insensitivityv2.1Simon Rettberg2016-02-011-10/+10
| | | | | | | | | | This was a wrong decision made long time ago, and it's broken in certain scenarios (eg. two servers serving from same NFS mount). Also it's of limited use anyways since it only supportes ASCII and would ignore umlauts, so blöd and BLÖD would still be considered two different images. So if you relied on this "feature" in any way, be careful when updating.
* [SERVER] Fix a lot of (mostly harmless) data racesSimon Rettberg2016-01-111-7/+28
|
* [SERVER] Nullpad images virtually at runtime instead of padding the actual fileSimon Rettberg2015-12-101-2/+2
|
* [SERVER] Update includes for moved log.hSimon Rettberg2015-12-021-2/+2
|
* [FUSE] Mid-refactoring, does not compileSimon Rettberg2015-11-241-1/+1
|
* [SERVER] Fix race condition potentially leading to use after releaseSimon Rettberg2015-11-231-2/+2
|
* [FUSE] Start refactoring so we can handle multithread fuseSimon Rettberg2015-11-211-2/+2
|
* [FUSE] Integrate into cmake build processSimon Rettberg2015-04-241-1/+1
|
* [SERVER] Correct debug/error messages in altserver.cSimon Rettberg2015-03-051-7/+7
|
* [SERVER] printf -> logadd, make USR2 trigger a log cycle, remove old fake ↵Simon Rettberg2015-02-231-1/+2
| | | | delay feature
* [SERVER] Overhauled loggingSimon Rettberg2015-02-221-16/+16
| | | | | | - Added message type parameter - Log to file and stdout, no more logging in memory - Added options to server.conf to filter which messages show up where
* [SERVER] Crank up warning levels of gcc and fix them all (mostly sign ↵Simon Rettberg2015-01-141-5/+10
| | | | | | | compare and some unused params) Also allow newline at end of alt-servers file without complaining about it not being a valid alt server definition.
* [SERVER] Get rid of epoll in alservers.c, make valgrind+gdb happy by ↵Simon Rettberg2015-01-061-36/+12Star
| | | | handling signals even though we block them
* [SERVER] Use stdbool.h for booleans; minor refactoring of variable and ↵Simon Rettberg2014-12-311-14/+14
| | | | function names
* [SERVER] Create compilation unit for wait/signalling logic (using eventfd)Simon Rettberg2014-12-311-27/+15Star
|
* [SERVER] Fix new sendfile handling, wake up uplink thread if server should ↵Simon Rettberg2014-12-221-0/+2
| | | | be changed
* [SERVER] Improve replication and reconnecting behaviourSimon Rettberg2014-12-221-5/+4Star
|
* [SERVER] Configurable client timeout, adaptive replication speed (to be ↵Simon Rettberg2014-12-221-0/+1
| | | | tested against varying bw/latency), retry sendfile call if ret <= len
* Improve uplink handling, add code to debug thread creation/destruction, ↵Simon Rettberg2014-06-161-17/+30
| | | | change stupid convention of freeDiskSpace returning 0 on error, which is ambiguous to the disk simply being full...
* [SERVER] Minor fixes, add quick and dirty clang support to CMakeLists.txtSimon Rettberg2014-01-091-1/+2
| | | | | | Use 'CC=/usr/local/bin/clang cmake -D_CMAKE_TOOLCHAIN_PREFIX=llvm- ..' to compile using clang. Requires LLVM 3.1 since AddressSanitizer is used for clang debug builds.
* [SERVER] Remove annoying message about cache maps being savedSimon Rettberg2013-12-061-1/+1
|
* [SERVER] Like kernel module, request first block, not random oneSimon Rettberg2013-11-171-4/+2Star
|
* [SERVER] Increase RTT check delay for uplinks that failed too many times to ↵Simon Rettberg2013-11-131-1/+4
| | | | save network bandwidth
* [SERVER] Shut down altservers finder properlySimon Rettberg2013-11-121-4/+6
|