aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
Commit message (Collapse)AuthorAgeFilesLines
* improved assert (#37)Dan Engelbrecht2024-04-043-10/+80
| | | | - Improvement: Add file and line to ASSERT exceptions - Improvement: Catch call stack when throwing assert exceptions and log/output call stack at important places to provide more context to caller
* add yaml serialization support (#3)Stefan Boberg2024-03-261-2/+30
| | | | | | | this change adds serialization of payloads as YAML, but not parsing. The implementation is somewhat based on the JSON path, and may be collapsed eventually as it is possible to serialize JSON format using the same code it also separates out the JSON serialization into a separate file for ease of maintenance any HTTP request response may be formatted as yaml by using a `.yaml` suffix or an `Accept: text/yaml` header
* harden attach sponsor process (#14)Dan Engelbrecht2024-03-211-1/+1
| | | | | - Improvement: Delay exiting due to no sponsor processes by one second to handle race conditions - Improvement: Safer IsProcessRunning check - Improvement: make sure we can RequestApplicationExit safely from any thread
* improved process monitoring behaviour with invalid pids (#16)Stefan Boberg2024-03-211-0/+1
|
* non memory copy compressed range (#13)Dan Engelbrecht2024-03-201-0/+32
| | | | | * Add CompressedBuffer::GetRange that references source data rather than make a memory copy * Use Compressed.CopyRange in project store GetChunkRange * docs for CompressedBuffer::CopyRange and CompressedBuffer::GetRange
* special treatment large oplog attachments v2 (#5)Dan Engelbrecht2024-03-141-4/+6
| | | | | - Bugfix: Install Ctrl+C handler earlier when doing `zen oplog-export` and `zen oplog-export` to properly cancel jobs - Improvement: Add ability to block a set of CAS entries from GC in project store - Improvement: Large attachments and loose files are now split into smaller chunks and stored in blocks during oplog export
* Add WriteMeasuredVarUInt to avoid measuring ints twice before writing (#665)Dan Engelbrecht2024-03-061-9/+37
| | | | Avoid double resize of buffer in CbWriter::SetName and CbWriter::AddBinary Add WriteMeasuredVarUInt to avoid measuring ints twice before writing
* improved block store logging and more gcv2 tests (#659)Dan Engelbrecht2024-02-271-0/+9
| | | | * improved gc/blockstore logging * more gcv2 tests
* hashing fixes (#657)Dan Engelbrecht2024-02-261-0/+12
| | | | | * move structuredcachestore tests to zenstore-test * Don't materialize entire files when hashing if it is a large files * rewrite CompositeBuffer::Mid to never materialize buffers
* Save compressed large attachments to temporary files on disk (#650)Dan Engelbrecht2024-02-121-6/+2
| | | | | | | | | * Save large compressed large attachments to temporary files on disk * bump oplog block max size up to 64Mb again * Make sure CompositeBuffer::AppendBuffers actually moves inputs when it should * removed parallell execution of fetching payload for block assembly it was not actually helping and added complexity * make sure we move/release payload buffers as soon as possible * make sure we don't read in full large attachments to memory when computing hash
* compress large attachments on demand (#647)Dan Engelbrecht2024-02-051-2/+2
| | | | | | | - Improvement: Speed up oplog export by fetching/compressing big attachments on demand - Improvement: Speed up oplog export by batch-fetcing small attachments - Improvement: Speed up oplog import by batching writes of oplog ops - Improvement: Tweak oplog export default block size and embed size limit - Improvement: Add more messaging and progress during oplog import/export
* changed RPC recording to MPSC setup (#638)Stefan Boberg2024-01-311-1/+1
| | | fixes rare race condition when using RPC recording for long periods of time
* jobqueue - allow multiple threads to report progress/messages (#635)Dan Engelbrecht2024-01-221-0/+1
| | | jobqueue - add AbortReason and properly propagate error when running async command
* remove use of <random> in stats (#628)Stefan Boberg2024-01-101-1/+2
| | | | the previous implementation was quite slow due to use of mt and uniform_distribution.
* ensure we can build without trace (#619)Stefan Boberg2023-12-191-0/+1
| | | | `xmake config -zentrace=n` would previously not build cleanly
* various TSAN/ASAN/LeakAnalyzer fixes (#622)Stefan Boberg2023-12-191-1/+6
| | | | | | | | | * 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
* implement cache recording segment split by age (#611)Stefan Boberg2023-12-141-5/+31
| | | - also fixes weird DateTime/TimeSpan comparison operator
* Make sure IoBuffer is a valid null-buffer after move operation (#610)Dan Engelbrecht2023-12-141-4/+13
|
* Merge branch 'main' of https://github.com/EpicGames/zenStefan Boberg2023-12-1112-104/+230
|\
| * added details to trace initialization (#588)Stefan Boberg2023-12-111-2/+2
| | | | | | this adds information on program name and command line to trace initialization
| * improved scrubbing of oplogs and filecas (#596)Stefan Boberg2023-12-111-0/+13
| | | | | | | | | | | | - 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-0/+8
| | | | | | | | | | | | * 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
| * logging configuration via command line options (#589)Stefan Boberg2023-12-061-0/+4
| | | | | | | | | | | | | | 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
| * HTTP plugin request debug logging (#587)Stefan Boberg2023-12-051-0/+3
| | | | | | | | | | | | * 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
| * global thread worker pools (#577)Dan Engelbrecht2023-11-291-0/+1
| | | | | | - Improvement: Use two global worker thread pools instead of ad-hoc creation of worker pools
| * optimized index snapshot reading/writing (#561)Stefan Boberg2023-11-272-0/+5
| | | | | | | | | | 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
| * compact separate for gc referencer (#533)Dan Engelbrecht2023-11-211-0/+18
| | | | | | | | | | - 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
| * zen run command (#552)Stefan Boberg2023-11-212-0/+7
| | | | | | | | | | | | | | | | | | | | initial version -- this is primarily intended to be used for running stress tests and/or benchmarks example usage: `zen run -n 10 -- zenserver-test` `zen run -n 10 -- zenserver-test --ts=core.assert` run zenserver-test 10 times (testing only the `core.assert` test suite) `zen run --time 600 --basepath=d:\test_dir\test1 -- zenserver-test` keeps spawning new instances for 10 minutes (600 seconds)
| * basic ZEN_ASSERT_FORMAT implementation (#556)Stefan Boberg2023-11-211-0/+48
| | | | | | includes porting some compact binary builder code to use it since it had vestiges of the UE-side asserts
| * moved process handling code into separate h/cpp (#555)Stefan Boberg2023-11-202-80/+94
| |
| * fix named event (#553)Dan Engelbrecht2023-11-171-11/+13
| | | | | | * fix named event timout and test, fix blocking queue
| * blocking queue fix (#550)Dan Engelbrecht2023-11-161-12/+10
| | | | | | | | | | | | | | | | | | * 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 zenserver state snapshot support (#543)Stefan Boberg2023-11-161-1/+1
| | | | | | | | | | 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.
| * changed posix event implementation to use std::atomic instead of volatile (#547)Stefan Boberg2023-11-161-1/+3
| |
| * Make object store endpoint S3 compatible. (#535)Per Larsson2023-11-151-0/+3
| | | | | | | | | | * Make object store endpoint S3 compatible. * Removed XML pretty printing and set object store endpoint disabled by default.
* | removed unnecessary SHA1 referencesStefan Boberg2023-12-112-2/+0
|/
* gc history log (#519)Dan Engelbrecht2023-11-132-0/+9
| | | | | - Feature: Writes a `gc.log` with settings and detailed result after each GC execution (version 2 only) - Break out file name rotate to allow access for gclog - CompactBinaryToJson(MemoryView Data, StringBuilderBase& InBuilder)
* fmt compilation fix for fmt v10+new vs build (#529)Stefan Boberg2023-11-131-8/+15
| | | VS 17.7.6 triggers some new compilation errors with certain versions of fmt::make_format_args. This should fix those errors. I don't fully understand why this is necessary, sadly my c++-fu is not strong enough.
* factored out some compiler definitions etc into zenbase (#517)Stefan Boberg2023-11-0713-574/+40
| | | | | this is a header-only library which mostly contains definitions to support different platforms and compilers. It is part of the zen codebase but is intended to be consumable separately to zenbase etc to support standalone transport plug-ins and similar.
* spdlog implementation hiding (#498)Stefan Boberg2023-11-065-142/+270
| | | | | | | | | this change aims to hide logging internals from client code, in order to make it easier to extend and take more control over the logging process in the future. As a bonus side effect, the generated code is much tighter (net delta around 2.5% on the resulting executable which includes lots of thirdparty code) and should take less time to compile and link. Client usage via macros is pretty much unchanged. The main exposure client code had to spdlog internals before was the use of custom loggers per subsystem, where it would be common to have `spdlog::logger` references to keep a reference to a logger within a class. This is now replaced by `zen::LoggerRef` which currently simply encapsulates an actual `spdlog::logger` instance, but this is intended to be an implementation detail which will change in the future. The way the change works is that we now handle any formatting of log messages in the zencore logging subsystem instead of relying on `spdlog` to manage this. We use the `fmt` library to do the formatting which means the client usage is identical to using `spdlog`. The formatted message is then forwarded onto any sinks etc which are still implememted via `spdlog`.
* gc v2 tests (#512)Dan Engelbrecht2023-11-061-1/+8
| | | | | | | | | | * set MaxBlockCount at init * properly calculate total size * basic blockstore compact blocks test * correct detection of block swap * Use one implementation for CreateRandomBlob * reduce some data sets to increase speed of tests * reduce test time * rename BlockStoreCompactState::AddBlock -> BlockStoreCompactState::IncludeBlock
* keep a "null" iobuffer core to reduce redundant memory allocations (#507)Dan Engelbrecht2023-11-061-1/+5
|
* only measure a variable integer once where we can (#500)Dan Engelbrecht2023-10-251-5/+17
|
* eliminate redundant logging code (#499)Stefan Boberg2023-10-251-1/+10
| | | | | | | | | 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-251-0/+1
| | | | | 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
* typedef for std streaming to StringBuilderStefan Boberg2023-10-201-0/+2
|
* explicit ChunkingLinearAllocatorStefan Boberg2023-10-201-1/+1
|
* Cache (rpc) activitity recording improvements (#482)Stefan Boberg2023-10-201-1/+1
| | | | | | | 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
* added explicit implementation of IoHash equals operator (#464)Stefan Boberg2023-10-111-0/+2
| | | | | | | | | * added explicit implementation of IoHash equals and less than operator using memcpy This improves codegen on MSVC in particular. Without this the operator is not inlined and consists of 20 individual (not in a loop) byte-by-byte comparisons each with an associated branch. With this change we get three comparisons (two uint64, one uint32) and three branches. So less pressure on branch predictors and as the code gets inlined the predictor should hopefully also function better.
* minor fixes to zencore (#457)Stefan Boberg2023-10-091-1/+1
| | | | * AssertException constructor should be explicit * removed pragma comment