summaryrefslogtreecommitdiff
path: root/storage.h
Commit message (Collapse)AuthorAgeFilesLines
* core: simplify background IO APIdormando2023-01-111-3/+1
| | | | | | | | - removes unused "completed" IO callback handler - moves primary post-IO callback handlers from the queue definition to the actual IO objects. - allows IO object callbacks to be handled generically instead of based on the queue they were submitted from.
* core: io_queue flow second attemptdormando2021-08-091-1/+1
| | | | | | | | | | | probably squash into previous commit. io->c->thead can change for orpahned IO's, so we had to directly add the original worker thread as a reference. also tried again to split callbacks onto the thread and off of the connection for similar reasons; sometimes we just need the callbacks, sometimes we need both.
* core: io_queue_t flow modedormando2021-08-091-3/+3
| | | | | | | | | | | instead of passing ownership of (io_queue_t)*q to the side thread, instead the ownership of IO objects are passed to the side thread, which are then individually returned. The worker thread runs return_cb() on each, determining when it's done with the response batch. this interface could use more explicit functions to make it more clear. Ownership of *q isn't actually "passed" anywhere, it's just used or not used depending on which return function the owner wants.
* core: restructure IO queue callbacksdormando2020-10-301-2/+10
| | | | | | | | | | | | | | mc_resp is the proper owner of a pending IO once it's been initialized; release it during resp_finish(). Also adds a completion callback which runs on the submitted stack after returning to the worker thread but before the response is transmitted. allows re-queueing for pending IO if processing a response generates another pending IO. also allows a further refactor to run more extstore code on the worker thread instead of the IO threads. uses proper conn_io_queue state to describe connections waiting for pending IO's.
* core: compile io_queue code by defaultdormando2020-10-301-2/+0
| | | | | don't gate on EXTSTORE for the deferred io_queue code. removes a number of ifdef's and allows more clean usage of the interface.
* core: move more storage functions to storage.cdormando2020-10-301-0/+20
| | | | | | | extstore.h is now only used from storage.c. starting a path towards getting the storage interface to be more generalized. should be no functional changes.
* core: generalize extstore's defered IO queuedormando2020-10-301-0/+2
| | | | | | | | | | | | want to reuse the deferred IO system for extstore for something else. Should allow evolving into a more plugin-centric system. step one of three(?) - replace in place and tests pass with extstore enabled. step two should move more extstore code into storage.c step three should build the IO queue code without ifdef gating.
* extstore JBOD supportdormando2018-08-061-0/+1
| | | | | | | | | | | | | | | | Just a Bunch Of Devices :P code exists for routing specific devices to specific buckets (lowttl/compact/etc), but enabling it requires significant fixes to compaction algorithm. Thus it is disabled as of this writing. code cleanups and future work: - pedantically freeing memory and closing fd's on exit - unify and flatten the free_bucket code - defines for free buckets - page eviction adjustment (force min-free per free bucket) - fix default calculation for compact_under and drop_under - might require forcing this value only on default bucket
* split storage writer into its own threaddormando2018-08-031-1/+3
| | | | | | | | | | | trying out a simplified slab class backoff algorithm. The LRU maintainer individually schedules slab classes by time, which leads to multiple wakeups in a steady state as they get out of sync. This algorithm more simply skips that class more often each time it runs the main loop, using a single scheduled sleep instead. if it goes to sleep for a long time, it also reduces the backoff for all classes. if we're barely awake it should be fine to poke everything.
* alignment and 32bit fixes for extstoredormando2018-05-221-0/+3
| | | | | | | | memory alignment when reading header data back. left "32" in a few places that should've at least been a define, is now properly an offsetof. used for skipping crc32 for dynamic parts of the item headers.
* extstore: pause compaction thread with hash expanddormando2017-11-281-0/+2
| | | | could potentially cause weirdness when the hash table is swapped.
* external storage base commitdormando2017-11-281-0/+7
been squashing reorganizing, and pulling code off to go upstream ahead of merging the whole branch.