Permalink
Commits on Sep 14, 2010
  1. bug 2337, moved MOXI_BLOCKING_CONNECT definition

    Moved to a place where windows can find it, as windows builder doesn't
    appear to use config_static.h.
    
    Change-Id: Ibca5f1b07b025ed58945a1959648324febbe67b5
    Reviewed-on: http://review.northscale.com/2419
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 14, 2010
  2. misc changes for mcmux compatiblity

    1. version, quit and stats proxy are be treated as self commands
       and do not require a prefix
    2. gets should return SERVER_ERROR for a non existent server when
       running in mcmux compatiblity mode
    
    Change-Id: I3b9c231001955d80f4a8274c2f884c31cec2fe2e
    Reviewed-on: http://review.northscale.com/2417
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    mtaneja committed with steveyen Sep 14, 2010
  3. bug 2337, default to blocking connect() on windows platform

    Change-Id: Ic370eef54da59732aa38463c3de9cce48dab169b
    Reviewed-on: http://review.northscale.com/2412
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 14, 2010
  4. stats for connect error cases

    Change-Id: I3d499d69425a6693511e4e0eec8debe5c72f4292
    Reviewed-on: http://review.northscale.com/2403
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 14, 2010
  5. check for downstream_conn_max to limit number of connections

    If moxi reaches a max number of downstream connections (per host_ident
    per thread), the zstored_acquire_downstream_conn() function will
    return that condition (via an extra out param in its API).
    
    After that, the downstream has to wait until there's an available
    downstream_conn, which it does using the new
    zstored_downstream_waiting_add() function (and all the related,
    supporting downstream_waiting_head/tail linked-list/queue management
    code).
    
    As a downstream conn is released, moxi assigns the downstream conn to
    a waiting downstream.
    
    When all downstream conns are closed (for a given host_ident &
    thread), moxi processes any waiting downstreams.
    
    Change-Id: I52e754069a959f319aca545f7de33470892681cc
    Reviewed-on: http://review.northscale.com/2402
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 13, 2010
  6. downstream_waiting_head/tail started

    Change-Id: I061361b34774ec4493383eb9e00a1b988b65e0a2
    Reviewed-on: http://review.northscale.com/2401
    Reviewed-by: Jayesh Jose <jjose@zynga.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 13, 2010
  7. added downstream_conn_max config parsing

    Change-Id: Icef738e732eae3b1205bcdfb50d59b8da6e4c2f6
    Reviewed-on: http://review.northscale.com/2400
    Reviewed-by: Jayesh Jose <jjose@zynga.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 13, 2010
Commits on Sep 13, 2010
  1. windows needs EINPROGRESS, EISCONN

    Change-Id: I5295bd136a9b8cf65d5ef0feaaa54dfccec81cb4
    Reviewed-on: http://review.northscale.com/2312
    Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
    Reviewed-by: Matt Ingenthron <matt@northscale.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 8, 2010
  2. bug 2237 - calling zstored_error_count() more during errors

    A zstored_error_count() invocation was incorrectly being guarded by an
    IF-THEN statement.  So, this fix moves the call out of the IF body,
    but doing so meant having to change zstored_error_count()'s function
    signature (to just take a simple host_ident string).
    
    Also, refactored out a zstored_get_downstream_conns() helper function,
    to handle a case when the zstored_error_count() wasn't counting
    correctly the very first time before moxi had tried its very first
    connection attempt.
    
    Change-Id: I08468db8d767ea555c893d6c39276dc93968b92e
    Reviewed-on: http://review.northscale.com/2378
    Reviewed-by: Matt Ingenthron <matt@northscale.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 13, 2010
  3. connect_max_errors/retry config in stats proxy

    Change-Id: Id1b5df1fb44079fafa1ae67b5beea56840be71cc
    Reviewed-on: http://review.northscale.com/2377
    Reviewed-by: Matt Ingenthron <matt@northscale.com>
    Tested-by: Matt Ingenthron <matt@northscale.com>
    steveyen committed with Matt Ingenthron Sep 13, 2010
Commits on Sep 10, 2010
  1. Add .libs to list of ignored files

    Change-Id: I7137473043bcad450d6347b5f6d114beb611799f
    Reviewed-on: http://review.northscale.com/2365
    Reviewed-by: Dustin Sallings <dustin@spy.net>
    Tested-by: Dustin Sallings <dustin@spy.net>
    trondn committed with dustin Sep 10, 2010
Commits on Sep 9, 2010
  1. conn might be NULL during debug logging

    ...especially for a broadcast command (like stats or flush_all).
    
    Change-Id: I493af84c96bc1e5098b52dc336281aa22a2e32c9
    Reviewed-on: http://review.northscale.com/2302
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 7, 2010
  2. from zstored, 5 sec timeout during non-blocking connect()

    As part of this change, refactored out a update_event_timed() helper
    function.
    
    Change-Id: Idae1834c21cfb35e1030bc1e3f33b9d65a1be46a
    Reviewed-on: http://review.northscale.com/2301
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 7, 2010
Commits on Sep 8, 2010
  1. fix support for unix domain sockets

    Change-Id: Id9efc18e2e5a658bf198cd37b5852a11f1f2a1ef
    Reviewed-on: http://review.northscale.com/2320
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    mtaneja committed with steveyen Sep 8, 2010
  2. mcmux protocol support for moxi

    Added support for ASCII protocol extension to moxi. To enable
    mcmux compatiblity -X option should be passed as one of the command
    line paramters along with the port number that moxi should listen on.
    
    ./moxi -p 11311 -X
    
    when started in this mode, moxi expects the mcmux protocol string
    to be appended before the start of a memcache command.
    An example of an interaction between client and moxi :
    
    A:localhost:11411 get k1
    VALUE k1 0 5
    manik
    END
    
    get k1
    ERROR
    
    Amended version: check for null d->upstream_conn
    Use a stack variable for msst instead of allocating it.
    
    Change-Id: I40d853023c80d08a40113e338e5bb6708e7f4bd9
    Reviewed-on: http://review.northscale.com/2317
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    mtaneja committed with steveyen Sep 8, 2010
  3. connect timeout and retry interval are now runtime configurable

    Usage...
    
      ./moxi -Z connect_max_errors=10,connect_retry_interval=10000,other_flags=here
    
    Change-Id: I8de9e94e9f6e23fa9a8214add476af699c423616
    Reviewed-on: http://review.northscale.com/2289
    Tested-by: Steve Yen <steve.yen@gmail.com>
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 6, 2010
  4. checking MAX_DOWNSTREAM_CONNECTION_ERRORS and DOWNSTREAM_RETRY_INTERVAL

    Change-Id: I2c3574f5564a45cdf916c66261759d6d2276b605
    Reviewed-on: http://review.northscale.com/2288
    Tested-by: Steve Yen <steve.yen@gmail.com>
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 6, 2010
  5. fixed connection leak

    Change-Id: I6542dc05d1569365961e872fe9420dc7eeca6244
    Reviewed-on: http://review.northscale.com/2283
    Reviewed-by: Manik Taneja <mtaneja@zynga.com>
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 6, 2010
  6. tracking connect_failed stat

    Change-Id: Ib783cae1283845909a473a2df08e4a6643037f9a
    Reviewed-on: http://review.northscale.com/2280
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 5, 2010
  7. more assert()

    Change-Id: Ib073e89cd54ca3b5fca8a5fd0631969d3953154b
    Reviewed-on: http://review.northscale.com/2279
    Reviewed-by: Dustin Sallings <dustin@spy.net>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 5, 2010
  8. removed unused downstream_waiting/next_waiting

    Change-Id: I453b6865463035934e364dc74eeb69919ef1a5d2
    Reviewed-on: http://review.northscale.com/2278
    Tested-by: Steve Yen <steve.yen@gmail.com>
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 5, 2010
  9. more stats around acquire/release

    Change-Id: Iafec2e02fd4ee665845db7c8ad153d83bff09377
    Reviewed-on: http://review.northscale.com/2277
    Tested-by: Steve Yen <steve.yen@gmail.com>
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 5, 2010
  10. dead code removal

    Change-Id: I3bb4bb55ba0af75116a68a2106a23883435a10bc
    Reviewed-on: http://review.northscale.com/2271
    Tested-by: Steve Yen <steve.yen@gmail.com>
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 3, 2010
  11. downstream_conn->extra now set/cleared during acquire/release

    The association between a downstream connection and a downstream
    connection is now correctly set or cleared during
    zstored_acquire/release_downstream_conn()
    
    Change-Id: Ifa1687f629fed8882a3f07f9f21f6230aa724be4
    Reviewed-on: http://review.northscale.com/2270
    Tested-by: Steve Yen <steve.yen@gmail.com>
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 3, 2010
  12. updated TODO comment

    Change-Id: I4b1266b788687af6a64fa3cf80756eee7c7573f9
    Reviewed-on: http://review.northscale.com/2266
    Tested-by: Steve Yen <steve.yen@gmail.com>
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 3, 2010
  13. allow conn_connect callback to control drive_machine() loop

    This is useful when a newly connected downstream conn is getting
    assigned to a downstream struct, and we don't actually want
    drive_machine() to go through the conn_pause logic for the newly
    connected downstream conn.
    
    Change-Id: I46d5cf00294c95392c865e7753583bfb8fd290dc
    Reviewed-on: http://review.northscale.com/2265
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 3, 2010
  14. invoking downstream_connect_init() after non-blocking connects()

    Change-Id: Iaa7d361f92a177cca4e7e4d902130744f72da572
    Reviewed-on: http://review.northscale.com/2264
    Tested-by: Steve Yen <steve.yen@gmail.com>
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 3, 2010
  15. cproxy_forward_or_error

    Change-Id: I72add23d34758bf7dd163e2d478ac16eb7faefbe
    Reviewed-on: http://review.northscale.com/2263
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 3, 2010
  16. cproxy_on_connect_downstream_conn hooked up

    Downstream connect() is now non-blocking, leveraging on zstored
    conn_connecting state in drive_machine().
    
    During hookup of this code, refactored out a
    delink_from_downstream_conns() helper func as we want to clear out the
    downstream_conns[] array appropriately during an error.
    
    Change-Id: Ie3941d156ae2bc48bf376c51a09c94bbefafe8bc
    Reviewed-on: http://review.northscale.com/2262
    Tested-by: Steve Yen <steve.yen@gmail.com>
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 2, 2010
  17. NULL_CONN sentinel when connect() fails

    Change-Id: I725e8ab94265b1c1020a466a7ad62dd579c8558b
    Reviewed-on: http://review.northscale.com/2261
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 2, 2010
  18. code convention and wrap long lines

    Change-Id: Ic8a7c608c0176e20051d40710df21c6ae648a658
    Reviewed-on: http://review.northscale.com/2260
    Tested-by: Steve Yen <steve.yen@gmail.com>
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 2, 2010
  19. Compute server_index if possible for zstored_perf improvement.

    If we have a non-broadcast, key-oriented command (like set, delete,
    single-key get), then compute a server_index so that we only use one
    connection rather than trying to get all connections.
    
    Change-Id: Ib3d7ba904d274955241092e54ba80c9d970a9211
    Reviewed-on: http://review.northscale.com/2259
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 2, 2010
  20. added server_index to cproxy_downstream_connect() API

    This allows to caller to specify, with -1, that all downstream
    connections are needed, or that a specific downstream connection
    is needed in order to not wastefully acquire downstream connections
    which the caller won't actually need (for single-key commands).
    
    Change-Id: Ic0af46d0b883a95c97f7686f855aa4f6a99d04b0
    Reviewed-on: http://review.northscale.com/2258
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 2, 2010
  21. removed unused set_hostinfo

    Change-Id: Idaf8de002d737c888261440b6cbb79707fccfa59
    Reviewed-on: http://review.northscale.com/2257
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 2, 2010
  22. zstored_acquire/release_downstream_conn() pass make tests

    They now successfully use the thread->conn_hash to cache downstream
    connections.  The conn_hash is key'ed by host_ident string, and the
    value is a linked list of available (and fully connected) downstream
    connections.
    
    The logic for having downstreams waiting for downstream connections,
    however, is still not integrated.
    
    Change-Id: I3fe9f0528c150cefc75e5d4c6d39050efa77294b
    Reviewed-on: http://review.northscale.com/2256
    Reviewed-by: Steve Yen <steve.yen@gmail.com>
    Tested-by: Steve Yen <steve.yen@gmail.com>
    steveyen committed Sep 2, 2010