aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/cache
Commit message (Collapse)AuthorAgeFilesLines
* move all storage-related services into storage tree (#571)Stefan Boberg2025-10-142-2190/+0
| | | | | | * move all storage-related services into storage tree * move config into config/ * also move admin service into storage since it mostly has storage related functionality * header consolidation
* add ability to limit concurrency (#565)Stefan Boberg2025-10-101-1/+1
| | | | | | | | | | | | effective concurrency in zenserver can be limited via the `--corelimit=<N>` option on the command line. Any value passed in here will be used instead of the return value from `std::thread::hardware_concurrency()` if it is lower. * added --corelimit option to zenserver * made sure thread pools are configured lazily and not during global init * added log output indicating effective and HW concurrency * added change log entry * removed debug logging from ZenEntryPoint::Run() also removed main thread naming on Linux since it makes the output from `top` and similar tools confusing (it shows `main` instead of `zenserver`)
* move rpcrecorder out from cache subfolder (#552)Dan Engelbrecht2025-10-031-1/+1
|
* cacherequests helpers test only (#551)Dan Engelbrecht2025-10-032-14/+4
| | | | * don't use cacherequests utils in cache_cmd.cpp * make zenutil/cacherequests code into test code helpers only
* remove zenutil dependency in zenremotestore (#547)Dan Engelbrecht2025-10-031-2/+2
| | | | | | | | | * remove dependency to zenutil/workerpools.h from remoteprojectstore.cpp * remove dependency to zenutil/workerpools.h from buildstoragecache.cpp * remove unneded include * move jupiter helpers to zenremotestore * move parallelwork to zencore * remove zenutil dependency from zenremotestore * clean up test project dependencies - use indirect dependencies
* cache RPC replay fixes (minor) (#544)Stefan Boberg2025-10-031-1/+1
| | | | | * fixes misleading server side log message when using `--onhost` * fixed `--onhost` behaviour in zen (no longer replays twice)
* make cpr a HttpClient implementation detail (#517)Stefan Boberg2025-09-291-6/+8
| | | | | these changes remove cpr from anything which is not `HttpClient` internals. The goal is to eventually replace cpr with a more direct curl interface to eliminate cpr since it's proven problematic due to their development practices which frequently breaks APIs and prevents us from updating vcpkg. But this PR is limited to refactoring existing cpr code to use `HttpClient` instead.
* Report Incomplete Records To Clientzousar2025-09-241-3/+5
| | | | When requesting partial records, report back when a record is incomplete via an "Incomplete" array of bools that is a sibling to the "Result" array for batch/rpc operations, or via the HttpResponseCode::PartialContent status code for individual record requests.
* Change batch put responses for client reportingzousar2025-09-191-2/+5
| | | | Conflicts are now treated as successes, and we optionally return a Details array instead of an ErrorMessages array. Details are returned for all requests in a batch, or no requests in a batch depending on whether there are any details to be shared about any of the put requests. The details for a conflict include the raw hash and raw size of the item. If the item is a record, we also include the record as an object.
* add EMode to WorkerTheadPool to avoid thread starvation (#492)Dan Engelbrecht2025-09-101-1/+1
| | | - Improvement: Add a new mode to worker thread pools to avoid starvation of workers which could cause long stalls due to other work begin queued up. UE-305498
* add validation of compact binary payloads before reading them (#483)Dan Engelbrecht2025-09-041-25/+42
| | | * add validation of compact binary payloads before reading them
* revert multi-cid store (#475)Dan Engelbrecht2025-08-262-199/+92
|
* per namespace/project cas prep refactor (#470)Dan Engelbrecht2025-08-202-113/+200
| | | | | | | - Refactor so we can have more than one cas store for project store and cache. - Refactor `UpstreamCacheClient` so it is not tied to a specific CidStore - Refactor scrub to keep the GC interface ScrubStorage function separate from scrub accessor functions (renamed to Scrub). - Refactor storage size to keep GC interface StorageSize function separate from size accessor functions (renamed to TotalSize) - Refactor cache storage so `ZenCacheDiskLayer::CacheBucket` implements GcStorage interface rather than `ZenCacheNamespace`
* Merge branch 'main' into zs/put-overwrite-policyzousar2025-06-241-8/+19
|\
| * graceful wait in parallelwork destructor (#438)Dan Engelbrecht2025-06-161-1/+10
| | | | | | | | | | * exception safety when issuing ParallelWork * add asserts to Latch usage to catch usage errors * extended error messaging and recovery handling in ParallelWork destructor to help find issues
| * pause, resume and abort running builds cmd (#421)Dan Engelbrecht2025-06-051-3/+4
| | | | | | | | | | - Feature: `zen builds pause`, `zen builds resume` and `zen builds abort` commands to control a running `zen builds` command - `--process-id` the process id to control, if omitted it tries to find a running process using the same executable as itself - Improvement: Process report now indicates if it is pausing or aborting
| * handle exception with batch work (#401)Dan Engelbrecht2025-05-191-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * use ParallelWork in rpc playback * use ParallelWork in projectstore * use ParallelWork in buildstore * use ParallelWork in cachedisklayer * use ParallelWork in compactcas * use ParallelWork in filecas * don't set abort flag in ParallelWork destructor * add PrepareFileForScatteredWrite for temp files in httpclient * Use PrepareFileForScatteredWrite when stream-decompressing files * be more relaxed when deleting temp files * allow explicit zen-cache when using direct host url without resolving * fix lambda capture when writing loose chunks * no delay when attempting to remove temp files
* | Change to PutResult structurezousar2025-06-241-32/+57
| | | | | | | | Result structure contains status and a string message (may be empty)
* | Establish TODOs and unit test for rejected PUT propagationzousar2025-03-241-0/+3
| |
* | Enforce Overwrite Prevention According To Cache Policyzousar2025-02-261-29/+59
|/ | | | Overwrite with differing value should be denied if QueryLocal is not present and StoreLocal is present. Overwrite with equal value should succeed regardless of policy flags.
* jupiter code cleanup (#276)Dan Engelbrecht2025-01-221-1/+1
| | | | | | | * cleanup jupiter * move jupiter files to separate folder * CloudCache -> Jupiter * split up jupiter files * kill redundant JupiterAccessTokenProvider
* move basicfile.h/cpp -> zencore (#273)Dan Engelbrecht2025-01-161-2/+2
| | | | | | move jupiter.h/cpp -> zenutil move packageformat.h/.cpp -> zenhttp zenutil now depends on zenhttp instead of the inverse
* Memory tracking improvements (#262)Stefan Boberg2024-12-111-0/+4
| | | | | * added LLM tag to properly tag RPC allocations * annotated some more httpsys functions with memory tags * only emit memory scope events if the active tag is different from the new tag
* global open process cache for projectstore (#257)Dan Engelbrecht2024-12-052-3/+6
| | | | * move openprocess cache to central location * enable openprocesscache in projectstore so "getchunks" can send filehandles when requested
* added support for dynamic LLM tags (#245)Stefan Boberg2024-12-021-0/+13
| | | | | * added FLLMTag which can be used to register memory tags outside of core * changed `UE_MEMSCOPE` -> `ZEN_MEMSCOPE` for consistency * instrumented some subsystems with dynamic tags
* caller controls threshold for bulk-loading chunks in IterateChunks (#222)Dan Engelbrecht2024-11-251-2/+4
| | | | | | * Allow caller to control threshold for bulk-loading chunks in IterateChunks * use smaller batch chunk reading for /fileinfos and /chunkinfos as we do not intend to read the payload * use smaller batch read buffer when just querying for size of attachments
* bucket size queries (#203)Dan Engelbrecht2024-10-211-0/+115
| | | - Feature: Added options --bucketsize and --bucketsizes to zen cache-info to get data sizes in cache buckets and attachments
* Added namespace qualifier (optional) for z$ rpc requests (#166)Stefan Boberg2024-09-232-52/+75
| | | This change adds support for a namespace-qualified RPC endpoint for z$ at `/z$/<namespace>/$rpc` which may be used to validate RPC requests by URL inspection. The old scheme is still supported.
* cache optimizations (#88)Dan Engelbrecht2024-05-301-1/+1
| | | | | * message formatting optimizations * bump iostorecompression small value threshold to 1MB
* fix zero size attachment replies (#69)Dan Engelbrecht2024-05-021-1/+9
| | | | - Bugfix: Don't try to respond with zero size partial cache value when partial size is zero - Improvement: Added more validation of data read from cache / cas
* batch cache put (#67)Dan Engelbrecht2024-05-021-5/+11
| | | - Improvement: Batch scope for put of cache values
* InsertChunks for CAS store (#55)Dan Engelbrecht2024-04-221-30/+47
| | | - Improvement: Add batching when writing multiple small chunks to block store - decreases I/O load significantly on oplog import
* clean up test linking (#4)Dan Engelbrecht2024-03-142-280/+2
| | | | | | | - Improvement: Add zenhttp-test and zenutil-test - Improvement: Moved cachepolicy test to cachepolicy.cpp - Improvement: Renamed cachestore tests from z$ to cachestore - Improvement: Moved test linking so test for a lib is linked by <lib>-test - Improvement: Removed HttpRequestParseRelativeUri in httpstructuredcache.cpp and use the one in cacherequests.h instead
* remove reference caching (#658)Dan Engelbrecht2024-02-271-1/+0
| | | * remove reference caching
* changed RPC recording to MPSC setup (#638)Stefan Boberg2024-01-311-21/+1
| | | fixes rare race condition when using RPC recording for long periods of time
* separate RPC processing from HTTP processing (#626)Stefan Boberg2023-12-202-1654/+40
| | | | | | * moved all RPC processing from HttpStructuredCacheService into separate CacheRpcHandler class in zenstore * move package marshaling to zenutil. was previously in zenhttp/httpshared but it's useful in other contexts as well where we don't want to depend on zenhttp * introduced UpstreamCacheClient, this provides a subset of functions on UpstreamCache and lives in zenstore
* move cachedisklayer and structuredcachestore into zenstore (#624)Stefan Boberg2023-12-196-7692/+1
|
* fix ChunkIndexToChunkHash indexing (#621)Stefan Boberg2023-12-191-1/+1
| | | would previously index into a reserved-but-not-sized vector which is bad but not crash-inducing bad
* cache RPC recorder threading fixes (#617)Stefan Boberg2023-12-192-15/+62
| | | | | * ensure all access to m_Entries is done while holding lock * RPC recorder concurrency fixes - setup/teardown of recorder needs to be done while holding an exclusive lock. Calls into recorder should be done while holding a shared lock.
* Don't use copy of Payloads array when fetching memcached payload in GC (#609)Dan Engelbrecht2023-12-131-1/+1
| | | * Don't use copy of Payloads array when fetching memcached payload in GC
* improve trace (#606)Dan Engelbrecht2023-12-131-34/+53
| | | | | * Adding some more trace scopes for better visiblity * Removed spammy trace scope when replaying oplogs * Remove "::Disk" from trace scopes - redundant now that we have merge disk and memory layers
* mem cache perf improvements (#592)Dan Engelbrecht2023-12-112-120/+168
| | | | | | | | - Improvement: Refactor memory cache for faster trimming and correct trim reporting - Improvement: Added trace scopes for memory cache trimming Adding a link back to the cache item payload on the memory cache item allows us to iterate over only the items cached in memory instead of over the entire index. This also allows us to do efficient compact of the memory cache array when trimming. It adds 4 bytes of overhead to each item cached in memory.
* fix deadlock at bucket creation (#598)Dan Engelbrecht2023-12-112-177/+205
| | | | | | - Make sure we don't hold the namespace bucket lock when we create buckets to avoid deadlock - Pass lock scope to helper functions to clarify locking rules - Block flush and gc operations for a bucket that is not yet initialized - Add ZenCacheDiskLayer::GetOrCreateBucket to avoid code duplication
* Use correct iterator index when looking up memcached payload in ↵Dan Engelbrecht2023-12-051-5/+4
| | | | | GatherReferences (#591) * Use correct iterator index when looking up memcached payload in gatherreferences
* reserve vectors in gcv2 upfront / load factor for robin_map (#582)Dan Engelbrecht2023-12-041-5/+20
| | | | | * reserve vectors in gcv2 upfront * set max load factor for robin_map indexes to reduce memory usage * set min load factor for robin_map indexes to allow them to shrink
* memory usage estimation for memcached entries (#586)Dan Engelbrecht2023-12-041-5/+24
| | | | * do a more accurate memory usage estimation for memcached entries * early exit when checking memcache usage
* use 32 bit offset and size in BlockStoreLocation (#581)Dan Engelbrecht2023-12-012-41/+78
| | | - Improvement: Reduce memory usage in GC and diskbucket flush
* add separate PreCache step for GcReferenceChecker (#578)Dan Engelbrecht2023-12-013-203/+381
| | | | | | - Improvement: GCv2: Use separate PreCache step to improve concurrency when checking references - Improvement: GCv2: Improved verbose logging - Improvement: GCv2: Sort chunks to read by block/offset when finding references - Improvement: GCv2: Exit as soon as no more unreferenced items are left
* global thread worker pools (#577)Dan Engelbrecht2023-11-291-10/+5
| | | - Improvement: Use two global worker thread pools instead of ad-hoc creation of worker pools
* tracing for gcv2 (#574)Dan Engelbrecht2023-11-281-0/+14
| | | | | | - Improvement: Added more trace scopes for GCv2 - Bugfix: Make sure we can override flags to "false" when running `zen gc` commmand - `smallobjects`, `skipcid`, `skipdelete`, `verbose`