[MB-6840] GAT not populating proper error information Created: 12/Sep/12  Updated: 26/Oct/12  Resolved: 16/Oct/12

Status: Resolved
Project: Couchbase Server
Component/s: couchbase-bucket
Affects Version/s: None
Fix Version/s: 2.0-beta-2
Security Level: Public

Type: Bug Priority: Major
Reporter: Mark Nunberg Assignee: Mike Wiederhold
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.couchbase.sdkd;

import com.couchbase.client.CouchbaseClient;
import java.net.URI;
import java.util.LinkedList;
import java.util.List;
import net.spy.memcached.CASValue;
import net.spy.memcached.internal.OperationFuture;

/**
 *
 * @author mnunberg
 */
public class GatBug {
    public static void main(String[] args)
    throws Exception {
        URI url = new URI("http://localhost:8091/pools");
        
        List<URI> ul = new LinkedList<URI>();
        ul.add(url);
        
        CouchbaseClient cli = new CouchbaseClient(ul, "default", "");
        OperationFuture gop = cli.asyncGetAndTouch("non-existent-key", 5);
        gop.get();
        System.err.println(gop.getStatus());
    }
}

/** output **/


2012-09-12 16:28:28.855 INFO com.couchbase.client.CouchbaseConnection: Added {QA sa=/10.0.0.99:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2012-09-12 16:28:28.857 INFO com.couchbase.client.CouchbaseConnection: Added {QA sa=/10.0.0.20:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2012-09-12 16:28:29.166 INFO com.couchbase.client.CouchbaseConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@2cb0ce8f
2012-09-12 16:28:29.167 INFO com.couchbase.client.CouchbaseConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@bc92535
{OperationStatus success=false: }


 Comments   
Comment by Mike Wiederhold [ 14/Sep/12 ]
This result looks correct to me. When you print the status it says the operation failed. Can you tell me what you expect the the result to be? Please assign back to me after you comment.
Comment by Mark Nunberg [ 14/Sep/12 ]
the key does not exist on the server so it should be ENOENT, or 'Not Found'.
Comment by Mike Wiederhold [ 04/Oct/12 ]
Mark,

In my example that I ran this is what I got. Please print the result of getStatus().getMessage() and you should get something back that says the key was not found. In any case the operation did properly return that the operation wasn't successful.
Comment by Mark Nunberg [ 04/Oct/12 ]
public class GatBug {
    public static void main(String[] args)
    throws Exception {
        URI url = new URI("http://localhost:8091/pools");
        
        List<URI> ul = new LinkedList<URI>();
        ul.add(url);
        
        CouchbaseClient cli = new CouchbaseClient(ul, "default", "");
        OperationFuture gop = cli.asyncGetAndTouch("non-existent-key", 5);
        gop.get();
        System.err.printf("Status=%s, Message=%s\n",
                gop.getStatus(), gop.getStatus().getMessage());
        
        
        gop = cli.asyncGets("non-existent-key");
        gop.get();
        System.err.printf("status=%s, Message=%s\n",
                gop.getStatus(), gop.getStatus().getMessage());
    }
}

/****
2012-10-04 21:10:47.508 INFO com.couchbase.client.CouchbaseConnection: Added {QA sa=/127.0.0.1:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue
2012-10-04 21:10:47.518 INFO com.couchbase.client.CouchbaseConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@bc92535
Status={OperationStatus success=false: }, Message=
status={OperationStatus success=false: Not found}, Message=Not found
****/
Comment by Mike Wiederhold [ 16/Oct/12 ]
http://review.couchbase.org/#/c/21697/
Comment by Thuan Nguyen [ 17/Oct/12 ]
Integrated in github-ep-engine-2-0 #444 (See [http://qa.hq.northscale.net/job/github-ep-engine-2-0/444/])
    MB-6840: GAT returns error messages when an error occurs (Revision 10b593cf4d97eaf062a6076878c5f8000d093ee9)

     Result = SUCCESS
Mike Wiederhold :
Files :
* src/ep_engine.cc
Comment by kzeller [ 26/Oct/12 ]
was fixed in 2.0 so moved away from .next
Comment by kzeller [ 26/Oct/12 ]
Added to release notes as:

Get-and-touch returned incorrect error messages when an error occurs.
Get-and-touch now returns ENOENT if key does not exist.
Generated at Tue Oct 21 08:52:05 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.