Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Oct 27, 2011
  1. @mikewied

    Issue-211: Fix javadoc warnings from tap and vbucket class.

    mikewied authored mikewied committed
    Change-Id: I209a474cbd3fb153c0c95701e5943aaa2560b5cd
    Reviewed-on: http://review.couchbase.org/10328
    Tested-by: Michael Wiederhold <mike@couchbase.com>
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Commits on Oct 14, 2011
  1. @ingenthr

    Continue to other URIs if one in the list is down. SPY-60.

    ingenthr authored ingenthr committed
    Change-Id: Ic68ba9db5b5f645d3affc6964f7b2b90d309e519
    Reviewed-on: http://review.couchbase.org/10026
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Matt Ingenthron <matt@couchbase.com>
Commits on Oct 11, 2011
  1. @ingenthr @mikewied

    Revert "SPY-37 & SPY-38: Fixed redistribution performance issue"

    ingenthr authored mikewied committed
    This reverts commit 48e7e62.
    
    Change-Id: I9f6bc488406fc9c5ce537454b773d9baf21e379d
    Reviewed-on: http://review.couchbase.org/10059
    Tested-by: Michael Wiederhold <mike@couchbase.com>
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Commits on Oct 9, 2011
  1. @ingenthr @mikewied

    No need for old debugging string in test.

    ingenthr authored mikewied committed
    Change-Id: I31ad1af2e6d0a33fa8534fa09e3f30175b931408
    Reviewed-on: http://review.couchbase.org/10027
    Tested-by: Michael Wiederhold <mike@couchbase.com>
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Commits on Oct 8, 2011
  1. @magro @ingenthr

    Add compatibility with netty 3.2.0+.

    magro authored ingenthr committed
    Netty 3.2.0+ (NETTY-281) changed HttpMessage.setHeader(String, String) to
    setHeader(String, Object), which causes NoSuchMethodErrors when spymemcached is
    used with such a newer netty version. To prevent spymemcached users from other
    library incompatibilities the netty dependency is not upgraded, but the
    appropriate setHeader method is selected and invoked at runtime. This was
    discussed on the mailing list:
    http://groups.google.com/group/spymemcached/browse_thread/thread/4b9f0638bbcc96fb
    
    Change-Id: I1d2e7c4a3e6db6648d175364950eab6076a45e5f
    Reviewed-on: http://review.couchbase.org/9852
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Matt Ingenthron <matt@couchbase.com>
Commits on Oct 7, 2011
  1. @mikewied @ingenthr

    Refactored tap message classes.

    mikewied authored ingenthr committed
    These needed to be more readable and were horribly coded (by me). I
    started seeing issues with conversion from bytes on the wire to
    variables in spy so I changed how this was done.
    
    Change-Id: I583c43216643b111b6256f39ca475582b37267c6
    Reviewed-on: http://review.couchbase.org/9712
    Tested-by: Matt Ingenthron <matt@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Commits on Oct 3, 2011
  1. @mikewied

    SPY-37 & SPY-38: Fixed redistribution performance issue

    mikewied authored mikewied committed
    This issue was caused by a O(n^3) algorithm used when redistributing
    operations among nodes. It turns out that one of the loops was not
    necessary because the clone operation is guaranteed to return a
    list of single key operations. Multi-key operations are never
    returned as part of this list.
    
    The fix involves removing the one of these loops. which frequently
    queued duplicate operations for transmission. Since the
    operations are all single key, the list returned by the call
    getKeys() is guaranteed to have only one operation.
    
    Change-Id: Id8cf17132bff06dba78935cbb8b81d83f58b4bc2
    Reviewed-on: http://review.couchbase.org/9514
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
Commits on Sep 29, 2011
  1. @mikewied

    Made vbmap in MultiKey operation synchronized

    mikewied authored mikewied committed
    There was a concurrency issue here that has to do with accessing a
    two threads accessing the same set. One thread is iterating over
    the set and the other is modifying the set. This modification
    causes iteration to undefined and therefore java throws an error.
    
    Change-Id: I17ea7a0146443ed1ef4578fb04cab431a3e723d7
    Reviewed-on: http://review.couchbase.org/9769
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
Commits on Sep 25, 2011
  1. @mikewied

    Don't reconnect when a tap connection finishes.

    mikewied authored mikewied committed
    Change-Id: I7c70697bdd8f67f451c514193ae2d6fa2856dfc7
    Reviewed-on: http://review.couchbase.org/9711
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
Commits on Sep 24, 2011
  1. @mikewied

    Flush the PrintWriter in TapMessagePrinter

    mikewied authored mikewied committed
    This doesn't print anything until you flush.
    
    Change-Id: Icc98b26ecb1da4c9f3dbf96f9e827801f3b807b1
    Reviewed-on: http://review.couchbase.org/9710
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
  2. @mikewied

    Removed extra variables in tapCustom header

    mikewied authored mikewied committed
    We abandoned my rudamentry key/value filter change a while ago but
    the tapCustom signature was never updated.
    
    Change-Id: I76cea19b3b74cceee3316f39d0565b9959547867
    Reviewed-on: http://review.couchbase.org/9674
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
Commits on Sep 22, 2011
  1. @mikewied

    Removed a print line statement from TestConfig

    mikewied authored mikewied committed
    Change-Id: I9f060ab36a407eb91dd3a8b784cd7c854e2d706d
    Reviewed-on: http://review.couchbase.org/9713
    Tested-by: Michael Wiederhold <mike@couchbase.com>
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Commits on Sep 20, 2011
  1. @mikewied

    Made cmd variable a byte for binary operations

    mikewied authored mikewied committed
    This variable should have never been an int since it is defined in
    the protocol as a byte. The reason for the change is that when we
    have opcode that is greater have 127 the value of a byte and an int
    are different (Ex. int = 128 byte = -127). This was causing an
    assertion to fail, in this case for the getl command (0x94).
    
    Change-Id: Ia6b32a4af94ed2e8dc973237132f3fd291655634
    Reviewed-on: http://review.couchbase.org/9476
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
  2. @mikewied

    SPY-51: Bug in OperationImpl's decodeLong(2)

    sanada0670 authored mikewied committed
    We were incrrectly decoding long values here. For example,
    
    0 0 0 1 0 0 0 0
    
    was being decoded as 1, but should have been 4294967296.
    
    Change-Id: I1a5eed9d8f96d9d9dd83d251794b68840f595621
    Reviewed-on: http://review.couchbase.org/9428
    Tested-by: Michael Wiederhold <mike@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Reviewed-by: Dustin Sallings <dustin@spy.net>
Commits on Sep 12, 2011
  1. @mikewied

    Send an ack for all tap opaque messages

    mikewied authored mikewied committed
    Previously we ignored tap opaque and no-op messages. This caused
    us to hang tap streams in some cases. One example is when doing a
    tap dump. The server would send an opaque message and wait for an
    ack after transmitting all of the data. Since we ignored the opaque
    message the server would wait for an ack that would never be sent.
    This would cause the connection to hang.
    
    Change-Id: If8fc5e7f8b6aeb41ed68c2acb03fba5b7e503836
    Reviewed-on: http://review.couchbase.org/9526
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
  2. @mikewied

    SPY-54: getBulk() shouldn't log a warning when a key is not found

    mikewied authored mikewied committed
    A key not being found is not incorrect behavior for memcached so
    having a warning here is incorrect.
    
    Change-Id: I9fc07dd898205612b384f8c4e9820cb186f8e550
    Reviewed-on: http://review.couchbase.org/9513
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
Commits on Sep 9, 2011
  1. @mikewied

    SPY-47: Client object should have toString().

    mikewied authored mikewied committed
    The toString() method in MemcachedClient now prints out it's
    configuration eg. the information of the ConnectionFactory it
    is using.
    
    Change-Id: Ic8f3741bdcdc97d5bb46b2c4a68caec998903fde
    Reviewed-on: http://review.couchbase.org/9473
    Tested-by: Michael Wiederhold <mike@couchbase.com>
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
  2. @mikewied

    Added toString() functions to ConnectionFactory classes.

    mikewied authored mikewied committed
    This will allow us to see how users have configured their client
    and will greatly help in debugging issues from customers.
    
    Change-Id: I840259953d1d5192f1038e734103b63281e68ed0
    Reviewed-on: http://review.couchbase.org/9472
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
  3. @mikewied

    SPY-39: Added toString() to operation heirarchy

    mikewied authored mikewied committed
    Change-Id: Ie3ea5b8d04b683303fe8e5f4d5b7b22d7d5bd18b
    Reviewed-on: http://review.couchbase.org/9475
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
  4. @mikewied

    Change getBytes() to getData() in CASOperation

    mikewied authored mikewied committed
    The getBytes function was incorrectly named in the CASOperation
    class for two reasons. First the function actually gets the
    data field from a message so getData() is a better name. Second,
    in the StoreOperation class and other classes the name of the
    function is getData() so this improves consistency. This issue
    was notice when I was looking at the StoreOperation and saw that
    this class had two different functions that did exactly the same
    thing.
    
    Change-Id: I4d0c95f309a6f1bb1ccde52ffdf6e9ab1958bebe
    Reviewed-on: http://review.couchbase.org/9474
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
Commits on Sep 7, 2011
  1. @mikewied

    Removed unused variables in GetOperationImpl

    mikewied authored mikewied committed
    Change-Id: I3c52dfd21b7b02ea4e9d5f97fd7ed9b034ca0237
    Reviewed-on: http://review.couchbase.org/9455
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
  2. @mikewied

    SPY-49: BaseSerializingTranscoder does not close resources.

    mikewied authored mikewied committed
    Change-Id: Ifa6b356a9faaad39f12f2cf28d34fbc837faa7b7
    Reviewed-on: http://review.couchbase.org/9454
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
  3. @mikewied

    Remove assertions that assert a completed op isn't timed out

    mikewied authored mikewied committed
    Matt was trying to assure we weren't erroneously marking something
    timedout that had been completed. The timeout can come from either
    the IO thread or the latch from the asynch call. Now that we have
    synchronized methods this shouldn't happen.
    
    Change-Id: I4b7e02f839074f80909d4f0fb44b707b76a1a5d5
    Reviewed-on: http://review.couchbase.org/9436
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
  4. @mikewied

    Add support for commons-codec 1.3, 1.4, and 1.5

    mikewied authored mikewied committed
    Some versions of commons-codec append a \r\n onto the end
    of Base64 encoded strings. This fix checks the encoding for
    a trailing \r\n and if it finds one, removes if from the
    string.
    
    Change-Id: I9b23a19608bfa91cba64e0d579fb49f20612b286
    Reviewed-on: http://review.couchbase.org/9443
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
Commits on Sep 6, 2011
  1. @mikewied

    Use direct buffers in TCPMemcachedNodeImpl

    Daniel Martin authored mikewied committed
    Since the buffers in a TCPMemcachedNodeImpl are allocated rarely (only
    on client creation or reconfigure), and are passed to Channel.read()
    and Channel.write() repeatedly, it's best to use direct buffers to
    avoid http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6214569
    
    Change-Id: I4fafa41e9072aa514e2da97a977c6ac6adc759d5
    Reviewed-on: http://review.couchbase.org/9435
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
  2. @mikewied

    Fix concurrent access to operations objects, especially near timeouts

    Daniel Martin authored mikewied committed
    We discovered that having one thread call get() on futures with a
    timeout much shorter than the timeout built into the client could
    (after a while) reliably kill off the IO thread with a
    NullPointerException. After restarting with assertions enabled, we
    found many other ways to make the IO thread die relating mostly to
    operations that were canceled or timed out in one thread while they
    were being used in another thread.
    
    The solution to this is to make "timing out" an operation something
    similar to "cancel" - that is, not a state of the operation's state
    machine, but just a flag. Then, since this flag (as with the cancelled
    flag) can be read and set from multiple threads, synchronize the
    methods that do that.
    
    Ideally, transitionState and getState would never be called outside
    the IO thread; however, since at least getState is currently, both
    getState and transitionState should then also be synchronized.
    
    With these changes, we don't end up killing off the IO thread anymore.
    
    Change-Id: Ice7bac2ba1e2dbcd2004f5d7920944eef6bbbcb8
    Reviewed-on: http://review.couchbase.org/9431
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
  3. @mikewied

    Improved performance of write queue processing during timeouts

    mikewied authored mikewied committed
    There were two major issues here. First if there are a lot of
    timeouts in a row then we processing the write queue we removed
    them only one at a time. We now are able to process the entire
    write queue each time the handleIO function is called. The
    second issue was that it is possible to send timed out requests
    to the server. This would happen if there was one not timed out
    request followed by some timed out requests. Since in the while
    loop we don't check to see if an operation is timed out (or
    cancelled) we would send it anyways. This commit addresses both
    of these issues by adding a getNextWritable() op which only
    operations that should be written. If the write queue is empty
    it returns null.
    
    Change-Id: I427e5a47cf2e8ad89e3f59c895f3ef8e0ad36550
    Reviewed-on: http://review.couchbase.org/9429
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
  4. @mikewied

    SPY-125: Significant performance issue large number of sets

    mikewied authored mikewied committed
    We now add an operation to the read queue when we transistion it
    into a WRITING state. This guarentees that the operation is added
    to the read queue once. As a result we no longer have to check to
    see if the operation has already been added to the read queue
    
    Change-Id: I0b21d3e1ac7ff7792afabc57c1a8a26c6b757c12
    Reviewed-on: http://review.couchbase.org/9425
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
  5. @mikewied

    Operations can't timeout when writing to the write buffer.

    mikewied authored mikewied committed
    We implemented a mechanism for operations to be able to timeout
    while waiting to be written to a socket, but failed to take into
    account the fact that an item can timeout while in the middle
    of writing to that buffer.
    
    This commit adds a new OperationState called WRITE_QUEUED that
    specifies that the operation is waiting to be written to the
    write buffer. When an operation begins writing to the write
    buffer it goes into the WRITING state. When an operation is in
    the WRITING state it cannot time out
    
    Change-Id: Ib4ed9e1764c31e9270f79206b11574d98638e989
    Reviewed-on: http://review.couchbase.org/9424
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
Commits on Aug 16, 2011
  1. @ingenthr @mikewied

    Update commons-codec to 1.5 in .classpath for Eclipse.

    ingenthr authored mikewied committed
    Change-Id: I5342fcbdd31a0ed93b58a3e6ee8be9f6f9f75259
    Reviewed-on: http://review.couchbase.org/8995
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Michael Wiederhold <mike@couchbase.com>
  2. @ingenthr @mikewied

    Log warnings when retrying due to not my vbucket.

    ingenthr authored mikewied committed
    The existing behavior with not my vbucket errors prior to this
    change would warn when it receives an error to the log, but it
    would not followup that warning with any indication of what it
    did with the operation.  This can cause confusion end users
    are logging what's happening, so give the logging some symmetry
    by logging any retries due to not-my-vbucket.
    
    Change-Id: I14a1a93db924728b087161cdbb98a5e34f9c3f73
    Reviewed-on: http://review.couchbase.org/8984
    Tested-by: Matt Ingenthron <matt@couchbase.com>
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Commits on Aug 10, 2011
  1. @pasha407 @ingenthr

    Spymemcached Issue 134: Performance fix

    pasha407 authored ingenthr committed
    Change-Id: I07a57fb676f91f14b74db1499f4cdc17fcd960ab
    Reviewed-on: http://review.couchbase.org/8680
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Matt Ingenthron <matt@couchbase.com>
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Commits on Jul 21, 2011
  1. @vitaly-rudenya @ingenthr

    All NodeLocator's can be reconfigured.

    vitaly-rudenya authored ingenthr committed
    Change-Id: I51b3b72eb46c781eb3766435f43e57ded683514b
    Reviewed-on: http://review.couchbase.org/8115
    Reviewed-by: Vitaly Rudenya <vitaly.rudenya@altoros.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Matt Ingenthron <matt@couchbase.com>
  2. @ingenthr

    VBucketNodeLocator should not implement getSequence()

    ingenthr authored ingenthr committed
    Change-Id: Ia0a5c54abca51933995dc307bb5318ebf7dddbce
    Reviewed-on: http://review.couchbase.org/8196
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Tested-by: Matt Ingenthron <matt@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
  3. @ingenthr

    Ensure nodesMap updates are safe when topology changes.

    ingenthr authored ingenthr committed
    This change much more closely (perhaps too defensively)
    couples the Config and the list of nodes.  It also ensures
    that the Map<String, MemcachedNode> is less prone to
    concurrency problems and fixes a concurrency problem which
    allowed nodes to be removed when receiving a not-my-vbucket
    response.
    
    This indicates we need to make some changes to how the entire
    object model and config list are handled, but just to quickly
    fix a race found, tie together the config and node list when
    locating the right node.
    
    Testing for this is rather manual at the moment.
    
    Change-Id: Ida002fd1d510d20c432e77e01eefbc530d3b34b1
    Reviewed-on: http://review.couchbase.org/8195
    Tested-by: Matt Ingenthron <matt@couchbase.com>
    Reviewed-by: Michael Wiederhold <mike@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Something went wrong with that request. Please try again.