summaryrefslogtreecommitdiffstats
path: root/src/server/integrity.c
Commit message (Collapse)AuthorAgeFilesLines
* [SERVER] Remove "working" flag, introduce fine-grained flagsSimon Rettberg2020-03-031-16/+4Star
| | | | | | | | 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".
* [SERVER] Fix checking images without cache mapSimon Rettberg2019-10-291-2/+2
|
* [*] Fix/simplify checks for linuxSimon Rettberg2019-09-171-2/+2
|
* [SERVER] Make integrity checks on startup asyncSimon Rettberg2019-09-101-5/+12
|
* [SERVER] integrity checker: Improve flushing logicSimon Rettberg2019-09-051-89/+110
|
* [SERVER] Use weakref for cache mapsSimon Rettberg2019-08-291-4/+6
| | | | | | 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.
* [SERVER] Speed up shutdown of integrity checkerSimon Rettberg2019-08-281-2/+5
|
* [SERVER] Make signal handling more POSIXSimon Rettberg2019-08-281-4/+13
| | | | | | | | | | | | | | | 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.
* [SERVER] Use reference counting for uplinkSimon Rettberg2019-08-271-9/+8Star
| | | | First step towards less locking for proxy mode
* [SERVER] Add struct representing active connection to uplink serverSimon Rettberg2019-08-181-1/+1
|
* [SERVER] Better lock debugging: Always check lock orderSimon Rettberg2019-08-071-1/+1
| | | | | | Lock order is predefined in locks.h. Immediately bail out if a lock with lower priority is obtained while the same thread already holds one with higher priority.
* [SERVER] Atomicize some global flagsSimon Rettberg2019-08-031-1/+1
|
* [SERVER] Turn all spinlocks into mutexesSimon Rettberg2019-07-261-24/+24
| | | | | | | | Just assume sane platforms offer smart mutexes that have a fast-path with spinlocks internally for locks that have little to no congestion. In all other cases, mutexes should perform better anyways.
* [SERVER] integrity: Group check requests, use sync_file_range()Simon Rettberg2019-02-041-25/+51
| | | | | | | This requires a much shorter queue and balances hashing between different images if the checker lags behind. On Linux, use sync_file_range() instead of fsync() before reading back to speed up flushing.
* [SERVER] Use O_DIRECT for integrity checksSimon Rettberg2018-07-041-26/+55
| | | | | | | | | | | | | | The idea is that for full image checks, we don't want to pollute the fs cache with gigabytes of data that won't be needed again soon. This would certainly hurt performance on servers that dont have hundreds of GBs of RAM. For single block checks during replication this has the advantage that we don't check the block in memory before it hit the disk once, but actually flush the data to disk, then remove it from the page cache, and only then read it again, from disk. TODO: Might be worth making this a config option
* [SERVER] Refactor uplink/cache handling, improve crc checkingSimon Rettberg2018-07-041-12/+76
| | | | | | | | | | | | | 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] Make sure image has read fd before readingSimon Rettberg2018-06-131-0/+6
|
* [SERVER] Fix types or add explicit casts everywhere we might have type ↵Simon Rettberg2017-10-241-1/+1
| | | | conversion problems
* [SERVER] Don't try to load metadata files as images; fix clang-analyzer ↵Simon Rettberg2017-10-181-1/+1
| | | | false positives
* cleanup commitsSebastian2016-02-111-10/+2Star
|
* [SERVER] BREAKING: Get rid of pseudo case-insensitivityv2.1Simon Rettberg2016-02-011-1/+1
| | | | | | | | | | 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-1/+3
|
* [SERVER] Nullpad images virtually at runtime instead of padding the actual fileSimon Rettberg2015-12-101-6/+4Star
|
* [SERVER] Update includes for moved log.hSimon Rettberg2015-12-021-1/+1
|
* [SERVER] Overhauled loggingSimon Rettberg2015-02-221-7/+7
| | | | | | - 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
* Get rid of unneccessary volatileSimon Rettberg2015-02-221-3/+3
| | | | Some minor debugging code, mostly commented out
* [SERVER] Fix two minor bugs: Replication stall, integrity checker 100% CPU usageSimon Rettberg2015-02-041-1/+0Star
|
* [SERVER] Use shared file handle for readingSimon Rettberg2015-01-301-10/+6Star
|
* [SERVER] Crank up warning levels of gcc and fix them all (mostly sign ↵Simon Rettberg2015-01-141-1/+1
| | | | | | | 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] Use stdbool.h for booleans; minor refactoring of variable and ↵Simon Rettberg2014-12-311-5/+5
| | | | function names
* [SERVER] Minor tweaks and improvementsSimon Rettberg2014-12-311-5/+7
|
* Improve uplink handling, add code to debug thread creation/destruction, ↵Simon Rettberg2014-06-161-3/+3
| | | | change stupid convention of freeDiskSpace returning 0 on error, which is ambiguous to the disk simply being full...
* [SERVER] FormattingSimon Rettberg2013-08-191-1/+3
|
* [SERVER] Reduce priority (nice) of integrity check threadSimon Rettberg2013-08-151-0/+7
|
* [SERVER] Name uplink thread, remove most integrity check debug messagesSimon Rettberg2013-08-131-3/+0Star
|
* Test your coke, dork!Simon Rettberg2013-08-131-0/+1
|
* [SERVER] Fix race condition in uplink request aggregation, other small ↵Simon Rettberg2013-08-131-1/+3
| | | | improvements and debugging features
* [SERVER] Improve proxy mode, implement integrity check in proxy modeSimon Rettberg2013-08-121-0/+151