Giter VIP home page Giter VIP logo

memcached-pmem's Introduction

Memcached

Memcached is a high performance multithreaded event-based key/value cache store intended to be used in a distributed system.

See: https://memcached.org/about

A fun story explaining usage: https://memcached.org/tutorial

If you're having trouble, try the wiki: https://memcached.org/wiki

If you're trying to troubleshoot odd behavior or timeouts, see: https://memcached.org/timeouts

https://memcached.org/ is a good resource in general. Please use the mailing list to ask questions, github issues aren't seen by everyone!

Dependencies

Environment

Be warned that the -k (mlockall) option to memcached might be dangerous when using a large cache. Just make sure the memcached machines don't swap. memcached does non-blocking network I/O, but not disk. (it should never go to disk, or you've lost the whole point of it)

Website

Contributing

See https://github.com/memcached/memcached/wiki/DevelopmentRepos

memcached-pmem's People

Contributors

liupeng17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

memcached-pmem's Issues

Various crash consistency bugs for pslab memcached.

Bug 1

  • CAS ID is not persisted, potentially causing atomicity problems for client operations if the persistent memcached service experiences a failure and restarts.

    memcached-pmem/items.c

    Lines 537 to 538 in 8f121f6

    /* Allocate a new CAS ID on link. */
    ITEM_set_cas(it, (settings.use_cas) ? get_cas_id() : 0);

Bug 2

  • CAS ID is updated after item is linked, so even if Bug 1 is fixed (i.e., CAS ID field is made persistent), then it is still possible for the item to be linked before the CAS ID is persisted, leading to the same issue as Bug 1.

    memcached-pmem/items.c

    Lines 537 to 538 in 8f121f6

    /* Allocate a new CAS ID on link. */
    ITEM_set_cas(it, (settings.use_cas) ? get_cas_id() : 0);

Bug 3

  • Time field is updated after item is linked. On a crash, this could cause the item to have an uninitialized time, causing it to be evicted from the service earlier than expected.

memcached-pmem/items.c

Lines 519 to 522 in 8f121f6

it->it_flags |= ITEM_LINKED;
pmem_member_persist(it, it_flags);
it->time = current_time;
pmem_member_persist(it, time);

memcached-pmem/items.c

Lines 134 to 136 in 8f121f6

if ((it->time <= oldest_live)
|| (oldest_cas != 0 && cas != 0 && cas < oldest_cas)) {
return 1;

Memories are not persistent even if the Memcached ends

I leverage Memslap to benchmark this Memcached and the Memcached set as pslab_force model to leverage persistent memory. But lots of memories are not persistent even if the Memcached ends.

For example, in slabs.c, Line 547 to Line 550 have changed persistent memory ITEM but not persist them by using pmem_member_persist() API.

Can you fix them?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.