Coder Social home page Coder Social logo

flush_all doesn't work about mcrouter HOT 10 CLOSED

facebook avatar facebook commented on May 3, 2024
flush_all doesn't work

from mcrouter.

Comments (10)

0xd3adsh3ll avatar 0xd3adsh3ll commented on May 3, 2024

I tried to clear the cache with command:
echo -ne "flush_all\r\n" | nc 0 5000
SERVER_ERROR Command not supported
But get an error.

Also, my php app can't reset cache via memcache: http://php.net/manual/en/memcache.flush.php

php_app (do action reset_cache)
|
| -- php_method (Memcache::flush ( mcrouter.local:5001 ))
|
| -- part of syslog error: [2015-02-16 13:40:18] project.ERROR: could not connect to memcache {"host":"mcrouter.local","port":5001.....

Can you provide information about rules "how to flush_all/flush_regex via mcrouter", please?
I see of your code:
[mc_op_flushall] = 22 /* flush_all \r\n /,
[mc_op_flushre] = 14 /
flush_regex \r\n /,
[mc_op_stats] = 8 /
stats \r\n */,
Why some of commands works fine (e.g. stats) but some of those doesn't work?

from mcrouter.

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

@0xd3adsh3ll thanks for the report. We explicitly disabled flush_all and flush_regex commands, because it may be very destructive to replicate them via mcrouter (it is very easy to break everything if some broken script sends those commands to production boxes). See https://github.com/facebook/mcrouter/blob/master/mcrouter/McrouterClient.cpp#L33

What is your use case? If it is only for debugging/testing, we can add the support, but guard it with some command line option (like --enable-flush-command or --debug-mode).

from mcrouter.

0xd3adsh3ll avatar 0xd3adsh3ll commented on May 3, 2024

Hello, @pavlo-fb,
Memcache::flush needs for new releases of our projects:

ansible
|
|-- production_servers (remove old code, create new release folder, prepare env)
|-- control_panel (clear all cached data after release because we stored some temporary settings in cache which must be removed.)

I have question, if send flush_all directly on memcached servers bypassing mcrouter? It's possible?
Thanks.

|--

from mcrouter.

ryanmce avatar ryanmce commented on May 3, 2024

Yes, mcrouter doens't modify the behavior of memcached at all, so if you
send a flush all command directly to the memcached server, it will behave
normally.

On Tue, Feb 17, 2015 at 10:10 PM, 0xd3adsh3ll [email protected]
wrote:

Hello, @pavlo-fb https://github.com/pavlo-fb,
Memcache::flush needs for new releases of our projects:

ansible
|
|-- production_servers (remove old code, create new release folder,
prepare env)
|-- control_panel (clear all cached data after release because we stored
some temporary settings in cache which must be removed.)

I have question, if send flush_all directly on memcached servers bypassing
mcrouter? It's possible?
Thanks.

|--


Reply to this email directly or view it on GitHub
#29 (comment).

from mcrouter.

0xd3adsh3ll avatar 0xd3adsh3ll commented on May 3, 2024

@ryanmce, thanks!
If @pavlo-fb can enable: "If it is only for debugging/testing, we can add the support, but guard it with some command line option (like --enable-flush-command or --debug-mode)" It's be a perfectly.

from mcrouter.

0xd3adsh3ll avatar 0xd3adsh3ll commented on May 3, 2024

Hello, @pavlo-fb, @ryanmce tell me please, you can enable "--enable-flush-command"?
Thanks.

from mcrouter.

andreazevedo avatar andreazevedo commented on May 3, 2024

Hello @0xd3adsh3ll,
As @pavlo-fb said, these commands are very dangerous to be replicated via mcrouter. You should consider bypassing mcrouter for these specific statements and sending it straight to the memcached box you intend too.
That being said, if you really think you need/want to use these commands with mcrouter, let me know and I will re-prioritize and get this done for you sooner rather than later.
Thanks.

from mcrouter.

0xd3adsh3ll avatar 0xd3adsh3ll commented on May 3, 2024

Hello @andreazevedo,
Thanks for your reply, I understand the risk but could you please enable "flush_all" via mcrouter, this need for our project.
Thanks.

from mcrouter.

andreazevedo avatar andreazevedo commented on May 3, 2024

Hello @0xd3adsh3ll,
We just pushed a new version of mcrouter that adds support to flush_all (commit 3cb8ca2). You just need to specify the --enable-flush-cmd command-line option.

from mcrouter.

0xd3adsh3ll avatar 0xd3adsh3ll commented on May 3, 2024

Hello @andreazevedo,
Thanks a lot :)
I'm close this ticket. You are awesome! :)

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.