You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should missing commands just be forwarded to redis?
Consider the following scenario:
new command supported by redis-rb (yay!)
people use it under redis-namespace, expecting it to be namespaced
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.
The text was updated successfully, but these errors were encountered:
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.
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)
Should missing commands just be forwarded to redis?
Consider the following scenario:
redis-rb
(yay!)redis-namespace
, expecting it to be namespacedredis-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.
The text was updated successfully, but these errors were encountered: