Coder Social home page Coder Social logo

Comments (5)

pavlo-fb avatar pavlo-fb commented on May 2, 2024

Hi @deep011

  1. Short answer: yes, expiration time in cold pool will not be the same as in warm pool.
    Long answer: WarmUpRoute was updated in today's release, now it can set the correct expiration time. But it uses META command to achieve this, which is an extension to memcache protocol introduced in facebook fork of memcached (https://github.com/facebookarchive/memcached). This repo is not supported anymore though. The only option I see is to implement META in upstream memcached.
    Currently you can workaround this issue by setting some small exptime in WarmUpRoute to make sure value in cold pool expires faster than in warm pool.

  2. Lets assume the keys are consistent if all sets and deletes to all the replicas succeeded.
    If one uses AllSyncRoute for sets/deletes, mcrouter will return "successful" reply (e.g. STORED/DELETED/NOT_FOUND) only when all replicated requests have succeeded. Client is responsible to retry in case of error, so we can make sure all replicated requests are delivered.

from mcrouter.

deep011 avatar deep011 commented on May 2, 2024

Hi @pavlo-fb
Thank you for this reply.

  1. That is to say if i want keep the expiration time consistent, i must use the facebook fork of memcached?

  2. When one replicated request is successful and another replicated request is failed, is the key in those memcached servers are not same? If so, the next time we get this key, the value maybe dirty. I do not know if you can understand what I mean.

from mcrouter.

alikhtarov avatar alikhtarov commented on May 2, 2024

@deep011

  1. We don't encourage using the old Facebook memcached fork, as it's not supported anymore.
    Basically there's no way to ask open source memcached about the exptime of an item, so there's no way to set the exact exptime on the new item. You can only approximate by setting a smaller exptime intentionally.
  2. Yes, it's possible for a set to succeed in only one replica. Since the second set will fail, the client will think that the whole request "failed", and there are a few options: issue a delete for the same key (assuming deletes are reliable - that can be achieved with a reliable delete log, see asynclog option); or retry the set.

from mcrouter.

deep011 avatar deep011 commented on May 2, 2024

@alikhtarov
thank you for this reply.
For some abnormal situation, if the data are inconsistent among the replicas, what you will do?

from mcrouter.

alikhtarov avatar alikhtarov commented on May 2, 2024

@deep011 Sorry for the late reply. In these cases, if the service cannot tolerate stale data then on the publisher side we check that the set succeeded in all replicas (you can do it with a special config that would route to one replica at a time).

from mcrouter.

Related Issues (20)

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.