aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver
Commit message (Collapse)AuthorAgeFilesLines
...
* fix CacheBucket::CollectGarbage removing standalone entries without an ↵Dan Engelbrecht2023-10-271-4/+7
| | | | exclusive lock (#502)
* block sending error reports from sentry_sink to Sentry unless the log is ↵Dan Engelbrecht2023-10-271-0/+4
| | | | actually an error log (#501)
* eliminate redundant logging code (#499)Stefan Boberg2023-10-253-723/+35
| | | | | | | | | zenutil and zenserver both contain very similar logging setup code and this change aims to make them have most code in common. * fullformatter/jsonformatter/RotatingFileSink are moved into dedicated header files in zenutil * zenserver `InitializeLogging`/`ShutdownLogging` are renamed `InitializeServerLogging`/`InitializeServerLogging` * these now call into the common zenutil `BeginInitializeLogging`/`FinishInitializeLogging` in addition to setting up server custom logging * `std::filesystem::path` is now logged after stripping any `\\\\?\\` prefix for readability
* statsd metrics reporting (#496)Stefan Boberg2023-10-259-14/+194
| | | | | added support for reporting metrics via statsd style UDP messaging, which is supported by many monitoring solution providers this change adds reporting only of three cache related metrics (hit/miss/put) but this should be extended to include more metrics after additional evaluation
* New rotating file logger that keeps on running regardless of errors (#495)Dan Engelbrecht2023-10-251-13/+272
| | | * New rotating file logger that keeps on running regardless of errors
* removed HttpCidStore (#497)Stefan Boberg2023-10-244-165/+0
|
* merge disk and memory layers (#493)Dan Engelbrecht2023-10-2411-1134/+809
| | | | - Feature: Added `--cache-memlayer-sizethreshold` option to zenserver to control at which size cache entries get cached in memory - Changed: Merged cache memory layer with cache disk layer to reduce memory and cpu overhead
* fix m_LastFullGcDuration, m_LastFullGCDiff, m_LastFullGcDuration and ↵Dan Engelbrecht2023-10-231-2/+2
| | | | m_LastLightweightGcDuration stats (#494)
* Remove any unreferenced blocks in block store on open (#492)Dan Engelbrecht2023-10-232-9/+4
| | | * Remove any unreferenced blocks in block store on open
* Filter expired cache entries against ExpiredKeys - not CAS entries to retain ↵Dan Engelbrecht2023-10-231-40/+23
| | | | (#491)
* Don't prune block locations due to missing blocks a startup (#487)Dan Engelbrecht2023-10-202-57/+11
| | | | | | * Don't prune block locations due to missing blocks a startup This makes the behaviour consistent with FileCas - you can have an index that is not fully backed by data. Asking for a location that is not backed by data results in getting an empty result back Also, don't try to GC blocks that are unknown to the block store at the time of snapshot (to avoid removing data that comes in after GatherReferences in GC)
* Cache (rpc) activitity recording improvements (#482)Stefan Boberg2023-10-202-9/+23
| | | | | | | this adds a new RPC recording path aimed at more continuous recording and analysis of recorded sessions the new strategy is implemented alongside the original in order to retain the ability to read the older format the main difference between v2 and v1 is that the new strategy splits the recording into segments which are independent from each other. This is done to enable long running sessions with automatic disk cleanup (not implemented yet), appending to an existing recording (not implemented) and/or partial analysis and processing. The recorder will start a new segment when some criteria is fulfilled, including the number of files in the segment directory, disk footprint etc
* clean up GcContributor and GcStorage to be pure interfaces (#485)Dan Engelbrecht2023-10-204-5/+14
|
* Add --skip-delete option to gc command (#484)Dan Engelbrecht2023-10-202-1/+6
| | | | - Feature: Add `--skip-delete` option to gc command - Bugfix: Fix implementation when claiming GC reserve during GC
* add `flush` command and more gc status info (#483)Dan Engelbrecht2023-10-187-36/+130
| | | | | | - Feature: New endpoint `/admin/flush ` to flush all storage - CAS, Cache and ProjectStore - Feature: New command `zen flush` to flush all storage - CAS, Cache and ProjectStore - Improved: Command `zen gc-status` now gives details about storage, when last GC occured, how long until next GC etc - Changed: Cache access and write log are disabled by default
* added command line option to start server clean (#481)Stefan Boberg2023-10-174-30/+48
| | | when specified with `--clean`, the data directory will be wiped clean at startup
* removed unnecessary vector in ZenCacheMemoryLayer::DropStefan Boberg2023-10-171-3/+2
|
* fix mem layer total count (#480)Dan Engelbrecht2023-10-172-6/+17
| | | * fix calculation of ZenCacheMemoryLayer::m_TotalSize
* minor - fix references size arrayDan Engelbrecht2023-10-171-0/+2
|
* added temporary admin/mi_collect handler (#479)Stefan Boberg2023-10-171-0/+40
| | | allows testing impact of calling mi_collect on a running server
* don't call compact references if caching is not enabled (#478)Dan Engelbrecht2023-10-171-6/+12
|
* rewite state marker at startup (#477)Dan Engelbrecht2023-10-171-6/+4
| | | * rewrite state_marker at startup
* restructured zenhttp (#472)Stefan Boberg2023-10-133-1/+255
| | | separating the http server implementations into a directory and moved diagsvcs into zenserver since it's somewhat hard-coded for it
* faster oplog iteration (#471)Dan Engelbrecht2023-10-135-43/+54
| | | | | * use a CbObjectView instead of CbObject to avoid creating IOBufferCore instances * use BasicFileBuffer directly where possible * changelog
* Merge remote-tracking branch 'origin/main' into zs/default-port-changeStefan Boberg2023-10-121-0/+2
|\
| * adjust resource usage for dedicated servers (#466)Stefan Boberg2023-10-121-0/+2
| | | | | | | | | | | | | | | | | | when dedicated mode is enabled via `--dedicated` or `server.dedicated` then we tune http.sys server settings to be more suitable for a shared server initially we tune two things * the thread pool used to service I/O requests allows a larger number of threads to be created when needed. The minimum thread count is unchanged but in dedicated server mode we double the maximum number of threads allowed * the http.sys request queue length (`HttpServerQueueLengthProperty`) is increased to 50,000 in dedicated mode. The regular default is 1,000
* | Change default port to 8558zousar2023-10-115-6/+6
|/ | | | Changes the default port without altering config for shared instances.
* remove legacy compute interfaces (#461)Stefan Boberg2023-10-1112-3212/+41
| | | | | * removed legacy compute code, which will be replaced with a new implementation in the future * also updated references to Jupiter storage
* fix clang-format whoopsieStefan Boberg2023-10-111-1/+1
|
* added back main thread nameStefan Boberg2023-10-111-0/+2
| | | | this was there before but lost in a merge recently
* cache reference tracking (#455)Dan Engelbrecht2023-10-109-188/+598
| | | | | - Feature: Add caching of referenced CId content for structured cache records, this avoid disk thrashing when gathering references for GC - disabled by default, enable with `--cache-reference-cache-enabled` - Improvement: Faster collection of referenced CId content in project store
* reject bad bucket reads (#456)Stefan Boberg2023-10-093-5/+16
| | | | * extended bad bucket rejection logic to include GET operations as well as PUTs
* minor: remove double includeDan Engelbrecht2023-10-061-1/+0
|
* fix memory usage in memlayer (#454)Dan Engelbrecht2023-10-062-15/+4
| | | * Bugfix: Remove double counting of memory usage in memcachelayer
* fix gc infinite loop (#453)Dan Engelbrecht2023-10-062-9/+17
| | | | * make sure we update last gc time even if gc fails * If we can't check if an oplog/project markerfile exists, assume it is not expired
* zenserver project restructuring (#442)Stefan Boberg2023-10-0610-1533/+1741
|
* reject known bad bucket names in structured cache (#452)v0.2.27-pre0Stefan Boberg2023-10-065-8/+69
| | | | | | | * added string_view helpers for ParseHexBytes/ParseHexNumber * reject known bad buckets in structured cache put handler (32-character hex bucket names are rejected) * also added bucket rejection logic to bucket discovery * added rejected_writes stat to HttpStructuredCache
* ZenCacheMemoryLayer should always store values using memory buffers (#451)Stefan Boberg2023-10-051-3/+4
| | | | | | | | this change fixes a problem where the memory cache layer can inadvertently prevent underlying block store files from being deleted * ensure we get memory buffers on all paths * added more context to error in IoBufferBuilder::ReadFromFileMaybe * fixed problematic pread call success check in IoBufferBuilder::ReadFromFileMaybe which would always report failure on Linux/MacOS
* Fix curruption of disk cache bucket index on GC (#448)Dan Engelbrecht2023-10-052-45/+54
| | | | | | | | | * make sure we hold the index lock when reading payload data in reclaim space * don't use index snapshot when updating index in reclaim space * check that things have not moved under our feet * don't touch m_Payloads without a lock * start write block index on the highest block index * we don't need to bump writeblockindex when stopping write to a block, we will bump appropriately when we start a new block * changelog
* reduce lock in disklayer (#447)Dan Engelbrecht2023-10-051-10/+22
| | | * Don't block all write access to all buckets when doing GatherReferences/CollectGarbage
* added --quiet option to suppress default logging to stdout (#446)Stefan Boberg2023-10-043-3/+14
| | | | added --quiet option for zenserver to suppress default logging to stdout
* fix HandleRpcRequest::WriteResponseAsync trace scope when we are not running ↵Dan Engelbrecht2023-10-041-1/+2
| | | | async
* added thread names (#441)Stefan Boberg2023-10-042-1/+5
| | | added names to process handle GC thread and main thread for easier identification in crash dumps / process monitoring
* refactor comapactcas index (#443)Dan Engelbrecht2023-10-041-3/+10
| | | | | - Bugfix: Fix scrub messing up payload and access time in disk cache bucket when compacting index - Improvement: Split up disk cache bucket index into hash lookup and payload array to improve performance - Improvement: Reserve space up front for compact binary output when saving cache bucket manifest to improve performance
* removed websocket protocol support(#445)Stefan Boberg2023-10-043-50/+10
| | | removed websocket support since it is not used right now and is unlikely to be used in the future
* faster accesstime save restore (#439)Dan Engelbrecht2023-10-034-155/+295
| | | | | | | | | | - Improvement: Reduce time a cache bucket is locked for write when flushing/garbage collecting - Change format for faster read/write and reduced size on disk - Don't lock index while writing manifest to disk - Skip garbage collect if we are currently in a Flush operation - BlockStore::Flush no longer terminates currently writing block - Garbage collect references to currently writing block but keep the block as new data may be added - Fix BlockStore::Prune used disk space calculation - Don't materialize data in filecas when we just need the size
* Handle OOM and OOD more gracefully to not spam Sentry with error reports (#434)Dan Engelbrecht2023-10-021-10/+25
| | | | | | - Improvement: Catch Out Of Memory and Out Of Disk exceptions and report back to reqeuster without reporting an error to Sentry - Improvement: If creating bucket fails when storing and item in the structured cache, log a warning and propagate error to requester without reporting an error to Sentry - Improvement: Make an explicit flush of the active block written to in blockstore flush - Improvement: Make sure cache and cas MakeIndexSnapshot does not throw exception on failure which would cause and abnormal termniation at exit
* Limit size of memory cache layer (#423)Dan Engelbrecht2023-10-027-91/+371
| | | | | | | | - Feature: Limit the size ZenCacheMemoryLayer may use - `--cache-memlayer-targetfootprint` option to set which size (in bytes) it should be limited to, zero to have it unbounded - `--cache-memlayer-maxage` option to set how long (in seconds) cache items should be kept in the memory cache Do more "standard" GC rather than clearing everything. Tries to purge memory on Get/Put on the fly if exceeding limit - not sure if we should have a polling thread instead of adding overhead to Get/Put (however light it may be).
* lightweight gc (#431)Dan Engelbrecht2023-10-026-2/+31
| | | | | | - Feature: Add lightweight GC that only removes items from cache/project store without cleaning up data referenced in Cid store - Add `skipcid` parameter to http endpoint `admin/gc`, defaults to "false" - Add `--skipcid` option to `zen gc` command, defaults to false - Add `--gc-lightweight-interval-seconds` option to zenserver
* Sentry username fix (#435)Stefan Boberg2023-10-011-2/+2
| | | * fix trailing null in Sentry username (GetUserName returns the length including NUL terminator)