Uploaded image for project: 'Spymemcached Java Client'
  1. Spymemcached Java Client
  2. SPY-177

Memcached Bucket Drops Connection on Too Large Document

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: library
    • Security Level: Public
    • Labels:
      None

      Description

      When making a set with a document over 1 MB to Couchbase using the latest Java client to a Memcached-type bucket, an expected "Too Large" response is returned, but then the connection is dropped. The following application hangs on shutdown, and was compiled with the instructions at http://www.couchbase.com/communities/c-client-library. Other clients look to have similar behavior, so appears to be a server issue.

      import com.couchbase.client.CouchbaseClient;
      import java.net.URI;
      import java.util.Arrays;
      import java.util.List;
      import java.util.Date;
      import java.text.DateFormat;
      import java.text.SimpleDateFormat;
      import java.util.Calendar;

      public class App {

      public static void main(String[] args) throws Exception

      { List<URI> hosts = Arrays.asList( new URI("http://10.4.2.57:8091/pools")); // Name of the Bucket to connect to String bucket = "TestBucket"; // Password of the bucket (empty) string if none String password = ""; CouchbaseClient client = new CouchbaseClient(hosts, bucket, password); int[] intArray = new int[1048576 * 2]; for (int i=0; i < (1048576 * 2); i++) intArray[i] = i; System.out.println("length is" + intArray.length); // Store a Document client.set("my-first-document", intArray).get(); // Retreive the Document and print it System.out.println(client.get("my-first-document")); // Shutting down properly client.shutdown(); System.exit(0); }

      }

      Response:

      2014-06-23 11:36:15.120 ERROR net.spy.memcached.protocol.binary.StoreOperationImpl: Error: Too large
      Exception in thread "main" 2014-06-23 11:36:15.122 WARN net.spy.memcached.protocol.binary.BinaryMemcachedNodeImpl: Discarding partially completed op: Cmd: 1 Opaque: 7 Key: my-first-document Cas: 0 Exp: 0 Flags: 3 Data Length: 4210182
      2014-06-23 11:36:15.123 INFO com.couchbase.client.CouchbaseMemcachedConnection: Reconnection due to exception handling a memcached operation on

      {QA sa=/10.4.2.57:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=5}

      . This may be due to an authentication failure.
      java.util.concurrent.ExecutionException: OperationException: SERVER: Too large
      at net.spy.memcached.internal.OperationFuture.get(OperationFuture.java:174)

      1. response.txt
        5 kB
        Jeff Dillon
      2. TestBucket.pcap
        172 kB
        Jeff Dillon
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        mikew Mike Wiederhold added a comment -

        I'm pretty sure this is how the java sdk handles this scenario and that it is not a server issue.

        Show
        mikew Mike Wiederhold added a comment - I'm pretty sure this is how the java sdk handles this scenario and that it is not a server issue.
        Hide
        jdillon Jeff Dillon added a comment -

        Here is the test run from my java client (192.168.212.249) against a Windows 2.5.1 server (192.168.212.248)

        Show
        jdillon Jeff Dillon added a comment - Here is the test run from my java client (192.168.212.249) against a Windows 2.5.1 server (192.168.212.248)
        Hide
        steve Steve Yen added a comment -

        > I'm pretty sure this is how the java sdk handles
        > this scenario and that it is not a server issue.

        Hi Michael N.
        Reassigning this based on Mike W's prognosis. (btw, if you find it's actually a server-side thing, my guess is the right server-side guru to start with would be Trond / memcached.)
        – steve

        Show
        steve Steve Yen added a comment - > I'm pretty sure this is how the java sdk handles > this scenario and that it is not a server issue. Hi Michael N. Reassigning this based on Mike W's prognosis. (btw, if you find it's actually a server-side thing, my guess is the right server-side guru to start with would be Trond / memcached.) – steve
        Hide
        mikew Mike Wiederhold added a comment -

        I just double checked the code and this is how spymemcached handles this situation and it can very easily be handled differently. I also remember this coming up in the past and Matt had some reason for leaving things the way they were but I can't remember what that reason was. I've moved this to the appropriate project and Matt and Michael can decide what they want to do with this ticket. Below is the place where we throw the exception and this exception will cause the connection to be reset.

        https://github.com/couchbase/spymemcached/blob/master/src/main/java/net/spy/memcached/protocol/binary/OperationImpl.java#L242

        Show
        mikew Mike Wiederhold added a comment - I just double checked the code and this is how spymemcached handles this situation and it can very easily be handled differently. I also remember this coming up in the past and Matt had some reason for leaving things the way they were but I can't remember what that reason was. I've moved this to the appropriate project and Matt and Michael can decide what they want to do with this ticket. Below is the place where we throw the exception and this exception will cause the connection to be reset. https://github.com/couchbase/spymemcached/blob/master/src/main/java/net/spy/memcached/protocol/binary/OperationImpl.java#L242

          People

          • Assignee:
            daschl Michael Nitschinger
            Reporter:
            jdillon Jeff Dillon
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:

              Gerrit Reviews

              There are no open Gerrit changes