twemproxy icon indicating copy to clipboard operation
twemproxy copied to clipboard

Tarantool support

Open akopytov opened this issue 10 years ago • 14 comments
trafficstars

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.

akopytov avatar Jan 15 '15 10:01 akopytov

Is there anything I can do on my end to get this reviewed/merged? Thank you.

akopytov avatar Mar 29 '15 12:03 akopytov

Is there any possibility for this to be pushed into master? It would be great.

bigbes avatar Jun 17 '15 15:06 bigbes

+1

zloidemon avatar Jun 17 '15 15:06 zloidemon

+1!

mexicarne avatar Jun 17 '15 15:06 mexicarne

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?

manjuraj avatar Jun 17 '15 16:06 manjuraj

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:

  1. Start in the interactive mode, simply type 'tarantool'
  2. In the interactive mode, say net = require('net.box'); c = net.new('uri-to-twemproxy-with-the-patch')
  3. issue net.box requests as usual, docs are here: http://tarantool.org/doc/book/box/net_box.html

kostja avatar Jun 17 '15 17:06 kostja

@manjuraj hello?

bigbes avatar Jul 01 '15 09:07 bigbes

Working on this. Will merge this patch after I finish merging the config reload patch.

manjuraj avatar Jul 01 '15 14:07 manjuraj

@manjuraj Just want to follow up on this. Can we get it merged?

knazarov avatar Aug 10 '16 13:08 knazarov

Hello @manjuraj what status of this pull request, it will be merged?

Slach avatar Nov 18 '16 05:11 Slach

When will you merge it?

zloidemon avatar Nov 25 '16 08:11 zloidemon

When will you merge it?

baltazorbest avatar May 25 '18 12:05 baltazorbest

Any plan to merge this?

rohitjoshi avatar Nov 15 '18 22:11 rohitjoshi

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jul 18 '19 15:07 CLAassistant