You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by David Puebla Garcia <Da...@infor.com> on 2016/02/23 00:08:09 UTC

Integration issue with enyimmecached client

Hello,

Following is the description of the issue as I posted it in gitter.

I have run into an integration issue between ignite memcached interface and Enyim client implementation. https://github.com/enyim/EnyimMemcached
I am basically evaluating the options for ignite to replace memcached in some of our scenarios.
The problem is that strings being SET by the Enyim client are being stored in memcached as a boolean.
I debugged the code and I believe the issues is caused by the interpretation of the extra flags in the memcached protocol.
EnyimMemcached uses the memcached extra flags to encode the type of the data being stored.
My understanding is that the memcached protocol indicates that the extra flags should be opaque to the server and returned as part of the value but ignite uses it to interpret the incoming data.
See GridTcpRestParser.decodeObj
Has this issue being reported already? If so are there any workarounds/ignite configuration to change the behavior for how the values are being handled? If needed I can try to provide more detail on the issue.


Following is a sample console application that uses Enyim memcached client with ignite:


using System;

using System.Collections.Generic;

using System.Linq;

using System.Net;

using System.Text;

using System.Threading.Tasks;

using Enyim.Caching;

using Enyim.Caching.Configuration;

using Enyim.Caching.Memcached;


namespace MemcachedTestClientConsoleApp

{

    classProgram

    {


        static void Main(string[] args)

        {

            MemcachedClientConfiguration config = new MemcachedClientConfiguration();


            config.Servers.Add(new IPEndPoint(IPAddress.Loopback, 11211));


            config.Protocol = MemcachedProtocol.Binary;

            config.NodeLocator = typeof(KetamaNodeLocator);



            var mc = new MemcachedClient(config);


            List<String> keysToSave = new List<String>();


            string key = Guid.NewGuid().ToString();

            string value = Guid.NewGuid().ToString();


            mc.Store(StoreMode.Set, key, value);


            string storedValue = mc.Get<string>(key);


            Console.WriteLine(value);

            Console.WriteLine(storedValue);


            Console.ReadLine();

        }

    }

}


I can share the project if required I just did not want to attached it in this email in case it could get blocked.

I am using Enyim.Caching nugget package version 2.13.0.0


Please let me know if more information is required.


Thank you


David


Re: Integration issue with enyimmecached client

Posted by vkulichenko <va...@gmail.com>.
David,

Ignite has to be compatible with memcached binary protocol, and if it's not,
it has to be fixed. I will investigate this deeper and let you know.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Integration-issue-with-enyimmecached-client-tp3136p3164.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Integration issue with enyimmecached client

Posted by David Puebla Garcia <Da...@infor.com>.
Val,

No I do not know where there is a better binary protocol specification.
I was just debugging it and found that inconsistency so this is why I pointed out to help on troubleshooting the issue.

Is there any other specification that ignite uses to interpret the flags out of the memcached request?

Thank you

David



On 2/23/16, 1:57 AM, "vkulichenko" <va...@gmail.com> wrote:

>David,
>
>OK, now I get it. I will take a closer look at this.
>
>Do you by any chance know where I can find good description of Memcache
>binary protocol? It sounds like you're quoting [1], which is actually text
>protocol. It's a different one.
>
>[1] https://github.com/memcached/memcached/blob/master/doc/protocol.txt
>
>-Val
>
>
>
>--
>View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Integration-issue-with-enyimmecached-client-tp3136p3151.html
>Sent from the Apache Ignite Users mailing list archive at Nabble.com.

RE: Integration issue with enyimmecached client

Posted by vkulichenko <va...@gmail.com>.
David,

OK, now I get it. I will take a closer look at this.

Do you by any chance know where I can find good description of Memcache
binary protocol? It sounds like you're quoting [1], which is actually text
protocol. It's a different one.

[1] https://github.com/memcached/memcached/blob/master/doc/protocol.txt

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Integration-issue-with-enyimmecached-client-tp3136p3151.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

RE: Integration issue with enyimmecached client

Posted by David Puebla Garcia <Da...@infor.com>.
Hi Val,

My point is that the client is entitled to used whatever flag it wants to describe its data. The spec describes that those should be opaque to the server. In this case the client flags the strings in a way that ignite interprets as Boolean.

There is no specification describing which flag should be used for each data type.

My first attempt to use ignite would be as in place replacement to memcached. So this is what I was testing.
I can definitely explore using ignite's client but for some of the applications it would be nice to use memcached interfaces out of the box.

Thank you

David


________________________________________
From: vkulichenko [valentin.kulichenko@gmail.com]
Sent: Monday, February 22, 2016 9:24 PM
To: user@ignite.apache.org
Subject: Re: Integration issue with enyimmecached client

Hi David,

Are you saying that the client sends the value with the boolean type flag
set which causes it to be saved as a boolean in the cache? It sounds like a
client issue, no? Let me know if I'm missing something.

Actually, is it a requirement for you to use memcached client? Can you
switch to native Ignite API (see example [1])? It will give you a lot of
additional features and will give much better performance.

[1]
https://github.com/apache/ignite/blob/master/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Integration-issue-with-enyimmecached-client-tp3136p3144.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Integration issue with enyimmecached client

Posted by vkulichenko <va...@gmail.com>.
Hi David,

Are you saying that the client sends the value with the boolean type flag
set which causes it to be saved as a boolean in the cache? It sounds like a
client issue, no? Let me know if I'm missing something.

Actually, is it a requirement for you to use memcached client? Can you
switch to native Ignite API (see example [1])? It will give you a lot of
additional features and will give much better performance.

[1]
https://github.com/apache/ignite/blob/master/modules/platforms/dotnet/examples/Apache.Ignite.Examples/Datagrid/PutGetExample.cs

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Integration-issue-with-enyimmecached-client-tp3136p3144.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.