Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Decision: Missing Commands #34

Open
yaauie opened this issue Jan 10, 2012 · 3 comments
Open

Design Decision: Missing Commands #34

yaauie opened this issue Jan 10, 2012 · 3 comments

Comments

@yaauie
Copy link
Member

yaauie commented Jan 10, 2012

Should missing commands just be forwarded to redis?

Consider the following scenario:

  1. new command supported by redis-rb (yay!)
  2. people use it under redis-namespace, expecting it to be namespaced
  3. only to find out later that it is not; an upgrade of redis-namespace means taking down the application and manually migrating data.

Wouldn't it be better to find out that a command is not supported while in dev? A warning, at least, if not an outright error?

I ended up with > 500,000 records not-namespaced because I used setbit and getrange, neither of which were namespaced so it worked at a unit test level. When I deployed a change that would expire or delete keys, those functions were namespaced, so they didn't work, leading me to find the root cause. Knowing that these functions were not supported while in dev would have saved me a production-scale headache.

@hectcastro
Copy link
Contributor

I had a similar experience with mapped_hmget. For some reason mapped_hmset support was added, but not mapped_hmget. I eventually used MONITOR to discover that records were being added with a namespace and lookups weren't.

I would probably agree with something as simple as emitting warning messages to STDERR when a command isn't found in the lookup hash.

@hone
Copy link
Member

hone commented May 25, 2012

I would accept a patch that printed a warning with a test.

@bitterb
Copy link
Contributor

bitterb commented Jan 21, 2013

I found that 81a742f had already added a warning for missing commands. But after @defunkt committed it, he reverted it and added a comment instead (see fa6dfcd).

Nevertheless, if we discuss his decision and find that it is better to add a warning again, we can do so. For example, to avoid being too annoying, how about adding an option like warn to enable the warning?

r = Redis::Namesapce.new(:ns, :redis=@r, :warn=true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants