Jdesk / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

addq is not quiet #80

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When i use addq(0x12) to add a new value when the key's data is existed,it is 
not quiet,memcached 1.4.0 write a response back with message "Data exists for 
key.".

But in the binary protocol document,it says that 
  " A quiet version of a command will not send back a response, except for
   GetQ and GetKQ."

I think this is a bug.And replaceq has the same problem when the data with 
key is not existed.

Original issue reported on code.google.com by killme2...@gmail.com on 21 Aug 2009 at 6:31

GoogleCodeExporter commented 9 years ago
This appears to be a documentation bug.

The quiet commands are intended to not respond for normal, but uninteresting
conditions.  These vary by command.

In the case of get, a negative response of not_found is a normal condition that 
is
not interesting, however a positive response of found (with value) is 
interesting.

In the case of add, a positive responses of "added" is a normal condition that 
is not
interesting, but a negative response indicating the add did not do what was 
intended
is very interesting.

If we don't do it this way, then we can't build reliable tools on top of the
memcached protocol.

Original comment by dsalli...@gmail.com on 21 Aug 2009 at 12:40

GoogleCodeExporter commented 9 years ago
But in text protocol,there is no response even if the data with key is 
existed,when
you use add with "noreply" option.Addq is equals to text protocol "add 
noreply",it
means i don't care operation result,there is a difference between text protocol 
and
binary protocol.

Original comment by killme2...@gmail.com on 22 Aug 2009 at 2:29

GoogleCodeExporter commented 9 years ago
That is correct.  It was a design flaw in the text protocol we corrected in the
binary protocol.

Original comment by dsalli...@gmail.com on 22 Aug 2009 at 2:37

GoogleCodeExporter commented 9 years ago
It is easy to ignore the response in your client if you want to, because the 
response packet contains the 
command id so you _know_ it is a response for a addq command (and that is an 
error)...

Original comment by trond.no...@gmail.com on 22 Aug 2009 at 6:41

GoogleCodeExporter commented 9 years ago
Clarified the documentation.

Original comment by dsalli...@gmail.com on 23 Aug 2009 at 7:48