aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/blockstore.cpp
Commit message (Collapse)AuthorAgeFilesLines
* improved assert (#37)Dan Engelbrecht2024-04-041-3/+3
| | | | - 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
* validate rpc chunk responses (#36)Dan Engelbrecht2024-04-031-1/+5
| | | * Validate size of found chunks in cas/cache
* add disk caching to block move (#661)Dan Engelbrecht2024-02-271-23/+36
| | | * add disk caching to block move
* improved block store logging and more gcv2 tests (#659)Dan Engelbrecht2024-02-271-16/+52
| | | | * improved gc/blockstore logging * more gcv2 tests
* Add retry with optional resume logic to HttpClient::Download (#639)Dan Engelbrecht2024-01-241-80/+84
| | | | | | | - Improvement: Refactored Jupiter upstream to use HttpClient - Improvement: Added retry and resume logic to HttpClient - Improvement: Added authentication support to HttpClient - Improvement: Clearer logging in GCV2 compact of FileCas/BlockStore - Improvement: Size details in oplog import logging
* Fix crash bug when trying to inspect non-open block file in GC (#614)Dan Engelbrecht2023-12-181-7/+19
|
* log each block that is compacted (#613)Dan Engelbrecht2023-12-151-0/+5
|
* skip invalid chunks when reclaiming space in block store (#607)Dan Engelbrecht2023-12-131-0/+13
| | | * skip invalid chunks when reclaiming space in block store
* improve trace (#606)Dan Engelbrecht2023-12-131-0/+6
| | | | | * 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
* reserve vectors in gcv2 upfront / load factor for robin_map (#582)Dan Engelbrecht2023-12-041-14/+17
| | | | | * 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
* use 32 bit offset and size in BlockStoreLocation (#581)Dan Engelbrecht2023-12-011-18/+23
| | | - Improvement: Reduce memory usage in GC and diskbucket flush
* add separate PreCache step for GcReferenceChecker (#578)Dan Engelbrecht2023-12-011-0/+11
| | | | | | - 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
* gcv2 tests for project store and bugfixes (#571)Dan Engelbrecht2023-11-271-0/+4
| | | * gcv2 tests for project store and bugfixes
* optimized index snapshot reading/writing (#561)Stefan Boberg2023-11-271-6/+25
| | | | | 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
* Add GC Cancel/Stop (#568)Dan Engelbrecht2023-11-241-114/+141
| | | | - 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.
* compact separate for gc referencer (#533)Dan Engelbrecht2023-11-211-21/+86
| | | | | - 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
* don't try to close NewBlockFile if it hasn't been created (#523)Dan Engelbrecht2023-11-081-1/+1
| | | * Don't try to close NewBlockFile if it hasn't been created
* gc v2 tests (#512)Dan Engelbrecht2023-11-061-29/+306
| | | | | | | | | | * 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
* New GC implementation (#459)Dan Engelbrecht2023-10-301-0/+190
| | | - Feature: New garbage collection implementation, still in evaluation mode. Enabled by `--gc-v2` command line option
* added missing includes (#504)Stefan Boberg2023-10-271-0/+1
| | | | | this change adds some includes to files which "inherit" includes from elsewhere this was exposed on another branch when removing some heavy dependencies from central headers
* Remove any unreferenced blocks in block store on open (#492)Dan Engelbrecht2023-10-231-4/+21
| | | * Remove any unreferenced blocks in block store on open
* Don't prune block locations due to missing blocks a startup (#487)Dan Engelbrecht2023-10-201-39/+90
| | | | | | * 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)
* check that block does not exists on disk before starting write to it (#449)Dan Engelbrecht2023-10-051-18/+44
| | | * check that block does not exists on disk before starting write to it
* Fix curruption of disk cache bucket index on GC (#448)Dan Engelbrecht2023-10-051-4/+7
| | | | | | | | | * 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
* faster accesstime save restore (#439)Dan Engelbrecht2023-10-031-39/+45
| | | | | | | | | | - 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-8/+34
| | | | | | - 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
* flush block store blocks when finished (#425)Dan Engelbrecht2023-09-271-0/+1
| | | * flush block store block
* add more trace scopes (#362)Dan Engelbrecht2023-09-151-77/+89
| | | | | * more trace scopes * Make sure ReplayLogEntries uses the correct size for oplog buffer * changelog
* stream oplog attachments from jupiter (#384)Dan Engelbrecht2023-09-061-3/+3
| | | | | | | | | | * stream large downloads from jupiter to temporary file * rework DeleteOnClose - top level marks file for delete and if lower level parts wants to keep it it clears that flag * changelog * log number of attachments to download * add delay on jupiter request failure when retrying * make sure we upload all attachments even if Needs are empty when ForceUpload is true release TempAttachment as soon as it is used * sort attachments so we get predictable blocks for the same oplog
* retry file create (#383)Dan Engelbrecht2023-09-041-2/+23
| | | | | * add retry logic when creating files * only write disk usage log if disk writes are allowed * changelog
* use robinmap in compact cas (#368)Dan Engelbrecht2023-08-211-6/+11
| | | | | * Use robin-map in compactcas for 30% faster CasContainerStrategy::CollectGarbage * use robin_set in ProjectStore::Oplog::GatherReferences and BlockStore::ReclaimSpace * changelog
* CidStore now implements the ChunkResolver interfaceStefan Boberg2023-06-301-4/+8
| | | | | this allows client code to use the ChunkResolver interface instead of CidStore, which can help with testing scenarios
* Additional trace instrumentation (#312)Stefan Boberg2023-05-161-0/+14
| | | | | | | | | * added trace instrumentation to upstreamcache * added asio trace instrumentation * added trace annotations for project store * added trace annotations for BlockStore * added trace annotations for HttpClient * added trace annotations for CAS/GC
* added error reporting for bad BlockStore chunksStefan Boberg2023-05-151-5/+22
| | | | also eliminated some copy-paste
* fix logic for old blocks in blockstore gc (#295)Dan Engelbrecht2023-05-121-21/+24
| | | | | | | * fix logic for old blocks in blockstore gc If we will remove all entries in a block and keep nothing we can't expect for the block to exist. If we want to keep entries in a block, the block must exist, if not error and move entries to delete list. Don't reset output block between blocks we are reading from, keep using it until it exceeds the max limit. * changelog
* if a block is missing during gc, log an error but still continue (#289)Dan Engelbrecht2023-05-111-4/+8
|
* Low disk space detector (#277)Dan Engelbrecht2023-05-091-5/+15
| | | | * - Feature: Disk writes are now blocked early and return an insufficient storage error if free disk space falls below the `--low-diskspace-threshold` value * Never keep an entry in m_ChunkBlocks that points to a nullptr
* Validate that entries points inside valid blocks at startup (#280)Dan Engelbrecht2023-05-091-33/+46
| | | | | * Separate initialization of block store from pruning of unknown blocks * Validate that entries points inside valid blocks
* Treat reading outside of block store file as a not found error. We may ↵Dan Engelbrecht2023-05-021-0/+4
| | | | encounter truncated blocks due to earlier abnormal termination of zenserver or disk failures. (#268)
* moved source directories into `/src` (#264)Stefan Boberg2023-05-021-0/+1312
* moved source directories into `/src` * updated bundle.lua for new `src` path * moved some docs, icon * removed old test trees