Details
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
- 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
- relates to
-
MB-22014 MCBP documentation framework
- Closed
For Gerrit Dashboard: MB-22778 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
73961,3 | MB-22778: GETL with default time should not fail | master | memcached | Status: MERGED | +2 | +1 |