Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-22778

Getl with no extra fields receives "Key Not found" response where on older versions it locks for default time.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.0.0
    • 5.0.0
    • memcached
    • None
    • centos7
      Build 5.0.0-1648
    • Untriaged
    • Yes

    Description

      There is a bug in the .Net client where it does not set the extra field when doing an getl operation. On Couchbase Server 4.X the operation is accepted and the document is locked for the default time. On Spock the operations is rejected with "Key Non Found".

      Steps To reproduce

      1. Use the following .Net program:

        using System;
        using System.Collections.Generic;
        using System.Threading;
        using Couchbase;
        using Couchbase.Configuration.Client;
         
        namespace CouchbaseLock
        {
        	class MainClass
        	{
        		public static void Main(string[] args)
        		{
        			var config = new ClientConfiguration{
        				Servers = new List<Uri> {
        					new Uri("http://10.112.171.101:8091"),
        				}
        			};
        			ClusterHelper.Initialize(config);
        			var bucket = ClusterHelper.GetBucket("default");
         
        			var doc = new Document<dynamic>
        			{
        				Id = "NET",
        				Content = new
        				{
        					name = "Couchbase"
        				}
        			};
        			bucket.Upsert(doc.Id, doc);
                                // Lock for 1 second which never happens because  of the .NET bug 
                                // <4.5: it will lock for the default time of 15 seconds
                                // Spock: It will reject the operations with Key Not Found:
        			var locked = bucket.GetAndLock<dynamic>(doc.Id, 1);
        		}
        	}
        }
        

      Problem
      The operation is rejected with "Key Not Found" as shown in the tcpdump:

      Expectation
      For Spock to same the behaviour the same as 4.X, so compatibility with the .NET SDK can be maintained.

      I understand that the .Net client might be sending an invalid packet but I think keep compatibility is more important.
      I see that the Get Lock packet layout is not documented it would be good if we can update that to avoid confusion in the future.

      Attachments

        Issue Links

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

          Activity

            People

              trond Trond Norbye
              pvarley Patrick Varley (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty