twemproxy
twemproxy copied to clipboard
Tarantool support
Changes in core code:
- the ‘redis’ configuration directive is deprecated by the new ‘protocol’ directive with the following possible values: ‘memcached’, ‘redis’ and ‘tarantool’, with ‘memcached’ being the default. When the ‘redis’ directive is used, a warning is printed on startup. Using both ‘redis’ and ‘protocol’ directives with conflicting values results in an error on startup.
- Tarantool uses a binary protocol, so error messages generation is moved from msg_get_error() to a new handler method, msg->get_error().
- Tarantool clients expect a ‘greeting’ message on connect. To this end, the post_connected() handler method is now also called on a client connect. memcached and redis post_connect() methods are modified to tell between client and server connections.
- A Tarantool server can send out-of-order replies in certain cases. To match responses to requests the ‘sync’ field from request/response headers is used when a connection has a new ‘need_sync’ attribute set to 1, instead if picking the first request from the server’s outgoing queue.
- ‘struct msg’ has a new ‘emitted’ attribute to mark pseudo-request generated on a client connect so that this message is not filtered as empty.
- ‘struct msg’ has a number of new Tarantool-specific fields
- the Tarantool protocol requires a pseudo-random numbers generator (implemented in nc_prng.ch) which is initialized on startup and de-initialized on shutdown.
Is there anything I can do on my end to get this reviewed/merged? Thank you.
Is there any possibility for this to be pushed into master? It would be great.
+1
+1!
Questions:
- Is this patch being actively used in production somewhere? -- I'm more likely to merge this to master if that is the case.
- Would someone take ownership of bugs that show in the 'tarantool' bucket?
- Is there a simple tarantool client that I could use to test this patch?
Hi, let me try to answer your questions. This patch was developed for and is used by Sberbank (sbrf.ru, the largest Russian bank), and is also used now by Avito.ru. Yes, our team will take full responsibility for the bugs in this patch or in twemproxy + this patch. Should you make major changes in the API/twemproxy architecture in the future releases, I think the best way to collaborate is to either give us a heads-up - so that we can fix the patch along, or disable the patch in the upstream in a future release until we rewrite it to support your major changes. Tarantool is an application server, so the client is just an app for the "database". To connect to the database use 'console' package or 'net.box' package in Lua:
- Start in the interactive mode, simply type 'tarantool'
- In the interactive mode, say net = require('net.box'); c = net.new('uri-to-twemproxy-with-the-patch')
- issue net.box requests as usual, docs are here: http://tarantool.org/doc/book/box/net_box.html
@manjuraj hello?
Working on this. Will merge this patch after I finish merging the config reload patch.
@manjuraj Just want to follow up on this. Can we get it merged?
Hello @manjuraj what status of this pull request, it will be merged?
When will you merge it?
When will you merge it?
Any plan to merge this?