Jdesk / memcached

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

Textual delete command w/ expire time & noreply in binary protocol version #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1)
The textual delete command w/expire time in the binary protocol version:
It's now possible to add and replace an item inside the expiry time window
that was previously set when the item was deleted with an expiry time.
e.g. :
"delete foo 10\r\n" returns "DELETED\r\n"
"add foo 0 0 7\r\nfoo-add\r\n" returns "STORED\r\n" instead of "NOT_STORED\r\n"
"replace foo 0 0 11\r\nfoo-replace\r\n" returns "STORED\r\n" instead of
"NOT_STORED\r\n"

2)
The textual delete command with both expire time and noreply:
e.g.
"delete noreply:foo 10 noreply" returns "ERROR\r\n".
Two things are wrong: 1) There should be no reply. 2) Any reply should've
been either "DELETED\r\n" or "NOT_FOUND\r\n".

Original issue reported on code.google.com by victor.k...@sun.com on 27 Nov 2008 at 11:49

GoogleCodeExporter commented 9 years ago
The support for expire time has been removed in delete. See
http://github.com/dustin/memcached/tree/rewritten-bin/doc/protocol.txt 

Then both delete commands should return "ERROR\r\n" ?
Or maybe a more appropriate return message would be "CLIENT_ERROR <error>\r\n" 
for both?

Original comment by victor.k...@sun.com on 4 Dec 2008 at 12:19

GoogleCodeExporter commented 9 years ago
It's unclear to me what the remaining bug is here.  If there's still a bug 
here, can
we update the summary so that we know what it is?

(acknowledging there's confusion around the disappearance of delete with 
timeout)

Original comment by dsalli...@gmail.com on 22 Jan 2009 at 1:21

GoogleCodeExporter commented 9 years ago
I think the only change under 2) should be returning "CLIENT_ERROR <error>\r\n"
instead of just "ERROR\r\n". Just because it's a more appropriate error message 
in
this case. I'm not sure about 1). We could keep it the way it is - i.e. 
accepting the
expire time in the delete command even if this means accepting a wrongly 
formatted
command. Maybe that's ok because of backward compatibility issues.

Original comment by victor.k...@sun.com on 22 Jan 2009 at 8:19

GoogleCodeExporter commented 9 years ago
I've pushed a branch for this (finally... this is an old one).

Original comment by dsalli...@gmail.com on 29 Oct 2009 at 6:09

GoogleCodeExporter commented 9 years ago

Original comment by dsalli...@gmail.com on 29 Oct 2009 at 6:09

GoogleCodeExporter commented 9 years ago
1) stats-detail and udp test fails
2) I liked that you wrote a better error message, but could you change it to:
"CLIENT_ERROR bad command line format. Usage: delete <key> [noreply]"

This would let the user know how to send the command without having to open the
protocol spec... ("bad command line format" could be replaced with "Syntax 
error" if
you want to shorten the error message ;-))

Original comment by trond.no...@gmail.com on 29 Oct 2009 at 1:01

GoogleCodeExporter commented 9 years ago

Original comment by trond.no...@gmail.com on 29 Oct 2009 at 5:14