diff options
author | dormando <dormando@rydia.net> | 2018-07-16 21:58:43 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2018-08-06 15:11:04 -0700 |
commit | 89bf7ab1cfea2c24d08b9de697215ac7f61a0362 (patch) | |
tree | 25bdbe36326abb864f02caec690c4f4893d65326 /extstore.h | |
parent | 954f4e044b3f1641da66910e4564cd91dfb83712 (diff) | |
download | memcached-89bf7ab1cfea2c24d08b9de697215ac7f61a0362.tar.gz |
extstore JBOD support
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
Diffstat (limited to 'extstore.h')
-rw-r--r-- | extstore.h | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -8,6 +8,7 @@ struct extstore_page_data { uint64_t version; uint64_t bytes_used; unsigned int bucket; + unsigned int free_bucket; }; /* Pages can have objects deleted from them at any time. This creates holes @@ -43,12 +44,23 @@ struct extstore_conf { unsigned int page_size; // ideally 64-256M in size unsigned int page_count; unsigned int page_buckets; // number of different writeable pages + unsigned int free_page_buckets; // buckets of dedicated pages (see code) unsigned int wbuf_size; // must divide cleanly into page_size unsigned int wbuf_count; // this might get locked to "2 per active page" unsigned int io_threadcount; unsigned int io_depth; // with normal I/O, hits locks less. req'd for AIO }; +struct extstore_conf_file { + unsigned int page_count; + char *file; + int fd; // internal usage + uint64_t offset; // internal usage + unsigned int bucket; // free page bucket + unsigned int free_bucket; // specialized free bucket + struct extstore_conf_file *next; +}; + enum obj_io_mode { OBJ_IO_READ = 0, OBJ_IO_WRITE, @@ -87,8 +99,8 @@ enum extstore_res { }; const char *extstore_err(enum extstore_res res); -void *extstore_init(char *fn, struct extstore_conf *cf, enum extstore_res *res); -int extstore_write_request(void *ptr, unsigned int bucket, obj_io *io); +void *extstore_init(struct extstore_conf_file *fh, struct extstore_conf *cf, enum extstore_res *res); +int extstore_write_request(void *ptr, unsigned int bucket, unsigned int free_bucket, obj_io *io); void extstore_write(void *ptr, obj_io *io); int extstore_submit(void *ptr, obj_io *io); /* count are the number of objects being removed, bytes are the original |