aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver
Commit message (Collapse)AuthorAgeFilesLines
* ensure we can build without trace (#619)Stefan Boberg2023-12-192-2/+4
| | | | `xmake config -zentrace=n` would previously not build cleanly
* various TSAN/ASAN/LeakAnalyzer fixes (#622)Stefan Boberg2023-12-191-0/+5
| | | | | | | | | * fix JobQueue test threading issue. The inner job queued with `QueueJob` would reference `I` from inside the captured closure which would subsequently disappear * made sure application exit is thread safe * don't try to access string data out of bounds * keep-alive flag is accessed from multiple threads * fix memory leaks in Zen upstream client code * TSAN fixes for Event
* 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-132-36/+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
* Adding an info command to display a top-level summary of disk space etc (#602)Stefan Boberg2023-12-125-31/+258
| | | | | this also adds a central, shared folder for storing information which may be found by any instance on the host. The directory is currently located alongside the default install and state directory. Initially this is used to store a collection of known `root_manifest` locations and a copy of the latest manifest version which allow us to find all known locations where zen state is present.
* 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.
* added details to trace initialization (#588)Stefan Boberg2023-12-112-4/+4
| | | this adds information on program name and command line to trace initialization
* improved scrubbing of oplogs and filecas (#596)Stefan Boberg2023-12-118-87/+301
| | | | | | - Improvement: Scrub command now validates compressed buffer hashes in filecas storage (used for large chunks) - Improvement: Added --dry, --no-gc and --no-cas options to zen scrub command - Improvement: Implemented oplog scrubbing (previously was a no-op) - Improvement: Implemented support for running scrubbint at startup with --scrub=<options>
* multi-line logging improvements (#597)Stefan Boberg2023-12-111-6/+7
| | | | | | * added ZEN_SCOPED_WARN and implemented multi-line logging * changed so file log also uses `fullformatter` for consistency and to get the multi-line support across the board
* 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
* Merge branch 'main' into zs/get-all-chunk-infoszs/get-all-chunk-infoszousar2023-12-075-21/+80
|\
| * logging configuration via command line options (#589)Stefan Boberg2023-12-063-3/+28
| | | | | | | | | | | | | | with these changes it is possible to configure loggers on the command line. For instance: `xmake run zenserver --log-trace=http_requests,http` will configure the system so that the `http_request` and `http` loggers are set to TRACE level
| * 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
| * HTTP plugin request debug logging (#587)Stefan Boberg2023-12-051-1/+1
| | | | | | | | | | | | * added log level control/query to LoggerRef * added debug logging to http plugin implementation * added GetDebugName() to transport plugin interfaces * added debug name to log output
| * 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
| * Add context to Zen upstream resolve error message (#585)Stefan Boberg2023-12-041-1/+1
| |
| * safe threadpool shutdown (#584)Dan Engelbrecht2023-12-041-1/+2
| | | | | | * shut down thread pools earlier to worker threads has a chance to terminate before main thread atexit
* | Change naming to ChunkInfos instead of Chunkszousar2023-12-064-12/+12
| |
* | Ran precommitzousar2023-12-052-7/+3
| |
* | Get hash when retrieving chunkszousar2023-12-052-7/+32
| | | | | | | | Also changes the returned fields for each chunk from size->rawsize. Backwards compatibility is not a concern as this was unused in past zenserver releases.
* | Add endpoint for all chunk infoszousar2023-12-013-8/+45
|/ | | | Add endpoint for querying all chunk infos in an oplog.
* 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-014-217/+410
| | | | | | - 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-293-22/+11
| | | - Improvement: Use two global worker thread pools instead of ad-hoc creation of worker pools
* moved LuaConfig code so it can be used outside of config.cpp (#575)Stefan Boberg2023-11-283-540/+705
|
* tracing for gcv2 (#574)Dan Engelbrecht2023-11-282-0/+26
| | | | | | - 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`
* gcv2 tests for project store and bugfixes (#571)Dan Engelbrecht2023-11-271-84/+209
| | | * gcv2 tests for project store and bugfixes
* optimized index snapshot reading/writing (#561)Stefan Boberg2023-11-273-469/+802
| | | | | the previous implementation of in-memory index snapshots serialise data to memory before writing to disk and vice versa when reading. This leads to some memory spikes which end up pushing useful data out of system cache and also cause stalls on I/O operations. this change moves more code to a streaming serialisation approach which scales better from a memory usage perspective and also performs much better
* gc stop command (#569)v0.2.36-pre2Dan Engelbrecht2023-11-273-6/+37
| | | | | - Feature: New endpoint `/admin/gc-stop` to cancel a running garbage collect operation - Feature: Added `zen gc-stop` command to cancel a running garbage collect operation - Bugfix: GCv2 - make sure to discover all projects and oplogs before checking for expired data
* Add GC Cancel/Stop (#568)Dan Engelbrecht2023-11-241-11/+60
| | | | - GcScheduler will now cancel any running GC when it shuts down. - Old GC is rather limited in *when* it reacts to cancel of GC. GCv2 is more responsive.
* fix truncation of sentry hostnameDan Engelbrecht2023-11-241-1/+1
|
* Updated branding (#567)Stefan Boberg2023-11-232-3/+3
|
* added --powercycle option (#565)Stefan Boberg2023-11-234-0/+13
| | | | | * added --powercycle option. when this is passed in the zenserver process will shut down immediately after initialization is complete. This is primarily useful when benchmarking init/cleanup but could also be used to verify/clean up disk state * moved EmptyStandbyList code to make it accessible to more commands
* embed html frontend content as binary compiled data (#559)Dan Engelbrecht2023-11-233-2/+7
| | | | | | - Feature: Added xmake task `updatefrontend` which updates the zip file containing the frontend html (`/src/zenserver/frontend/html.zip`) - Improvement: The frontend html content is no longer appended at the end of the executable which prevented signing, instead it is compiled in from the `/src/zenserver/frontend/html.zip` archive - Improvement: MacOS now does ad-hoc code signing by default when issuing `xmake bundle`, signing with proper cert is done on CI builds
* fix block cloning copy argument validation (#560)Stefan Boberg2023-11-221-0/+1
|
* reduce work when there are no blocks to compact (#558)Dan Engelbrecht2023-11-221-54/+61
| | | | * reduce work when there are no blocks to compact * fix lock scopes
* add command line options for compact block threshold and gc verbose (#557)Dan Engelbrecht2023-11-216-7/+81
| | | | | | | | | | | - Feature: Added new options to zenserver for GC V2 - `--gc-compactblock-threshold` GCV2 - how much of a compact block should be used to skip compacting the block, default is 90% - `--gc-verbose` GCV2 - enable more verbose output when running a GC pass - Feature: Added new options to `zen gc` command for GC V2 - `--compactblockthreshold` GCV2 - how much of a compact block should be used to skip compacting the block, default is 90% - `--verbose` GCV2 - enable more verbose output when running a GC pass - Feature: Added new parameters for endpoint `admin/gc` (PUT) - `compactblockthreshold` GCV2 - how much of a compact block should be used to skip compacting the block, default is 90% - `verbose` GCV2 - enable more verbose output when running a GC pass
* compact separate for gc referencer (#533)Dan Engelbrecht2023-11-216-360/+568
| | | | | - Refactor GCV2 so GcReferencer::RemoveExpiredData returns a store compactor, moving out the actual disk work from deleting items in the index. - Refactor GCV2 GcResult to reuse GcCompactStoreStats and GcStats - Make Compacting of stores non-parallell to not eat all the disk I/O when running GC
* Added HTTP verb HEAD to objstore get-object. (#554)Per Larsson2023-11-201-1/+1
| | | | | | | * Added HTTP verb HEAD to objstroe get-object. * Added HTTP verb HEAD to objstore get-object. * Removed HEAD request exception for list-object.
* blocking queue fix (#550)Dan Engelbrecht2023-11-162-16/+29
| | | | | | | | | * make BlockingQueue::m_CompleteAdding non-atomic * ZenCacheDiskLayer::Flush logging * name worker threads in ZenCacheDiskLayer::DiscoverBuckets * name worker threads in gcv2 * improved logging in ZenServerInstance * scrub threadpool naming * remove waitpid handling, we should just call wait to kill zombie processes
* add wipe prevention via file in data root dir (#548)Dan Engelbrecht2023-11-161-3/+18
| | | * if a file named root_manifest.ignore_schema_mismatch exists in the root data dir, ignore schema mismatch
* add zenserver state snapshot support (#543)Stefan Boberg2023-11-163-1/+21
| | | | | this introduces a --snapshot-dir command line option to zenserver which specifies a directory which will be propagated to the persistence root directory on start-up. This is most powerful with file systems which support block cloning, such as ReFS on Windows. This allows even very large state snapshots to be used repeatedly without having to worry about mutating the original dataset on disk. When using ReFS the state copy for even large state directories can be very fast since the duration is primarily proportional to the number of files in the tree rather than the size of the files being cloned. The storage requirements are also minimal as all data will be handled in a copy-on-write manner.
* Trim any leading slash and backslash from bucket prefix. (#541)Per Larsson2023-11-151-0/+2
|
* remove dependency on cxxopts exception types (#542)Stefan Boberg2023-11-151-10/+13
| | | | | | changed options parsing so that we don't depend on cxxopts exception types this makes it possible to use any cxxopts-version including beyond 3.0.0
* Make object store endpoint S3 compatible. (#535)Per Larsson2023-11-153-46/+415
| | | | | * Make object store endpoint S3 compatible. * Removed XML pretty printing and set object store endpoint disabled by default.
* fix race contdition when signaling shutdown of process and waiting for ↵Dan Engelbrecht2023-11-152-4/+6
| | | | completion (#539)
* add host name to sentry (#537)Dan Engelbrecht2023-11-152-7/+51
| | | * add hostname to sentry user id