Ticket #2957 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

Update memcache client with new commands of memcached 1.2.4

Reported by: therve Owned by: therve
Priority: highest Milestone:
Component: core Keywords:
Cc: Branch: branches/memcache-update-2957
Author: therve Launchpad Bug:

Description

There are 4 new commands: gets, append, prepend, cas.

Change History

Changed 3 years ago by therve

  • branch set to branches/memcache-update-2957
  • author set to therve

(In [22100]) Branching to 'memcache-update-2957'

Changed 3 years ago by therve

(In [22102]) Add the 4 new methods and tests for them.

Refs #2957

Changed 3 years ago by therve

  • priority changed from normal to highest
  • owner therve deleted
  • keywords review added

This is ready to review. The gets and cas facility is not that awesome, but hey.

Changed 3 years ago by exarkun

  • keywords review removed
  • owner set to therve

For the cas docstring, I'd say something like this:

Change the content of C{key} only if the C{cas} value matches the
current one associated with the key. Use this to store a value which
hasn't been modified since last time you fetched it.

Also, capitalize the first letter of the first word of a sentence (eg, for the @param docs). ;)

cas is a really opaque name. Even after reading the diff, I don't know what those letters in that order mean. Is there something more understandable we can use here? Likewise, the name gets doesn't really tell me that it differs from get in that it returns the cas value as well.

  • 64 bits value should probably be 64 bit value
  • if the operations has should probably be if the operation has (multiple places)
  • setUp docstring misspells protocol as protoco

Changed 3 years ago by therve

(In [22180]) Fix the docstrings.

Refs #2957

Changed 3 years ago by therve

I'm not sure what to do here. The memcached semantics is not really clear. The cas is a unique numerical identifier, that's all I know. Do you think docstring needs further enhancements?

Changed 3 years ago by therve

  • owner therve deleted
  • keywords review added

Changed 3 years ago by exarkun

  • keywords review removed
  • owner set to therve

I found "cas" on google, it seems to mean "check and set", which is reasonable in context.

So perhaps the cas method can be renamed checkAndSet (it should still have cas in the docstring I guess, since most people seem to refer to this feature that way; I'm not sure if they know what it stands for either).

Maybe gets could be getWithIdentifier, or maybe get could take a flag that specifies this behavior. Just random ideas, I don't feel as strongly about this as about the cas method. I leave it up to your judgement.

I noticed there seems to be no direct coverage of the failure case for append or prepend. This is sort of tested by test_invalidCommand, but direct tests would be good.

Changed 3 years ago by therve

(In [22340]) Process review comments.

Refs #2957

Changed 3 years ago by therve

  • keywords review added
  • owner therve deleted

Thanks for the search, I didn't manage to find something but checkAndSet is indeed clear in its goal. I think I've done all points.

Changed 3 years ago by exarkun

  • keywords review removed
  • owner set to therve

The docstring for MemCacheProtocol.get is missing some text in the @param withIdentifier field.

Everything else looks fine, merge when that's fixed.

Changed 3 years ago by therve

  • status changed from new to closed
  • resolution set to fixed

(In [22445]) Merge memcache-update-2957

Author: therve Reviewer: exarkun Fixes #2957

Update the memcache client protocol with the new commands of memcached 1.2.4.

Note: See TracTickets for help on using tickets.