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

Possible issue with cas delete + lock

    XMLWordPrintable

    Details

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

      Description

      Moved over from other ticket:

      Hi Michael,

      I have tested the new version 2.9.1 (I see that the delete method with cas is there) and it still fails to delete a locked object. It works with a gets and then a delete (this works without problem) but not with a lock and then a delete. So I cannot delete a locked object with this patch. My code is very simple:

      URI base = new URI("http://localhost:8091/pools");
      ArrayList baseURIs = new ArrayList();
      baseURIs.add(base);
      client = new CouchbaseClient(baseURIs, "default", null, "");
      String key = "dd2982ff68406c937040cd0c509b";
      System.err.println("Creating the object");
      OperationFuture<Boolean> addFuture = client.add(key, 300, "lala");
      System.err.println("Status add: " + addFuture.getStatus());
      System.err.println("Getting and locking the object");
      OperationFuture<CASValue<Object>> future = client.asyncGetAndLock(key, 30);
      System.err.println("Status getl: " + future.getStatus());
      if (!future.getStatus().isSuccess())

      { throw new Exception("Error locking!!!!"); }

      System.err.println("Lock is mine");
      System.err.println("Status getl: " + future.get());
      System.err.println("delete");
      OperationFuture<Boolean> future4 = client.delete(key, future.get().getCas());
      System.err.println("delete: " + future4.getStatus());
      if (!future4.getStatus().isSuccess())

      { throw new Exception("Error deleting!!!"); }

      The error is: "Temporary failure". If the getAndLock is substituted by an asyncGets it works perfectly.

      Is this error something that is going to be fixed in another bug? is this one still in progress?

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          daschl Michael Nitschinger created issue -
          avsej Sergey Avseyev made changes -
          Field Original Value New Value
          Attachment spy-129.c [ 18390 ]

            People

            • Assignee:
              daschl Michael Nitschinger
              Reporter:
              daschl Michael Nitschinger
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes